Documentation ¶
Overview ¶
Code generated by mockery v1.0.0. DO NOT EDIT.
Index ¶
- type Context
- type ContextAware
- type FBContext
- type Message
- type MessageFunc
- type MockFBContext
- func (_m *MockFBContext) AckMessage(msg Message) error
- func (_m *MockFBContext) ConfigureLeader(leader func() bool)
- func (_m *MockFBContext) ConfigureMessaging(send MessageFunc, ack MessageFunc)
- func (_m *MockFBContext) InstanceID() string
- func (_m *MockFBContext) IsLeader() bool
- func (_m *MockFBContext) SendMessage(msg Message) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
Context is the default implementation of a firebolt context.
func (*Context) AckMessage ¶
AckMessage acknowledges receipt of a Message; it will not be redelivered.
func (*Context) ConfigureLeader ¶
ConfigureLeader adds handler for returning leader election results.
func (*Context) ConfigureMessaging ¶
func (c *Context) ConfigureMessaging(send MessageFunc, ack MessageFunc)
ConfigureMessaging adds send and ack handlers for delivering and acknowledging messages.
func (*Context) InstanceID ¶
InstanceID returns the unique ID of this application instance.
func (*Context) IsLeader ¶
IsLeader indicates whether this instance is currently the cluster leader as determined by a leader election. If zookeeper was not configured, this will always return false.
func (*Context) SendMessage ¶
SendMessage sends a Message using the configured internaldata transport.
type ContextAware ¶
ContextAware is intended to be embedded in Node types to provide the node's application code with access to execution context.
func (*ContextAware) AcceptsMessage ¶
func (c *ContextAware) AcceptsMessage(messageType string) bool
AcceptsMessage is used when delivering messages to determine if a Source/Node requests delivery of messages with a given messageType.
func (*ContextAware) Init ¶
func (c *ContextAware) Init(id string, ctx FBContext)
Init provides a new Source/Node with its execution context.
func (*ContextAware) Subscribe ¶
func (c *ContextAware) Subscribe(messageTypes []string)
Subscribe sets the message types that this node will accept.
type FBContext ¶
type FBContext interface { ConfigureMessaging(send MessageFunc, ack MessageFunc) ConfigureLeader(leader func() bool) SendMessage(msg Message) error AckMessage(msg Message) error IsLeader() bool InstanceID() string }
FBContext is a firebolt context. It provides a source/node with access to inter-node or global operations. Currently it supports sending messages to other source/nodes (across the cluster) and acknowledging receipt of those messages. After any changes, regenerate the mock with:
mockery -name FBContext -inpkg .
func NewFBContext ¶
NewFBContext creates a firebolt context with default/dummy implementations
type Message ¶
Message is the context representation of a 'message.Message'. Message depends on node.kafkaconsumer, so node must not depend on message.
type MessageFunc ¶
MessageFunc is a function supplied by Executor, which uses them to relay messages to the target source/node
type MockFBContext ¶
MockFBContext is an autogenerated mock type for the FBContext type
func (*MockFBContext) AckMessage ¶
func (_m *MockFBContext) AckMessage(msg Message) error
AckMessage provides a mock function with given fields: msg
func (*MockFBContext) ConfigureLeader ¶
func (_m *MockFBContext) ConfigureLeader(leader func() bool)
ConfigureLeader provides a mock function with given fields: leader
func (*MockFBContext) ConfigureMessaging ¶
func (_m *MockFBContext) ConfigureMessaging(send MessageFunc, ack MessageFunc)
ConfigureMessaging provides a mock function with given fields: send, ack
func (*MockFBContext) InstanceID ¶
func (_m *MockFBContext) InstanceID() string
InstanceID provides a mock function with given fields:
func (*MockFBContext) IsLeader ¶
func (_m *MockFBContext) IsLeader() bool
IsLeader provides a mock function with given fields:
func (*MockFBContext) SendMessage ¶
func (_m *MockFBContext) SendMessage(msg Message) error
SendMessage provides a mock function with given fields: msg