Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNoURI error = errors.New("no URI provided -- supply an environment variable containing the mongodb URI, or set it in the MONGODB_URI environment variable") ErrMissingUser error = errors.New("unset Mongo user variable: please export the MONGO_USER variable") ErrMissingPassword error = errors.New("unset Mongo password variable: please export the MONGO_PASSWORD variable") ErrMissingDatabase error = errors.New("unset Mongo database variable: please export the MONGO_DATABASE variable") )
Functions ¶
func New ¶
func New(address, database, collection string) (io.WriteCloser, error)
New function will take in a MongoDB address, database and collection names; and create a new instance of a Mongo object; returning an io.WriteCloser and an error.
func WithMongo ¶
func WithMongo(addr, database, collection string) log.LoggerConfig
WithMongo function takes in the address to the mongo server, and a database and collection name; and returns a LoggerConfig so that this type of writer is defined in a Logger
Types ¶
type Mongo ¶
type Mongo struct {
// contains filtered or unexported fields
}
Mongo struct is a wrapper for a MongoDB database to be used as a Log Writer
func (*Mongo) Close ¶
Close method is used to terminate the live connection to the MongoDB instance.
Click to show internal directories.
Click to hide internal directories.