Releases
0.8.0
Compare
Sorry, something went wrong.
No results found
Generate // TODO: comments after panics.
Style changes to ./middleware/logging.go, ./endpoints.go and ./exchanges.go.
Add generation of opentracing #53 :
Serves server and client side by wrapping endpoints.
Passes spans to headers/meta for http and grpc transports.
Add cache middleware #54 :
Generates Cache interface:
type Cache interface {
Set (key , value interface {}) (err error )
Get (key interface {}) (value interface {}, err error )
}
Service methods will use first argument as key and all results as value.
Or you may add code, which will replace 'key'.
// @cache-key createdAt.UTC()
Useful on client and server sides.
You should write your own, or adapt existing storage (e.g. sync.Map).
type InMemoryCache struct {
sync.Map
}
func (c * InMemoryCache ) Set (key , value interface {}) error {
c .Store (key , value )
return nil
}
func (c * InMemoryCache ) Get (key interface {}) (interface {}, error ) {
value , _ := c .Load (key ) // remember about _
return value , nil
}
You can’t perform that action at this time.