Documentation ¶
Index ¶
- Variables
- func SetDefaultAPIBreakerFlagsPrefix(prefix string)
- func SetDefaultAPIBreakerInterval(val time.Duration)
- func SetDefaultAPIBreakerMaxRequests(val uint32)
- func SetDefaultAPIBreakerTimeout(val time.Duration)
- func SetDefaultAPIFlagsPrefix(prefix string)
- func SetDefaultAPILogKVs(logkvs map[string]string)
- func SetDefaultAPIRateLimitDelta(val int)
- func SetDefaultAPIRateLimitDuration(val time.Duration)
- func SetDefaultAPIRateLimitFlagsPrefix(prefix string)
- type API
- type APIs
- type Breaker
- type Method
- type RateLimit
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrorNoAPIName = errors.New("API name is required") ErrorNoAPIMakeFunc = errors.New("no endpoint make function is specified") )
Functions ¶
func SetDefaultAPIBreakerFlagsPrefix ¶
func SetDefaultAPIBreakerFlagsPrefix(prefix string)
func SetDefaultAPIBreakerMaxRequests ¶
func SetDefaultAPIBreakerMaxRequests(val uint32)
func SetDefaultAPIFlagsPrefix ¶
func SetDefaultAPIFlagsPrefix(prefix string)
func SetDefaultAPILogKVs ¶
func SetDefaultAPIRateLimitDelta ¶
func SetDefaultAPIRateLimitDelta(val int)
func SetDefaultAPIRateLimitFlagsPrefix ¶
func SetDefaultAPIRateLimitFlagsPrefix(prefix string)
Types ¶
type API ¶
type API struct { Name string `json:"name" yaml:"name"` LogKVs map[string]string `json:"log" yaml:"log"` Instrument []string `json:"instrument" yaml:"instrument"` RateLimit RateLimit `json:"ratelimit" yaml:"ratelimit"` Breaker Breaker `json:"breaker" yaml:"breaker"` Path string `json:"path" yaml:"path"` Method string `json:"method" yaml:"method"` // CustomBindFlagsFunc defines custom bind flags behaviour for structure, if CustomBindFlagsFunc is nil, default bind flags behaviour will be used CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
func (API) GetGoKitLoggerKVs ¶
func (a API) GetGoKitLoggerKVs() (kvs []interface{})
type Breaker ¶
type Breaker struct { Name string `json:"name" yaml:"name"` MaxRequests uint32 `json:"max" yaml:"max"` Interval time.Duration `json:"interval" yaml:"interval"` Timeout time.Duration `json:"timeout" yaml:"timeout"` CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
func (*Breaker) Standardize ¶
type RateLimit ¶
type RateLimit struct { Delta int `json:"delta" yaml:"delta"` Duration time.Duration `json:"duration" yaml:"duration"` CustomBindFlagsFunc func(fs *bootflag.FlagSet) `json:"-" yaml:"-"` // CustomParseFunc defines custom parse behaviour for structure, if CustomParseFunc is nil, default parse behaviour will be used CustomParseFunc func() (err error) `json:"-" yaml:"-"` }
Click to show internal directories.
Click to hide internal directories.