Documentation
¶
Overview ¶
Package config has helpers to parse and use JSON based configuration.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ReadConfig ¶
ReadConfig reads a JSON configuration into destConfig which should be a pointer to a structure, it does some more configuration specific error checking than plain JSON decoding and mentions fields in errors . Configuration fields are expected to start with lower case in the JSON object.
Types ¶
type ConfigHostPort ¶
type ConfigHostPort string
ConfigHostPort can hold a host:port string in a configuration struct.
func (ConfigHostPort) HostPort ¶
func (chp ConfigHostPort) HostPort() string
HostPort returns the host:port string held in chp.
func (*ConfigHostPort) UnmarshalJSON ¶
func (chp *ConfigHostPort) UnmarshalJSON(b []byte) error
type ConfigQueueSize ¶
type ConfigQueueSize uint
ConfigQueueSize can hold a queue size in a configuration struct.
func (ConfigQueueSize) QueueSize ¶
func (cqs ConfigQueueSize) QueueSize() uint
QueueSize returns the queue size held in cqs.
func (*ConfigQueueSize) UnmarshalJSON ¶
func (cqs *ConfigQueueSize) UnmarshalJSON(b []byte) error
type ConfigTimeDuration ¶
ConfigTimeDuration can hold a time.Duration in a configuration struct, that is parsed from a string as supported by time.ParseDuration.
func (ConfigTimeDuration) TimeDuration ¶
func (ctd ConfigTimeDuration) TimeDuration() time.Duration
TimeDuration returns the time.Duration held in ctd.
func (*ConfigTimeDuration) UnmarshalJSON ¶
func (ctd *ConfigTimeDuration) UnmarshalJSON(b []byte) error