Documentation ¶
Index ¶
- type CloudWatchHandler
- type CompositeEventHandler
- type DictionaryEventHandler
- type DynamoHandler
- type Event
- type EventArgs
- type EventDecoder
- type EventEncoder
- type EventHandler
- type GatewayHandler
- type GatewayHandlerAuth
- type GatewayHandlerAuthConfig
- type GatewayHandlerAuthUserConfig
- type GatewayInterceptor
- type GatewayRoute
- type KinesisClient
- type KinesisCollector
- type KinesisCollectorConfig
- type KinesisCollectorOption
- type KinesisCollectorStore
- type KinesisDispatcher
- type KinesisDispatcherConfig
- type KinesisHandler
- type KinesisRecord
- type KinesisScanFunc
- type KinesisScanner
- type Metadata
- type SQSClient
- type SQSDispatcher
- type SQSHandler
- type XrayEventHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CloudWatchHandler ¶
type CloudWatchHandler struct {
EventHandler EventHandler
}
CloudWatchHandler handles cloud watch cron jobs
func (*CloudWatchHandler) HandleContext ¶
func (h *CloudWatchHandler) HandleContext(ctx context.Context, input events.CloudWatchEvent) error
HandleContext dispatches the command to the executor
type CompositeEventHandler ¶
type CompositeEventHandler []EventHandler
CompositeEventHandler composes the event handler
func (CompositeEventHandler) HandleContext ¶
func (h CompositeEventHandler) HandleContext(ctx context.Context, args *EventArgs) error
HandleContext handles event
type DictionaryEventHandler ¶
type DictionaryEventHandler map[string]EventHandler
DictionaryEventHandler represents a dictionary of event handler
func (DictionaryEventHandler) HandleContext ¶
func (h DictionaryEventHandler) HandleContext(ctx context.Context, args *EventArgs) error
HandleContext handles event
type DynamoHandler ¶
type DynamoHandler struct { EventEncoder EventEncoder EventHandler EventHandler }
DynamoHandler creates commands and dispatch them
func (*DynamoHandler) HandleContext ¶
func (r *DynamoHandler) HandleContext(ctx context.Context, input events.DynamoDBEvent) error
HandleContext dispatches the command to the executor
type Event ¶
type Event struct { ID string `json:"id" validate:"required"` Name string `json:"name" validate:"required"` Source string `json:"source" validate:"required"` Sender string `json:"sender" validate:"required"` Timestamp time.Time `json:"timestamp" validate:"required"` }
Event represents a event's information
type EventArgs ¶
type EventArgs struct { Event *Event `json:"event" validate:"required"` Meta Metadata `json:"meta" validate:"-"` Body json.RawMessage `json:"body" validate:"required"` }
EventArgs is the actual event
type EventDecoder ¶
EventDecoder represents an event decoder
type EventEncoder ¶
EventEncoder represents an event decoder
type EventHandler ¶
type EventHandler interface { // HandleContext handles event HandleContext(ctx context.Context, args *EventArgs) error }
EventHandler represents the event's handler
type GatewayHandler ¶
type GatewayHandler struct {
// contains filtered or unexported fields
}
GatewayHandler represents a webhook
func (*GatewayHandler) HandleContext ¶
func (h *GatewayHandler) HandleContext(ctx context.Context, r events.APIGatewayProxyRequest) (events.APIGatewayProxyResponse, error)
HandleContext handles the API Gateway Proxy Request
func (*GatewayHandler) Mount ¶
func (h *GatewayHandler) Mount(route GatewayRoute)
Group returns the router.
func (*GatewayHandler) Use ¶
func (h *GatewayHandler) Use(m GatewayInterceptor)
Use use a given interceptor.
type GatewayHandlerAuth ¶
type GatewayHandlerAuth struct { // Credentials keeps a map of the registered credentials Config *GatewayHandlerAuthConfig }
GatewayHandlerAuth represents a authentication handler
func (*GatewayHandlerAuth) HandleContext ¶
func (p *GatewayHandlerAuth) HandleContext(ctx context.Context, r events.APIGatewayCustomAuthorizerRequest) (events.APIGatewayCustomAuthorizerResponse, error)
HandleContext handles the authorization request
type GatewayHandlerAuthConfig ¶
type GatewayHandlerAuthConfig struct {
Users []*GatewayHandlerAuthUserConfig
}
AuthConfig represents an auth configuration.
type GatewayHandlerAuthUserConfig ¶
GatewayHandlerAuthUserConfig represents an user configuration.
type GatewayInterceptor ¶
GatewayInterceptor represents a gateway interceptor
type GatewayRoute ¶
type GatewayRoute interface {
Mount(r chi.Router)
}
GatewayRoute represents a gateway route
type KinesisClient ¶
type KinesisClient = kinesisiface.KinesisAPI
KinesisClient creates a new client
type KinesisCollector ¶
type KinesisCollector struct { Scanner KinesisScanner EventHandler EventHandler EventDecoder EventDecoder Cancel context.CancelFunc }
KinesisCollector handles kinesis stream
func NewKinesisCollector ¶
func NewKinesisCollector(config *KinesisCollectorConfig) *KinesisCollector
NewKinesisCollector creates a new collector to kinesis
func (*KinesisCollector) CollectContext ¶
func (h *KinesisCollector) CollectContext(ctx context.Context) error
CollectContext handles the kinesis stream
func (*KinesisCollector) CollectContextAsync ¶
func (h *KinesisCollector) CollectContextAsync(ctx context.Context) error
CollectContextAsync handles the kinesis stream asyncronosly
type KinesisCollectorConfig ¶
type KinesisCollectorConfig struct { RoleArn string Region string StreamName string Options []KinesisCollectorOption EventHandler EventHandler }
KinesisCollectorConfig represents the kinesis collector config
type KinesisCollectorOption ¶
KinesisCollectorOption represents a collector options
func KinesisCollectorWithStore ¶
func KinesisCollectorWithStore(store KinesisCollectorStore) KinesisCollectorOption
KinesisCollectorWithStore creates a store option
type KinesisCollectorStore ¶
KinesisCollectorStore represents a kinesis collector store
func NewKinesisCollectorPSQLStore ¶
func NewKinesisCollectorPSQLStore(name, table string, url string) (KinesisCollectorStore, error)
NewKinesisCollectorPSQLStore creates a new PostgreSQL store
type KinesisDispatcher ¶
type KinesisDispatcher struct { StreamName string Client KinesisClient }
KinesisDispatcher dispatches event to kinesis bus
func NewKinesisDispatcher ¶
func NewKinesisDispatcher(config *KinesisDispatcherConfig) *KinesisDispatcher
NewKinesisDispatcher creates a new dispatcher to kinesis
func (*KinesisDispatcher) HandleContext ¶
func (d *KinesisDispatcher) HandleContext(ctx context.Context, args *EventArgs) error
HandleContext handles event
type KinesisDispatcherConfig ¶
KinesisDispatcherConfig represents the kinesis dispatcher config
type KinesisHandler ¶
type KinesisHandler struct { EventHandler EventHandler EventDecoder EventDecoder }
KinesisHandler reacts on events
func (*KinesisHandler) HandleContext ¶
func (h *KinesisHandler) HandleContext(ctx context.Context, input events.KinesisEvent) error
HandleContext dispatches the event to the handler
func (*KinesisHandler) ServeHTTP ¶
func (h *KinesisHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
ServerHTTP serves a http request
type KinesisScanFunc ¶
KinesisScanFunc is a function executed on kinesis input stream
type KinesisScanner ¶
type KinesisScanner interface {
Scan(ctx context.Context, fn KinesisScanFunc) error
}
KinesisScanner scans kinesis stream
type SQSDispatcher ¶
type SQSDispatcher struct { // QueueURL address QueueURL string // Clinet for the SQS Client SQSClient }
SQSDispatcher dispatches a command via SQS
func (*SQSDispatcher) HandleContext ¶
func (r *SQSDispatcher) HandleContext(ctx context.Context, args *EventArgs) error
HandleContext dispatches an event to SQS
type SQSHandler ¶
type SQSHandler struct {
EventHandler EventHandler
}
SQSHandler dispatches the commands
func (*SQSHandler) HandleContext ¶
HandleContext dispatches the command to the underlying executors
type XrayEventHandler ¶
type XrayEventHandler struct { Segment string Metadata map[string]interface{} EventHandler EventHandler }
XrayEventHandler is a handler that add XRay segment
func (*XrayEventHandler) HandleContext ¶
func (h *XrayEventHandler) HandleContext(ctx context.Context, args *EventArgs) error
HandleContext handles the event