Documentation ¶
Index ¶
- Variables
- func Write(client Client, writer Writer, msg message.Msg) (message.Msg, error)
- type Client
- type Closer
- type ConnectError
- type InvalidTimeoutError
- type InvalidURIError
- type MessageChanFunc
- type MessageSet
- type Mock
- type MockErr
- type MockErrWriter
- type MockReader
- type MockSession
- type MockWriter
- type NsFilterFunc
- type Reader
- type Session
- type VersionError
- type Writer
Constants ¶
This section is empty.
Variables ¶
var ( // ErrMockConnect returns a connection error for use in tests. ErrMockConnect = errors.New("connect failed") // ErrMockWrite returns a write error for use in tests. ErrMockWrite = errors.New("write failed") )
var ErrInvalidCert = errors.New("invalid cert error")
ErrInvalidCert represents the error returned when a specified certificate was not valid
Functions ¶
Types ¶
type Client ¶
Client provides a standard interface for interacting with the underlying sources/sinks.
type Closer ¶
type Closer interface {
Close()
}
Closer provides a standard interface for closing a client or session
type ConnectError ¶
type ConnectError struct {
Reason string
}
ConnectError wraps the underlying error when a failure occurs dialing the database.
func (ConnectError) Error ¶
func (e ConnectError) Error() string
type InvalidTimeoutError ¶
type InvalidTimeoutError struct {
Timeout string
}
InvalidTimeoutError wraps the underlying error when the provided is not parsable time.ParseDuration.
func (InvalidTimeoutError) Error ¶
func (e InvalidTimeoutError) Error() string
type InvalidURIError ¶
InvalidURIError wraps the underlying error when the provided URI is not parsable by mgo.
func (InvalidURIError) Error ¶
func (e InvalidURIError) Error() string
type MessageChanFunc ¶
type MessageChanFunc func(Session, chan struct{}) (chan MessageSet, error)
MessageChanFunc represents the func signature needed to send messages to downstream adaptors.
type MessageSet ¶ added in v0.4.0
MessageSet encapsulates the data being sent down the pipeline and its associated attributes.
type Mock ¶
type Mock struct {
Closed bool
}
Mock can be used for mocking tests that need no actual client or Session.
type MockErr ¶
type MockErr struct { }
MockErr can be used for mocking tests that need no actual client or Session.
type MockErrWriter ¶ added in v0.4.0
type MockErrWriter struct { }
MockErrWriter can be used to similate write errors in tests.
type MockReader ¶ added in v0.3.0
type MockReader struct {
MsgCount int
}
MockReader can be used to send a random number of messages
func (*MockReader) Read ¶ added in v0.3.0
func (r *MockReader) Read(_ map[string]MessageSet, filterFn NsFilterFunc) MessageChanFunc
type MockSession ¶
type MockSession struct { }
MockSession can be used for mocking tests the do not need to use anything in the Session.
type MockWriter ¶
type MockWriter struct {
MsgCount int
}
MockWriter can be used to count the number of messages sent to Write.
type NsFilterFunc ¶
NsFilterFunc represents the func signature needed to filter while Read()ing.
type Reader ¶
type Reader interface {
Read(map[string]MessageSet, NsFilterFunc) MessageChanFunc
}
Reader represents the ability to send messages down the pipe and is only needed for adaptors acting as a Source node.
type Session ¶
type Session interface { }
Session represents the connection to the underlying service.
type VersionError ¶
VersionError represents any failure in attempting to obtain the version from the provided uri.
func (VersionError) Error ¶
func (e VersionError) Error() string