Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Adaptors = map[string]Creator{}
Adaptors stores a map of adaptors by name
Functions ¶
Types ¶
type Adaptor ¶ added in v0.1.2
Adaptor defines the interface that all database connectors and nodes must follow. Start() consumes data from the interface, Listen() listens on a pipe, processes data, and then emits it. Stop() shuts down the adaptor
func CreateAdaptor ¶ added in v0.1.2
CreateAdaptor instantiates an adaptor given the adaptor type and the Config. An Adaptor is expected to add themselves to the Adaptors map in the init() func
func init() {
adaptors.Add("TYPE", func(p *pipe.Pipe, path string, extra adaptors.Config) (adaptors.StopStartListener, error) {
})
}
and are expected to confirm to the Adaptor interface
type Config ¶
type Config map[string]interface{}
Config is an alias to map[string]interface{} and helps us turn a fuzzy document into a conrete named struct
func (*Config) CompileNamespace ¶ added in v0.1.2
CompileNamespace split's on the first '.' and then compiles the second portion to use as the msg filter
type Connectable ¶ added in v0.1.2
type Connectable interface {
Connect() error
}
Connectable defines the interface that adapters should follow to have their connections set on load Connect() allows the adaptor an opportunity to setup connections prior to Start()
type DbConfig ¶ added in v0.1.2
type DbConfig struct {
URI string `json:"uri" doc:"the uri to connect to, in the form mongo://user:password@host.com:8080/database"` // the database uri
Namespace string `json:"namespace" doc:"mongo namespace to read/write"` // namespace
Debug bool `json:"debug" doc:"display debug information"` // debug mode
}
DbConfig is a standard typed config struct to use for as general purpose config for most databases.
type Describable ¶ added in v0.1.2
Describable defines the interface that all database connectors and nodes must follow in order to support the help functions. SampleConfig() returns an example YAML structure to configure the adaptor Description() provides contextual information for what the adaptor is for
type ErrAdaptor ¶ added in v0.0.3
type ErrAdaptor struct {
// contains filtered or unexported fields
}
ErrAdaptor gives the details of the failed adaptor
func (ErrAdaptor) Error ¶ added in v0.0.3
func (a ErrAdaptor) Error() string
type Error ¶
type Error struct {
Lvl ErrorLevel
Str string
Path string
Record interface{}
}
Error is an error that happened during an adaptor's operation. Error's include both an indication of the severity, Level, as well as a reference to the Record that was in process when the error occurred
func NewError ¶
func NewError(lvl ErrorLevel, path, str string, record interface{}) Error
NewError creates an Error type with the specificed level, path, message and record
type ErrorLevel ¶
type ErrorLevel int
ErrorLevel indicated the severity of the error
const ( NOTICE ErrorLevel = iota WARNING ERROR CRITICAL )
Adaptor errors have levels to indicate their severity. CRITICAL errors indicate that the program cannot continue running.
ERROR errors indicate a problem with a specific document or message. a document might not have been applied properly to a source, but the program can continue
WARNING Todo
NOTICE ToDo