Documentation
¶
Index ¶
- type AsyncEvent
- type Event
- type EventError
- type FBError
- type FBErrorOpt
- type Nodeconfig
- func (c Nodeconfig) IntConfig(name string, defaultValue int, minValue int, maxValue int) (int, error)
- func (c Nodeconfig) IntConfigRequired(name string, minValue int, maxValue int) (int, error)
- func (c Nodeconfig) StringConfig(name string, defaultValue string) (string, error)
- func (c Nodeconfig) StringConfigRequired(name string) (string, error)
- type ProduceRequest
- type SimpleProduceRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AsyncEvent ¶
type AsyncEvent struct { *Event ReturnError func(error) ReturnEvent func(*AsyncEvent) ReturnFiltered func() }
AsyncEvent is a version of Event for nodes that support asynchronous processing.
func NewAsyncEvent ¶
func NewAsyncEvent(event *Event, errFunc func(error), eventFunc func(*AsyncEvent), filterFunc func()) *AsyncEvent
NewAsyncEvent creates a version of the passed Event suitable for asynchronous processing.
func (*AsyncEvent) WithPayload ¶
func (ae *AsyncEvent) WithPayload(payload interface{}) *AsyncEvent
WithPayload returns a clone of this event with the payload replaced.
type Event ¶
type Event struct { Payload interface{} `json:"payload"` Created time.Time `json:"created"` Recovery bool `json:"recovery"` }
Event is the struct passed through the node graph.
func (*Event) WithPayload ¶
WithPayload returns a clone of this event with the payload replaced.
type EventError ¶
type EventError struct { Timestamp time.Time `json:"timestamp"` Event interface{} `json:"event"` Err error `json:"error"` }
EventError is the structure passed to any `error_handler`. When an error occurs in a node that has an error_handler configured, firebolt wraps up the error and the causing event in an EventError. This EventError needs to be handled in your error_handler's Process() method.
func NewEventError ¶
func NewEventError(event *Event, err error) EventError
NewEventError constructs
func (EventError) MarshalJSON ¶
func (ee EventError) MarshalJSON() ([]byte, error)
MarshalJSON converts an EventError to json, replacing any err values that are not FBError with a FBError wrapper so that the generated JSON has consistent structure.
type FBError ¶
type FBError struct { Code string `json:"code"` Msg string `json:"message"` ErrorInfo interface{} `json:"errorinfo,omitempty"` }
FBError is an optional error type that can be returned from the Process() method in your nodes,
func NewFBError ¶
func NewFBError(code string, msg string, opts ...FBErrorOpt) FBError
NewFBError constructs a firebolt error. Returning a FBError (rather than just 'error') from the Process() method in your nodes will result in more structured error reports if you use `error_handler` nodes.
type FBErrorOpt ¶
FBErrorOpt is an option that allows you do add optional data to an FBError when calling the constructor.
func WithInfo ¶
func WithInfo(info interface{}) FBErrorOpt
WithInfo adds information to FBError.ErrorInfo.
type Nodeconfig ¶
Nodeconfig holds a Nodes configuration
func (Nodeconfig) IntConfig ¶
func (c Nodeconfig) IntConfig(name string, defaultValue int, minValue int, maxValue int) (int, error)
IntConfig validates and fetches the int-typed optional config value specified by 'name', using the 'defaultValue' if no value was provided in the configuration.
func (Nodeconfig) IntConfigRequired ¶
IntConfigRequired validates and fetches the int-typed required config value specified by 'name', returning an error if no value was provided in the configuration.
func (Nodeconfig) StringConfig ¶
func (c Nodeconfig) StringConfig(name string, defaultValue string) (string, error)
StringConfig validates and fetches the string-typed optional config value specified by 'name', using the 'defaultValue' if no value was provided in the configuration.
func (Nodeconfig) StringConfigRequired ¶
func (c Nodeconfig) StringConfigRequired(name string) (string, error)
StringConfigRequired validates and fetches the string-typed required config value specified by 'name', returning an error if no value was provided in the configuration.
type ProduceRequest ¶
ProduceRequest is a request to produce a single message to a topic in a messaging system (AMQP, Kafka, ZMQ, etc).
type SimpleProduceRequest ¶
SimpleProduceRequest is a default implementation of ProduceRequest that can be used in simple cases to request that a message be produced.
func (*SimpleProduceRequest) Message ¶
func (s *SimpleProduceRequest) Message() []byte
Message returns the raw message bytes.
func (*SimpleProduceRequest) Topic ¶
func (s *SimpleProduceRequest) Topic() string
Topic returns the target topic in the destination messaging system to which this message should be sent.
Directories
¶
Path | Synopsis |
---|---|
Code generated by mockery v1.0.0.
|
Code generated by mockery v1.0.0. |
Code generated by mockery v1.0.0.
|
Code generated by mockery v1.0.0. |
kafkaproducer
Code generated by mockery v1.0.0.
|
Code generated by mockery v1.0.0. |