mongo

package
v1.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2016 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Addresses  string         `json:"addresses"` // TODO: This should be an array, but configor does not support that. Bleech! Fix?
	Database   string         `json:"database"`
	Collection string         `json:"collection"`
	Username   *string        `json:"username"`
	Password   *string        `json:"password"`
	Timeout    *time.Duration `json:"timeout"`
	SSL        bool           `json:"ssl"`
}

func (*Config) Clone

func (c *Config) Clone() *Config

func (*Config) Validate

func (c *Config) Validate() error

type Session

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

func (*Session) AgentUserID added in v1.2.0

func (s *Session) AgentUserID() string

func (*Session) C

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

func (*Session) Close

func (s *Session) Close()

func (*Session) IsClosed

func (s *Session) IsClosed() bool

func (*Session) Logger

func (s *Session) Logger() log.Logger

func (*Session) SetAgent added in v1.2.0

func (s *Session) SetAgent(agent store.Agent)

func (*Session) Timestamp added in v1.2.0

func (s *Session) Timestamp() string

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(logger log.Logger, config *Config) (*Store, error)

func (*Store) Close

func (s *Store) Close()

func (*Store) GetStatus

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

func (*Store) IsClosed

func (s *Store) IsClosed() bool

func (*Store) NewSession

func (s *Store) NewSession(logger log.Logger) (*Session, error)

Jump to

Keyboard shortcuts

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