diff --git a/cache.go b/cache.go index 2e03468..63e2e68 100644 --- a/cache.go +++ b/cache.go @@ -6,7 +6,7 @@ package care import "time" -// A 'Cache' represents a common interface for responses caching. +// Cache represents a common interface for responses caching. // It can be implemented for many caches like Redis, Memcached, etc, type Cache interface { // Put data into the cache by key. diff --git a/clientunaryinterceptor.go b/clientunaryinterceptor.go index 97299a7..57b340d 100644 --- a/clientunaryinterceptor.go +++ b/clientunaryinterceptor.go @@ -49,7 +49,7 @@ func (s *unaryClientInterceptor) Unary() grpc.UnaryClientInterceptor { } } -// Makes a new unary client interceptor. +// NewClientUnaryInterceptor makes a new unary client interceptor. // There will be panic if options is an empty pointer. func NewClientUnaryInterceptor(opts *Options) grpc.DialOption { if opts == nil { diff --git a/inmemorycache.go b/inmemorycache.go index 925842d..58c9c24 100644 --- a/inmemorycache.go +++ b/inmemorycache.go @@ -123,7 +123,7 @@ func (s *inMemoryCache) Get(key string) ([]byte, error) { return nil, nil } -// Makes a built-in LRU in-memory cache implementation +// NewInMemoryCache - makes a built-in LRU in-memory cache implementation // aimed for small projects, MVP, etc. func NewInMemoryCache(capacity uint) Cache { return &inMemoryCache{ diff --git a/metafilter.go b/metafilter.go index a495282..5f80b11 100644 --- a/metafilter.go +++ b/metafilter.go @@ -4,7 +4,7 @@ package care -// Header's pools for filtering. +// Headers is a pool for filtering. type Headers struct { // Headers for the key computation. Allowed []string @@ -12,7 +12,7 @@ type Headers struct { Disallowed []string } -// A 'MetaFilter' represents an interface for filtering the headers +// MetaFilter represents an interface for filtering the headers // before including the once in the key computation. // // It can be useful if you need to pick up only a few header @@ -24,7 +24,7 @@ type Headers struct { // Having implemented your own version, you can control the headers // which will be involved in the key computation process. type MetaFilter interface { - // Returns true allowing to include the header in + // Allowed - returns true allowing to include the header in // the key computation, otherwise returns false. Allowed(key string, val []string) bool } diff --git a/methods.go b/methods.go index 105b319..ac7f81f 100644 --- a/methods.go +++ b/methods.go @@ -9,22 +9,23 @@ import ( "time" ) -// 'Methods' represents an interface that allows to define +// Methods is representing an interface that allows to define // the service's methods which responses you want to cache. type Methods interface { + // Cacheable // method - full method name // // Returns true and caching timeout if the method is found, // otherwise false and timeout in this case does not matter. Cacheable(method string) (bool, time.Duration) - // Allows to add method for caching. + // Add - allows to add method for caching. // Returns the 'Methods' in order to be // more convenient methods adding like a chain. Add(method string, ttl time.Duration) Methods // Remove the method from allowed to be cached. Remove(method string) - // Removes all methods. + // Clean - removes all methods. Clean() } diff --git a/options.go b/options.go index 1706c6d..11ffa77 100644 --- a/options.go +++ b/options.go @@ -4,7 +4,7 @@ package care -// Memoization options. There are some options you can redefine +// Options - memoization options. There are some options you can redefine // by your own implementation in order to have more flexibility. // 'Options' gives enough room space to do that. type Options struct { @@ -20,7 +20,7 @@ type Options struct { Cache Cache } -// Makes a default options set, having filled +// NewOptions - makes a default options set, having filled // all items by thread-safe implementations. func NewOptions() *Options { opts := Options{ diff --git a/serverunaryinterceptor.go b/serverunaryinterceptor.go index 967bcae..6fe08f8 100644 --- a/serverunaryinterceptor.go +++ b/serverunaryinterceptor.go @@ -33,7 +33,7 @@ func (s *unaryServerInterceptor) Unary() grpc.UnaryServerInterceptor { } } -// Makes a new unary server interceptor. +// NewServerUnaryInterceptor - makes a new unary server interceptor. // There will be panic if options is an empty pointer. func NewServerUnaryInterceptor(opts *Options) grpc.ServerOption { if opts == nil { diff --git a/switch.go b/switch.go index 24b801b..b4d95f5 100644 --- a/switch.go +++ b/switch.go @@ -8,14 +8,14 @@ import ( "sync/atomic" ) -// A feature switch. +// Switch is a switch feature. type Switch interface { - // Turns on the feature. + // TurnOn - turns on the feature. TurnOn() - // Turns off the feature. + // TurnOff - turns off the feature. TurnOff() - // Returns a state of the feature (turned on/off). + // IsTurnedOn - returns a state of the feature (turned on/off). IsTurnedOn() bool } diff --git a/zerometafilter.go b/zerometafilter.go index 2e1dff4..d6e86ba 100644 --- a/zerometafilter.go +++ b/zerometafilter.go @@ -12,7 +12,7 @@ func (s *zeroMetaFilter) Allowed(string, []string) bool { return s.allowed } -// Makes a zero-filter implementation. It can be used +// NewZeroMetaFilter - makes a zero-filter implementation. It can be used // if you don't have any rule for header filtering. // // allowed - defines common behaviour for any header