Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // file containing transformer javascript // must define a module.exports = function(doc) { .....; return doc } Filename string `json:"filename" doc:"the filename containing the javascript transform fn"` Namespace string `json:"namespace" doc:"namespace to transform"` // verbose output Debug bool `json:"debug" doc:"display debug information"` // debug mode }
Config holds config options for a transformer adaptor
type Transformer ¶
type Transformer struct {
// contains filtered or unexported fields
}
Transformer is an adaptor which consumes data from a source, transforms it using a supplied javascript function and then emits it. The javascript transformation function is supplied as a separate file on disk, and is called by calling the defined module.exports function
func (*Transformer) Connect ¶
func (t *Transformer) Connect() error
Connect loads the transformer file and initializes the transformer environment
func (*Transformer) Description ¶
func (t *Transformer) Description() string
Description for transformer adaptor
func (*Transformer) Listen ¶
func (t *Transformer) Listen() (err error)
Listen starts the transformer's listener, reads each message from the incoming channel transformers it into mejson, and then uses the supplied javascript module.exports function to transform the document. The document is then emitted to this adaptor's children
func (*Transformer) SampleConfig ¶
func (t *Transformer) SampleConfig() string
SampleConfig for transformer adaptor
func (*Transformer) Start ¶
func (t *Transformer) Start() error
Start the adaptor as a source (not implemented for this adaptor)