Documentation ¶
Index ¶
- Variables
- type Builder
- type BuilderRegistry
- type Config
- type Instance
- type Interface
- type Parent
- type ParentType
- type ProvisionType
- type Service
- func (s *Service) Check(ctx context.Context) error
- func (s *Service) Create(ctx context.Context, id string, procType string, parent Parent, cfg Config, ...) (*Instance, error)
- func (s *Service) Delete(ctx context.Context, id string) error
- func (s *Service) Get(ctx context.Context, id string) (*Instance, error)
- func (s *Service) Init(ctx context.Context) error
- func (s *Service) List(_ context.Context) map[string]*Instance
- func (s *Service) Update(ctx context.Context, id string, cfg Config) (*Instance, error)
- type Store
Constants ¶
This section is empty.
Variables ¶
var ( // ErrSkipRecord is passed by a processor when it should Ack and skip a Record. // It must be separate from a plain error so that we continue instead of marking // the Pipeline status as degraded. ErrSkipRecord = cerrors.New("record skipped") ErrInstanceNotFound = cerrors.New("processor instance not found") )
var GlobalBuilderRegistry = NewBuilderRegistry()
GlobalBuilderRegistry is a global registry of processor builders. It should be treated as a read only variable.
Functions ¶
This section is empty.
Types ¶
type BuilderRegistry ¶
type BuilderRegistry struct {
// contains filtered or unexported fields
}
BuilderRegistry is a registry for registering or looking up processor builders. The Register and Get methods are safe for concurrent use.
func NewBuilderRegistry ¶
func NewBuilderRegistry() *BuilderRegistry
NewBuilderRegistry returns an empty *BuilderRegistry.
func (*BuilderRegistry) Get ¶
func (r *BuilderRegistry) Get(procType string) (Builder, error)
Get returns the processor builder registered under the specified type. If no builder is registered under that type it returns an error.
func (*BuilderRegistry) MustGet ¶
func (r *BuilderRegistry) MustGet(procType string) Builder
MustGet tries to get a builder and panics on error.
func (*BuilderRegistry) MustRegister ¶
func (r *BuilderRegistry) MustRegister(procType string, b Builder)
MustRegister tries to register a builder and panics on error.
type Instance ¶
type Instance struct { ID string CreatedAt time.Time UpdatedAt time.Time ProvisionedBy ProvisionType Type string Parent Parent Config Config Processor Interface }
Instance represents a processor instance.
type Interface ¶ added in v0.3.0
type Interface interface { // Process runs the processor function on a record. Process(ctx context.Context, record record.Record) (record.Record, error) InspectIn(ctx context.Context) *inspector.Session InspectOut(ctx context.Context) *inspector.Session }
Interface is the interface that represents a single message processor that can be executed on one record and manipulate it.
type Parent ¶
type Parent struct { // ID of the parent. ID string // Type of the parent. Type ParentType }
Parent represents the connection to the entity a processor is connected to.
type ParentType ¶
type ParentType int
ParentType defines the parent type of processor.
const ( ParentTypeConnector ParentType = iota + 1 ParentTypePipeline )
func (ParentType) String ¶
func (i ParentType) String() string
type ProvisionType ¶ added in v0.3.0
type ProvisionType int
ProvisionType defines provisioning type
const ( ProvisionTypeAPI ProvisionType = iota ProvisionTypeConfig )
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
NewService creates a new processor service.
func (*Service) Create ¶
func (s *Service) Create( ctx context.Context, id string, procType string, parent Parent, cfg Config, pt ProvisionType, ) (*Instance, error)
Create will create a new processor instance.
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store handles the persistence and fetching of processor instances.
func (*Store) Delete ¶
Delete deletes instance under the key id and returns nil on success, error otherwise.
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |