github.com/Jeffail/benthos/v3@v3.65.0/internal/bundle/package.go (about) 1 // Package bundle contains singletons referenced throughout the Benthos codebase 2 // that allow imported components to add their constructors and documentation to 3 // a service. 4 // 5 // Each component type has it's own singleton bundle containing all imported 6 // implementations of the component, and from this bundle more can be derived 7 // that modify the components that are available. 8 package bundle 9 10 import ( 11 "context" 12 13 "github.com/Jeffail/benthos/v3/internal/bloblang" 14 "github.com/Jeffail/benthos/v3/lib/buffer" 15 "github.com/Jeffail/benthos/v3/lib/cache" 16 "github.com/Jeffail/benthos/v3/lib/input" 17 "github.com/Jeffail/benthos/v3/lib/log" 18 "github.com/Jeffail/benthos/v3/lib/metrics" 19 "github.com/Jeffail/benthos/v3/lib/output" 20 "github.com/Jeffail/benthos/v3/lib/processor" 21 "github.com/Jeffail/benthos/v3/lib/ratelimit" 22 "github.com/Jeffail/benthos/v3/lib/types" 23 ) 24 25 // NewManagement defines the latest API for a Benthos manager, which will become 26 // the only API (internally) in Benthos V4. 27 type NewManagement interface { 28 types.Manager 29 30 ForStream(id string) types.Manager 31 ForComponent(id string) types.Manager 32 ForChildComponent(id string) types.Manager 33 Label() string 34 35 Metrics() metrics.Type 36 Logger() log.Modular 37 Environment() *Environment 38 BloblEnvironment() *bloblang.Environment 39 40 NewBuffer(conf buffer.Config) (buffer.Type, error) 41 NewCache(conf cache.Config) (types.Cache, error) 42 NewInput(conf input.Config, hasBatchProc bool, pipelines ...types.PipelineConstructorFunc) (types.Input, error) 43 NewProcessor(conf processor.Config) (types.Processor, error) 44 NewOutput(conf output.Config, pipelines ...types.PipelineConstructorFunc) (types.Output, error) 45 NewRateLimit(conf ratelimit.Config) (types.RateLimit, error) 46 47 AccessCache(ctx context.Context, name string, fn func(types.Cache)) error 48 StoreCache(ctx context.Context, name string, conf cache.Config) error 49 50 AccessInput(ctx context.Context, name string, fn func(types.Input)) error 51 StoreInput(ctx context.Context, name string, conf input.Config) error 52 53 AccessProcessor(ctx context.Context, name string, fn func(types.Processor)) error 54 StoreProcessor(ctx context.Context, name string, conf processor.Config) error 55 56 AccessOutput(ctx context.Context, name string, fn func(types.OutputWriter)) error 57 StoreOutput(ctx context.Context, name string, conf output.Config) error 58 59 AccessRateLimit(ctx context.Context, name string, fn func(types.RateLimit)) error 60 StoreRateLimit(ctx context.Context, name string, conf ratelimit.Config) error 61 }