mongo

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2018 License: BSD-2-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitAddresses

func SplitAddresses(addresses string) []string

Types

type Config

type Config struct {
	Addresses        []string      `json:"addresses"`
	TLS              bool          `json:"tls"`
	Database         string        `json:"database"`
	CollectionPrefix string        `json:"collectionPrefix"`
	Username         *string       `json:"-"`
	Password         *string       `json:"-"`
	Timeout          time.Duration `json:"timeout"`
}

func NewConfig

func NewConfig() *Config

func (*Config) Load

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() error

func (*Session) ConstructUpdate

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

func (*Session) EnsureAllIndexes

func (s *Session) EnsureAllIndexes(indexes []mgo.Index) 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 NewStore

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

func (*Store) Close

func (s *Store) Close() error

func (*Store) IsClosed

func (s *Store) IsClosed() bool

func (*Store) NewSession

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

func (*Store) Status

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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