github.com/Jeffail/benthos/v3@v3.65.0/lib/types/mock.go (about) 1 package types 2 3 import ( 4 "net/http" 5 ) 6 7 // DudMgr is a noop implementation of a types.Manager. 8 type DudMgr struct { 9 ID int 10 } 11 12 // RegisterEndpoint is a noop. 13 func (f DudMgr) RegisterEndpoint(path, desc string, h http.HandlerFunc) { 14 } 15 16 // GetCache always returns ErrCacheNotFound. 17 func (f DudMgr) GetCache(name string) (Cache, error) { 18 return nil, ErrCacheNotFound 19 } 20 21 // GetCondition always returns ErrConditionNotFound. 22 func (f DudMgr) GetCondition(name string) (Condition, error) { 23 return nil, ErrConditionNotFound 24 } 25 26 // GetRateLimit always returns ErrRateLimitNotFound. 27 func (f DudMgr) GetRateLimit(name string) (RateLimit, error) { 28 return nil, ErrRateLimitNotFound 29 } 30 31 // GetPlugin always returns ErrPluginNotFound. 32 func (f DudMgr) GetPlugin(name string) (interface{}, error) { 33 return nil, ErrPluginNotFound 34 } 35 36 // GetPipe attempts to find a service wide message producer by its name. 37 func (f DudMgr) GetPipe(name string) (<-chan Transaction, error) { 38 return nil, ErrPipeNotFound 39 } 40 41 // SetPipe registers a message producer under a name. 42 func (f DudMgr) SetPipe(name string, t <-chan Transaction) {} 43 44 // UnsetPipe removes a named pipe. 45 func (f DudMgr) UnsetPipe(name string, t <-chan Transaction) {} 46 47 // NoopMgr returns a Manager implementation that does nothing. 48 func NoopMgr() Manager { 49 return DudMgr{} 50 }