mongo

package
v1.21.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2017 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitAddresses added in v1.20.0

func SplitAddresses(addresses string) []string

Types

type Config

type Config struct {
	Addresses        []string
	TLS              bool
	Database         string
	CollectionPrefix string
	Username         *string
	Password         *string
	Timeout          time.Duration
}

func NewConfig added in v1.20.0

func NewConfig() *Config

func (*Config) Load added in v1.20.0

func (c *Config) Load(configReporter config.Reporter) error

func (*Config) Validate

func (c *Config) Validate() error

type Session

type Session struct {
	// contains filtered or unexported fields
}

func (*Session) C

func (s *Session) C() *mgo.Collection

func (*Session) Close

func (s *Session) Close()

func (*Session) ConstructUpdate added in v1.20.0

func (s *Session) ConstructUpdate(set bson.M, unset bson.M) bson.M

func (*Session) EnsureAllIndexes added in v1.20.0

func (s *Session) EnsureAllIndexes(indexes []mgo.Index) error

func (*Session) EnsureIndexes added in v1.20.0

func (s *Session) EnsureIndexes() error

func (*Session) IsClosed

func (s *Session) IsClosed() bool

type Status

type Status struct {
	State       string
	BuildInfo   *mgo.BuildInfo
	LiveServers []string
	Mode        mgo.Mode
	Safe        *mgo.Safe
	Ping        string
}

type Store

type Store struct {
	Config  *Config
	Session *mgo.Session
}

func New

func New(cfg *Config, lgr log.Logger) (*Store, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) IsClosed

func (s *Store) IsClosed() bool

func (*Store) NewSession

func (s *Store) NewSession(collection string) *Session

func (*Store) Status added in v1.20.0

func (s *Store) Status() interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL