Versions in this module Expand all Collapse all v0 v0.7.0 Apr 28, 2021 v0.6.1 Dec 2, 2019 v0.6.0 Oct 26, 2019 Changes in this version + type HandlerFunc = types.HandlerFunc v0.5.0 Sep 22, 2019 Changes in this version + var WithJSONCodec = types.WithJSONCodec + func WithAction(n string) types.HandleOption + func WithAwaitTimeout(d time.Duration) types.GroupOption + func WithCallback(h types.Handle) types.HandleOption + func WithMessageSchema(f func() interface{}) types.HandleOption + func WithMessageType(t types.MessageType) types.HandleOption type Group + Codec types.Codec + func (group *Group) HandleContext(definitions ...types.HandleOption) (Close, error) v0.4.0 Aug 22, 2019 v0.3.1 Aug 21, 2019 v0.3.0 Aug 16, 2019 Changes in this version + var NewMessage = types.NewMessage type Group + func (group *Group) AwaitMessage(messages <-chan *types.Message, parent types.ParentID) (message *Message, err error) type Handler + Handle func(*Message, Writer) + type Writer interface + Command func(action string, version int8, key []byte, data []byte) (*Message, error) + CommandEOS func(action string, version int8, key []byte, data []byte) (*Message, error) + CommandStream func(action string, version int8, key []byte, data []byte) (*Message, error) + Error func(action string, status types.StatusCode, err error) (*Message, error) + ErrorEOS func(action string, status types.StatusCode, err error) (*Message, error) + ErrorStream func(action string, status types.StatusCode, err error) (*Message, error) + Event func(action string, version int8, key []byte, data []byte) (*Message, error) + EventEOS func(action string, version int8, key []byte, data []byte) (*Message, error) + EventStream func(action string, version int8, key []byte, data []byte) (*Message, error) + func NewWriter(group *Group, parent *Message) Writer v0.2.1 Jul 30, 2019 v0.2.0 Jul 29, 2019 Changes in this version + const AfterActionConsumption + const AfterMessageConsumed + const AfterPublish + const BeforeActionConsumption + const BeforeMessageConsumption + const BeforePublish + const DebugEnv type Command + func NewCommandFromMessage(message *types.Message) Command + type Dialect = types.Dialect type Event + ParentTimestamp types.ParentTimestamp + func NewEventFromMessage(message *Message) Event + type EventType string v0.1.0 Jul 11, 2019 Changes in this version + const ActionHeader + const AfterEvent + const BeforeEvent + const CommandMessage + const CommandTimestampHeader + const ConsumeMode + const DefaultAttempts + const DefaultMode + const DefaultTimeout + const EOSHeader + const EventMessage + const IDHeader + const MetaHeader + const ParentHeader + const ProduceMode + const StatusHeader + const VersionHeader + var ErrDefaultRetry = errors.New("message marked to be retried") + var ErrNoAction = errors.New("no action defined") + var ErrNoTopic = errors.New("no topic found") + var ErrTimeout = errors.New("timeout reached") + var Logger = log.New(ioutil.Discard, LoggingPrefix, LoggingFlags) + var LoggingFlags = log.Ldate | log.Ltime | log.Llongfile + var LoggingPrefix = "[Commander] " + var NewTopic = types.NewTopic + type Breaker struct + func (b *Breaker) Close() + func (b *Breaker) Open() + func (b *Breaker) Safe() bool + type Client struct + Groups []*Group + Middleware *middleware.Client + func NewClient(groups ...*Group) (*Client, error) + func (client *Client) Close() error + type Close func() + type Command struct + Action string + Ctx context.Context + Data []byte + EOS bool + Headers map[string]string + ID uuid.UUID + Key []byte + Offset int + Origin Topic + Partition int + Timestamp time.Time + Version int8 + func NewCommand(action string, version int8, key []byte, data []byte) Command + func (command *Command) Message(topic Topic) *Message + func (command *Command) NewCommand(action string, version int8, data []byte) Command + func (command *Command) NewError(action string, status StatusCode, err error) Event + func (command *Command) NewEvent(action string, version int8, data []byte) Event + func (command *Command) Populate(message *Message) error + type Event struct + Action string + CommandTimestamp time.Time + Ctx context.Context + Data []byte + EOS bool + Headers map[string]string + ID uuid.UUID + Key []byte + Meta string + Offset int + Origin Topic + Parent uuid.UUID + Partition int + Status StatusCode + Timestamp time.Time + Version int8 + func NewEvent(action string, version int8, parent uuid.UUID, key []byte, data []byte) Event + func (event *Event) Message(topic Topic) *Message + func (event *Event) Populate(message *Message) error + type Group struct + Middleware *middleware.Client + Retries int + Timeout time.Duration + Topics map[types.TopicMode][]types.Topic + func NewGroup(t ...Topic) *Group + func (group *Group) AsyncCommand(command Command) error + func (group *Group) AwaitEOS(timeout time.Duration, parent uuid.UUID, t types.MessageType) (event Event, _ Next, err error) + func (group *Group) AwaitEvent(timeout time.Duration, parent uuid.UUID, t types.MessageType) (event Event, _ Next, err error) + func (group *Group) AwaitEventWithAction(timeout time.Duration, parent uuid.UUID, t types.MessageType, action string) (event Event, _ Next, err error) + func (group *Group) FetchTopics(t types.MessageType, m types.TopicMode) []types.Topic + func (group *Group) Handle(sort types.MessageType, action string, handler Handler) (Close, error) + func (group *Group) HandleFunc(sort types.MessageType, action string, callback Handle) (Close, error) + func (group *Group) NewConsumer(sort types.MessageType) (<-chan *types.Message, Next, Close, error) + func (group *Group) NewConsumerWithDeadline(timeout time.Duration, t types.MessageType) (<-chan *types.Message, Next, Close, error) + func (group *Group) ProduceCommand(command Command) error + func (group *Group) ProduceEvent(event Event) error + func (group *Group) Publish(message *Message) error + func (group *Group) SyncCommand(command Command) (event Event, next Next, err error) + type Handle func(ResponseWriter, interface{}) + type Handler interface + Process func(writer ResponseWriter, message interface{}) + type Message = types.Message + type Next func(error) + type ResponseWriter interface + ProduceCommand func(action string, version int8, key []byte, data []byte) (Command, error) + ProduceCommandEOS func(action string, version int8, key []byte, data []byte) (Command, error) + ProduceError func(action string, status StatusCode, err error) (Event, error) + ProduceErrorEOS func(action string, status StatusCode, err error) (Event, error) + ProduceEvent func(action string, version int8, key []byte, data []byte) (Event, error) + ProduceEventEOS func(action string, version int8, key []byte, data []byte) (Event, error) + Retry func(err error) + ShouldRetry func() error + func NewResponseWriter(group *Group, value interface{}) ResponseWriter + type Retry struct + Amount int + Retries int + func (retry *Retry) Attempt(method func() error) error + type StatusCode int16 + const StatusBadRequest + const StatusConflict + const StatusForbidden + const StatusImATeapot + const StatusInternalServerError + const StatusNotFound + const StatusOK + const StatusUnauthorized + type Topic = types.Topic