Documentation ¶
Index ¶
Constants ¶
View Source
const ( // TypeSync causes that function invocation result will be returned to the caller. TypeSync = Type("sync") // TypeAsync causes asynchronous event processing. TypeAsync = Type("async") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ErrInvalidSubscriptionUpdate ¶
type ErrInvalidSubscriptionUpdate struct {
Field string
}
ErrInvalidSubscriptionUpdate occurs when a client tries to update a subscription in a way that changes the subscription ID.
func (ErrInvalidSubscriptionUpdate) Error ¶
func (e ErrInvalidSubscriptionUpdate) Error() string
type ErrPathConfict ¶
type ErrPathConfict struct {
Message string
}
ErrPathConfict occurs when HTTP subscription path conflicts with existing path.
func (ErrPathConfict) Error ¶
func (e ErrPathConfict) Error() string
type ErrSubscriptionAlreadyExists ¶
type ErrSubscriptionAlreadyExists struct {
ID ID
}
ErrSubscriptionAlreadyExists occurs when subscription with the same ID already exists.
func (ErrSubscriptionAlreadyExists) Error ¶
func (e ErrSubscriptionAlreadyExists) Error() string
type ErrSubscriptionNotFound ¶
type ErrSubscriptionNotFound struct {
ID ID
}
ErrSubscriptionNotFound occurs when subscription cannot be found.
func (ErrSubscriptionNotFound) Error ¶
func (e ErrSubscriptionNotFound) Error() string
type ErrSubscriptionValidation ¶
type ErrSubscriptionValidation struct {
Message string
}
ErrSubscriptionValidation occurs when subscription payload doesn't validate.
func (ErrSubscriptionValidation) Error ¶
func (e ErrSubscriptionValidation) Error() string
type Service ¶
type Service interface { GetSubscription(space string, id ID) (*Subscription, error) ListSubscriptions(space string, filters ...metadata.Filter) (Subscriptions, error) CreateSubscription(s *Subscription) (*Subscription, error) UpdateSubscription(id ID, s *Subscription) (*Subscription, error) DeleteSubscription(space string, id ID) error }
Service represents service for managing subscriptions.
type Subscription ¶
type Subscription struct { Space string `json:"space" validate:"required,min=3,space"` ID ID `json:"subscriptionId"` Type Type `json:"type" validate:"required,eq=async|eq=sync"` EventType event.TypeName `json:"eventType" validate:"required,eventType"` FunctionID function.ID `json:"functionId" validate:"required"` Path string `json:"path" validate:"required,urlPath"` Method string `json:"method" validate:"required,eq=GET|eq=POST|eq=DELETE|eq=PUT|eq=PATCH|eq=HEAD|eq=OPTIONS"` Metadata metadata.Metadata `json:"metadata,omitempty"` }
Subscription maps event type to a function.
func (Subscription) MarshalLogObject ¶
func (s Subscription) MarshalLogObject(enc zapcore.ObjectEncoder) error
MarshalLogObject is a part of zapcore.ObjectMarshaler interface
Click to show internal directories.
Click to hide internal directories.