Documentation
¶
Index ¶
- func RegisterConnector(name string, ...)
- type Choice
- type ExchangeMessage
- func (e *ExchangeMessage) BindJSON(v interface{}) error
- func (e *ExchangeMessage) BindXML(v interface{}) error
- func (e *ExchangeMessage) ClearHeader()
- func (e *ExchangeMessage) DelHeader(k string)
- func (e *ExchangeMessage) GetBody() interface{}
- func (e *ExchangeMessage) GetHeader(k string) string
- func (e *ExchangeMessage) GetHeaderMap() HeaderMap
- func (e *ExchangeMessage) SetBody(b interface{})
- func (e *ExchangeMessage) SetHeader(k, v string)
- func (e *ExchangeMessage) WriteJSON(v interface{}) error
- func (e *ExchangeMessage) WriteXML(v interface{}) error
- type HeaderFnc
- type HeaderMap
- type IPipe
- type Message
- type Pipe
- func (p *Pipe) Body() interface{}
- func (p *Pipe) Choice() *Choice
- func (p *Pipe) From(url string, params ...interface{}) IPipe
- func (p *Pipe) GetBody() interface{}
- func (p *Pipe) GetFails() []error
- func (p *Pipe) GetHeader() HeaderMap
- func (p *Pipe) Header() HeaderMap
- func (p *Pipe) Processor(proc PipeProcessor) IPipe
- func (p *Pipe) SetBody(b interface{}) IPipe
- func (p *Pipe) SetHeader(k, v string) IPipe
- func (p *Pipe) To(url string, params ...interface{}) IPipe
- func (p *Pipe) Transform(from Transform, mode string, to Transform, fncs template.FuncMap) IPipe
- type PipeProcessor
- type Stack
- type Transform
- type URI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterConnector ¶
func RegisterConnector(name string, callback func(func(), *ExchangeMessage, Message, URI, ...interface{}) error)
RegisterConnector register a new Connector to use as From("my-connector://...")
Types ¶
type Choice ¶
type Choice struct {
// contains filtered or unexported fields
}
Choice is the type for conditional structure of a Pipe
type ExchangeMessage ¶
type ExchangeMessage struct {
// contains filtered or unexported fields
}
ExchangeMessage is the message exchange inner Pipe
func NewExchangeMessage ¶
func NewExchangeMessage() *ExchangeMessage
NewExchangeMessage creates new empty ExchangeMessage
func (*ExchangeMessage) BindJSON ¶
func (e *ExchangeMessage) BindJSON(v interface{}) error
BindJSON binds json body to interface
func (*ExchangeMessage) BindXML ¶
func (e *ExchangeMessage) BindXML(v interface{}) error
BindXML binds xml body to interface
func (*ExchangeMessage) ClearHeader ¶
func (e *ExchangeMessage) ClearHeader()
ClearHeader removes all entries from header
func (*ExchangeMessage) DelHeader ¶
func (e *ExchangeMessage) DelHeader(k string)
DelHeader delete header from message
func (*ExchangeMessage) GetBody ¶
func (e *ExchangeMessage) GetBody() interface{}
GetBody return body from message
func (*ExchangeMessage) GetHeader ¶
func (e *ExchangeMessage) GetHeader(k string) string
GetHeader returns a header value based on key
func (*ExchangeMessage) GetHeaderMap ¶
func (e *ExchangeMessage) GetHeaderMap() HeaderMap
GetHeaderMap return the map from header
func (*ExchangeMessage) SetBody ¶
func (e *ExchangeMessage) SetBody(b interface{})
SetBody writes the body to message
func (*ExchangeMessage) SetHeader ¶
func (e *ExchangeMessage) SetHeader(k, v string)
SetHeader add a key-value header to a message
func (*ExchangeMessage) WriteJSON ¶
func (e *ExchangeMessage) WriteJSON(v interface{}) error
WriteJSON marshall interface to JSON and set body
func (*ExchangeMessage) WriteXML ¶
func (e *ExchangeMessage) WriteXML(v interface{}) error
WriteXML marshall interface to XML and set body
type HeaderFnc ¶
HeaderFnc is a type to execute logical conditions from head values
type IPipe ¶
type IPipe interface {
From(string, ...interface{}) IPipe
To(string, ...interface{}) IPipe
SetHeader(string, string) IPipe
SetBody(interface{}) IPipe
Processor(PipeProcessor) IPipe
Body() interface{}
GetBody() interface{}
GetFails() []error
GetHeader() HeaderMap
Header() HeaderMap
Transform(Transform, string, Transform, template.FuncMap) IPipe
Choice() *Choice
}
IPipe is the interface with Pipe support
type Pipe ¶
type Pipe struct {
// contains filtered or unexported fields
}
Pipe is the main data structure of Flow Pipe controls all the execution flow
func (*Pipe) GetBody ¶
func (p *Pipe) GetBody() interface{}
GetBody get final body result from executed flow
func (*Pipe) GetHeader ¶
GetHeader same as GetBody but instead of return body of message this method returns the message header
func (*Pipe) Processor ¶
func (p *Pipe) Processor(proc PipeProcessor) IPipe
Processor execute a user-pass go function in the flow
type PipeProcessor ¶
type PipeProcessor func(*ExchangeMessage, Message, func())
PipeProcessor is a function type to execute pipe workflow
type Transform ¶
type Transform string
Transform date from template to other