Documentation ¶
Index ¶
- Variables
- func Adaptors() map[string]Adaptor
- func Add(name string, creator Creator)
- func RegisteredAdaptors() []string
- type Adaptor
- type BaseConfig
- type Config
- type Connectable
- type Creator
- type Describable
- type ErrFuncNotSupported
- type ErrNotFound
- type Error
- type ErrorLevel
- type Mock
- type UnsupportedMock
Constants ¶
This section is empty.
Variables ¶
var ErrNamespaceMalformed = errors.New("malformed namespace, expected a '.' deliminated string")
ErrNamespaceMalformed represents the error to be returned when an invalid namespace is given.
Functions ¶
func Adaptors ¶
Adaptors returns an non-initialized adaptor and is best used for doing assertions to see if the Adaptor supports other interfaces
func RegisteredAdaptors ¶ added in v0.3.0
func RegisteredAdaptors() []string
RegisteredAdaptors returns a slice of the names of every adaptor registered.
Types ¶
type Adaptor ¶
type Adaptor interface { Client() (client.Client, error) Reader() (client.Reader, error) Writer(chan struct{}, *sync.WaitGroup) (client.Writer, error) }
Adaptor defines the interface which provides functions to create client interfaces
type BaseConfig ¶ added in v0.3.0
BaseConfig is a standard typed config struct to use for as general purpose config for most databases.
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
type Connectable ¶
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 Describable ¶
Describable defines the interface that all database connectors and nodes must follow in order to support the help functions. SampleConfig() returns an example JSON structure to configure the adaptor Description() provides contextual information for what the adaptor is for
type ErrFuncNotSupported ¶ added in v0.3.0
ErrFuncNotSupported should be used for adaptors that do not support a given function defined by the interface.
func (ErrFuncNotSupported) Error ¶ added in v0.3.0
func (a ErrFuncNotSupported) Error() string
type ErrNotFound ¶
type ErrNotFound struct {
Name string
}
ErrNotFound gives the details of the failed adaptor
func (ErrNotFound) Error ¶
func (a ErrNotFound) Error() string
type Error ¶
type Error struct { Lvl ErrorLevel Err 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
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
type Mock ¶ added in v0.3.0
type Mock struct {
BaseConfig
}
Mock can be used for mocking tests that need no functional client interfaces.
func (*Mock) Client ¶ added in v0.3.0
Client satisfies the V2 interface for providing a client.Client.
type UnsupportedMock ¶ added in v0.3.0
type UnsupportedMock struct {
BaseConfig
}
UnsupportedMock can be used for mocking tests that need no functional client interfaces.
func (*UnsupportedMock) Client ¶ added in v0.3.0
func (m *UnsupportedMock) Client() (client.Client, error)
Client satisfies the V2 interface for providing a client.Client.