Documentation ¶
Overview ¶
Package config contains the logic for reading the configurations from a file in order to bootstrap it.
Index ¶
Constants ¶
const (
// NilStr is used to print nil string for an error.
NilStr = "<nil>"
)
Variables ¶
var ErrEmptyConfig = &StructureErr{"", "empty configuration file", nil}
ErrEmptyConfig is returned 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 reader names to a list of recorders. // map["red1"][]string{"rec1", "rec2"}: means whatever is read // from red1, will be shipped to rec1 and rec2. Routes map[string][]string }
ConfMap holds the relation between readers and recorders.
type NotSpecifiedError ¶
type NotSpecifiedError StructureErr
NotSpecifiedError is returned when a section is not specified.
func NewNotSpecifiedError ¶
func NewNotSpecifiedError(section, reason string, err error) *NotSpecifiedError
NewNotSpecifiedError returns ErrNotSpecified with the given input.
func (*NotSpecifiedError) Error ¶
func (e *NotSpecifiedError) Error() string
type NotSupportedError ¶
type NotSupportedError string
NotSupportedError says something is still not supported.
func (NotSupportedError) Error ¶
func (n NotSupportedError) Error() string
type RoutersError ¶
type RoutersError struct{ StructureErr }
RoutersError is returned when routes are not configured correctly. The section on this error is the subsection of the route.
func NewRoutersError ¶
func NewRoutersError(section, reason string, err error) *RoutersError
NewRoutersError instantiates an RoutersError with the given input.
func (*RoutersError) Error ¶
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 occurred error during the operation. }
StructureErr is for reading the configuration file errors.
func (*StructureErr) Error ¶
func (e *StructureErr) Error() string
Error returns "<nil>" if the error is nil.