Documentation
¶
Overview ¶
Package config reads the configurations from a yaml file and produces necessary configuration for instantiating readers and recorders.
Index ¶
Constants ¶
const (
// NilStr is the string used to print nil for an error
NilStr = "<nil>"
)
Variables ¶
var EmptyConfigErr = &StructureErr{"", "empty configuration file", nil}
EmptyConfigErr is an error when the config file is empty
Functions ¶
This section is empty.
Types ¶
type ConfMap ¶
type ConfMap struct { // Readers contains a map of reader names to their instantiated objects. Readers map[string]reader.DataReader // Recorders contains a map of recorder names to their instantiated objects. Recorders map[string]recorder.DataRecorder // Routes contains a map of recorder names to a list of readers. // map["rec1"][]string{"red1", "red2"}: means whatever is read // from red1 and red2, will be shipped to rec1. Routes map[string][]string }
ConfMap holds the relation between readers and recorders.
type NotSpecifiedError ¶ added in v0.9.2
type NotSpecifiedError StructureErr
NotSpecifiedError is returned when a section is not specified
func NewNotSpecifiedError ¶ added in v0.9.2
func NewNotSpecifiedError(section, reason string, err error) *NotSpecifiedError
NewNotSpecifiedError instantiates an ErrNotSpecified with the given input
func (*NotSpecifiedError) Error ¶ added in v0.9.2
func (e *NotSpecifiedError) Error() string
type NotSupportedError ¶ added in v0.9.2
type NotSupportedError string
NotSupportedError says something is still not supported
func (NotSupportedError) Error ¶ added in v0.9.2
func (n NotSupportedError) Error() string
type ReaderConf ¶
type ReaderConf interface {
NewInstance() (reader.DataReader, error)
}
ReaderConf is for configure and returning a Reader instance.
type RecorderConf ¶
type RecorderConf interface {
NewInstance() (recorder.DataRecorder, error)
}
RecorderConf is for configure and returning a Recorder instance.
type RoutersError ¶ added in v0.9.2
type RoutersError struct{ StructureErr }
RoutersError represents an error when routes are not configured correctly. The section on this error is the subsection of the route.
func NewRoutersError ¶ added in v0.9.2
func NewRoutersError(section, reason string, err error) *RoutersError
NewRoutersError instantiates an RoutersError with the given input
func (*RoutersError) Error ¶ added in v0.9.2
func (e *RoutersError) Error() string
type StructureErr ¶
type StructureErr struct { Section string // The section that error happened Reason string // The reason behind the error Err error // Err is the error that occurred during the operation. }
StructureErr is an error on reading the configuration file.
func (*StructureErr) Error ¶
func (e *StructureErr) Error() string
Error returns "<nil>" if the error is nil.