 Documentation
      ¶
      Documentation
      ¶
    
    
  
    
  
    Index ¶
- type EmptyOperationId
- type EntityCreationError
- type EntityCreationKeyLookupError
- type Matcher
- func (m *Matcher) CreateEntityInstance(ctx context.Context, key string, lastOperationId string) (entity.Entity, error)
- func (m *Matcher) CreateHookedInstance(ctx context.Context, key string, hookList []hooks.BaseOperationHooksInterface) (*hooks.HookedApiOperation, error)
- func (m *Matcher) CreateOperationInstance(ctx context.Context, key string) (operation.ApiOperation, error)
- func (m *Matcher) Get(ctx context.Context, key string) (reflect.Type, bool)
- func (m *Matcher) Register(ctx context.Context, key string, value operation.ApiOperation)
- func (m *Matcher) RegisterEntity(ctx context.Context, key string, value entity.EntityFactoryFunc)
 
- type OperationKeyLookupError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EmptyOperationId ¶
type EmptyOperationId struct{}
    func (*EmptyOperationId) Error ¶
func (e *EmptyOperationId) Error() string
type EntityCreationError ¶
type EntityCreationError struct{}
    func (*EntityCreationError) Error ¶
func (e *EntityCreationError) Error() string
type EntityCreationKeyLookupError ¶
func (*EntityCreationKeyLookupError) Error ¶
func (e *EntityCreationKeyLookupError) Error() string
type Matcher ¶
type Matcher struct {
	Types          map[string]reflect.Type
	EntityCreators map[string]entity.EntityFactoryFunc
}
    The matcher is utilized in order to keep track of the name and type of each operation. This is required because we only send the OperationRequest through the service bus, but we utilize the name in that struct to create an instance of the right operation type (e.g. LongRunning) and Run with the correct logic. The matcher can also be used to create the Entity based on the name of the operation by using a stored EntityFactoryFunc.
func NewMatcher ¶
func NewMatcher() *Matcher
func (*Matcher) CreateEntityInstance ¶
func (m *Matcher) CreateEntityInstance(ctx context.Context, key string, lastOperationId string) (entity.Entity, error)
This will create an Entity using the EntityFactoryFunc with the lastOperationId by matching with the key passed in.
func (*Matcher) CreateHookedInstance ¶
func (m *Matcher) CreateHookedInstance(ctx context.Context, key string, hookList []hooks.BaseOperationHooksInterface) (*hooks.HookedApiOperation, error)
Creates an instance of the operation with hooks enabled.
func (*Matcher) CreateOperationInstance ¶
func (m *Matcher) CreateOperationInstance(ctx context.Context, key string) (operation.ApiOperation, error)
This will create an empty instance of the type, with which you can then call op.Init() and initialize any info you need.
func (*Matcher) Register ¶
Set adds a key-value pair to the map Ex: matcher.Register("LongRunning", &LongRunning{})
func (*Matcher) RegisterEntity ¶
Set adds a key-value pair to the map Ex: matcher.RegisterEntity("LongRunning", longRunningOperation.CreateLroEntityFunc)
type OperationKeyLookupError ¶
type OperationKeyLookupError struct {
	Key string
}
    func (*OperationKeyLookupError) Error ¶
func (e *OperationKeyLookupError) Error() string