Documentation ¶
Overview ¶
Package manager implements the types.Manager interface used for creating and sharing resources across a Benthos service.
Index ¶
- func AddExamples(c *Config)
- func SanitiseConfig(conf Config) (interface{}, error)
- type APIReg
- type Config
- type Type
- func (t *Type) GetCache(name string) (types.Cache, error)
- func (t *Type) GetCondition(name string) (types.Condition, error)
- func (t *Type) GetPipe(name string) (<-chan types.Transaction, error)
- func (t *Type) GetRateLimit(name string) (types.RateLimit, error)
- func (t *Type) RegisterEndpoint(path, desc string, h http.HandlerFunc)
- func (t *Type) SetPipe(name string, tran <-chan types.Transaction)
- func (t *Type) UnsetPipe(name string, tran <-chan types.Transaction)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddExamples ¶ added in v0.16.2
func AddExamples(c *Config)
AddExamples inserts example caches and conditions if none exist in the config.
func SanitiseConfig ¶ added in v0.16.2
SanitiseConfig creates a sanitised version of a manager config.
Types ¶
type APIReg ¶
type APIReg interface {
RegisterEndpoint(path, desc string, h http.HandlerFunc)
}
APIReg is an interface representing an API builder.
type Config ¶
type Config struct { Caches map[string]cache.Config `json:"caches" yaml:"caches"` Conditions map[string]condition.Config `json:"conditions" yaml:"conditions"` RateLimits map[string]ratelimit.Config `json:"rate_limit" yaml:"rate_limit"` }
Config contains all configuration fields for a Benthos service manager.
type Type ¶
type Type struct {
// contains filtered or unexported fields
}
Type is an implementation of types.Manager, which is expected by Benthos components that need to register service wide behaviours such as HTTP endpoints and event listeners, and obtain service wide shared resources such as caches and labelled conditions.
func New ¶
New returns an instance of manager.Type, which can be shared amongst components and logical threads of a Benthos service.
func (*Type) GetCondition ¶
GetCondition attempts to find a service wide condition by its name.
func (*Type) GetPipe ¶ added in v0.15.4
func (t *Type) GetPipe(name string) (<-chan types.Transaction, error)
GetPipe attempts to obtain and return a named output Pipe
func (*Type) GetRateLimit ¶ added in v0.31.3
GetRateLimit attempts to find a service wide rate limit by its name.
func (*Type) RegisterEndpoint ¶
func (t *Type) RegisterEndpoint(path, desc string, h http.HandlerFunc)
RegisterEndpoint registers a server wide HTTP endpoint.