Documentation ¶
Overview ¶
Package couchdaemon provides utilities for processes running as a CouchDB os_daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrNotFound is returned by the config API when a key is not available. ErrNotFound = errors.New("couchdaemon: config key not found") // ErrNotInitialized is returned by all API functions // before Init has been called. ErrNotInitialized = errors.New("couchdaemon: not initialized") )
Functions ¶
func ConfigSection ¶
ConfigSection reads a whole section from the CouchDB configuration. If the section is not present, the error will be ErrNotFound and the returned map will be nil.
func ConfigVal ¶
ConfigVal reads a parameter value from the CouchDB configuration. If the parameter is unset, the error will be ErrNotFound and the returned string will be empty.
func Init ¶
func Init(exit chan<- struct{})
Init configures stdin and stdout for communication with couchdb.
The argument can be a writable channel or nil. If it is nil, the process will exit with status 0 when CouchDB signals that is exiting. If the value is a channel, the channel will be closed instead.
Stdin or stdout directly will confuse CouchDB should therefore be avoided.
You should call this function early in your initialization. The other API functions will return ErrNotInitialized until Init has been called.
Types ¶
type LogWriter ¶
type LogWriter interface { io.Writer // Err writes a message with level "error" Err(msg string) error // Info writes a message with level "info" Info(msg string) error // Info writes a message with level "debug" Debug(msg string) error }
A LogWriter writes messages to the CouchDB log. Its method set is a subset of the methods provided by log/syslog.Writer.
func NewLogWriter ¶
func NewLogWriter() LogWriter
NewLogWriter creates a log writer that outputs to the CouchDB log.