Documentation ¶
Index ¶
- func RegisterProvider(providerType ProviderType, loader ProviderLoader)
- type ErrFunctionAccessDenied
- type ErrFunctionAlreadyRegistered
- type ErrFunctionCallFailed
- type ErrFunctionError
- type ErrFunctionHasSubscriptions
- type ErrFunctionIsAuthorizer
- type ErrFunctionNotFound
- type ErrFunctionProviderError
- type ErrFunctionValidation
- type Function
- type Functions
- type ID
- type Provider
- type ProviderLoader
- type ProviderType
- type Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterProvider ¶
func RegisterProvider(providerType ProviderType, loader ProviderLoader)
RegisterProvider registers provider loader by provider type.
Types ¶
type ErrFunctionAccessDenied ¶
type ErrFunctionAccessDenied struct {
Original error
}
ErrFunctionAccessDenied occurs when Event Gateway don't have access to call a function.
func (ErrFunctionAccessDenied) Error ¶
func (e ErrFunctionAccessDenied) Error() string
type ErrFunctionAlreadyRegistered ¶
type ErrFunctionAlreadyRegistered struct {
ID ID
}
ErrFunctionAlreadyRegistered occurs when function with specified name is already registered.
func (ErrFunctionAlreadyRegistered) Error ¶
func (e ErrFunctionAlreadyRegistered) Error() string
type ErrFunctionCallFailed ¶
type ErrFunctionCallFailed struct {
Original error
}
ErrFunctionCallFailed occurs when function call failed.
func (ErrFunctionCallFailed) Error ¶
func (e ErrFunctionCallFailed) Error() string
type ErrFunctionError ¶
type ErrFunctionError struct {
Original error
}
ErrFunctionError occurs when function call failed because of function error.
func (ErrFunctionError) Error ¶
func (e ErrFunctionError) Error() string
type ErrFunctionHasSubscriptions ¶
type ErrFunctionHasSubscriptions struct{}
ErrFunctionHasSubscriptions occurs when function with subscription is being deleted.
func (ErrFunctionHasSubscriptions) Error ¶
func (e ErrFunctionHasSubscriptions) Error() string
type ErrFunctionIsAuthorizer ¶
ErrFunctionIsAuthorizer occurs when function cannot be deleted because is used as authorizer.
func (ErrFunctionIsAuthorizer) Error ¶
func (e ErrFunctionIsAuthorizer) Error() string
type ErrFunctionNotFound ¶
type ErrFunctionNotFound struct {
ID ID
}
ErrFunctionNotFound occurs when function couldn't been found in the discovery.
func (ErrFunctionNotFound) Error ¶
func (e ErrFunctionNotFound) Error() string
type ErrFunctionProviderError ¶
type ErrFunctionProviderError struct {
Original error
}
ErrFunctionProviderError occurs when function call failed because of provider error.
func (ErrFunctionProviderError) Error ¶
func (e ErrFunctionProviderError) Error() string
type ErrFunctionValidation ¶
type ErrFunctionValidation struct {
Message string
}
ErrFunctionValidation occurs when function payload doesn't validate.
func (ErrFunctionValidation) Error ¶
func (e ErrFunctionValidation) Error() string
type Function ¶
type Function struct { Space string `json:"space" validate:"required,min=3,space"` ID ID `json:"functionId" validate:"required,functionid"` ProviderType ProviderType `json:"type"` ProviderConfig *json.RawMessage `json:"provider"` Provider Provider `json:"-" validate:"-"` Metadata metadata.Metadata `json:"metadata,omitempty"` }
Function represents a function deployed on one of the supported providers.
func (*Function) MarshalJSON ¶
MarshalJSON marshals provides as config and returns JSON representation of the function.
func (Function) MarshalLogObject ¶
func (f Function) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject is a part of zapcore.ObjectMarshaler interface
func (*Function) UnmarshalJSON ¶
UnmarshalJSON unmarshals function JSON, detects provider type and loads the provider.
type Provider ¶
type Provider interface { Call(payload []byte) ([]byte, error) MarshalLogObject(enc zapcore.ObjectEncoder) error }
Provider is an interface that function provider has to implement.
type ProviderLoader ¶
ProviderLoader returns Provider instance based on JSON config blob.
type Service ¶
type Service interface { GetFunction(space string, id ID) (*Function, error) ListFunctions(space string, filters ...metadata.Filter) (Functions, error) CreateFunction(fn *Function) (*Function, error) UpdateFunction(fn *Function) (*Function, error) DeleteFunction(space string, id ID) error }
Service represents service for managing functions.