mongo

package
v0.0.1-alpha.3 Latest Latest
Warning

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

Go to latest
Published: May 31, 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         `yaml:"addresses"` // TODO: This should be an array, but configor doesn't support that. Bleech! Fix?
	Database   string         `yaml:"database"`
	Collection string         `yaml:"collection"`
	Username   *string        `yaml:"username"`
	Password   *string        `yaml:"password"`
	Timeout    *time.Duration `yaml:"timeout"`
	SSL        bool           `yaml:"ssl"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Iterator

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

func (*Iterator) All

func (i *Iterator) All(result interface{}) error

func (*Iterator) Close

func (i *Iterator) Close() (err error)

func (*Iterator) Err

func (i *Iterator) Err() error

func (*Iterator) IsClosed

func (i *Iterator) IsClosed() bool

func (*Iterator) Next

func (i *Iterator) Next(result interface{}) bool

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) Find

func (s *Session) Find(query store.Query, result interface{}) error

func (*Session) FindAll

func (s *Session) FindAll(query store.Query, sort []string, filter store.Filter) store.Iterator

func (*Session) Insert

func (s *Session) Insert(document interface{}) error

func (*Session) InsertAll

func (s *Session) InsertAll(documents ...interface{}) error

func (*Session) IsClosed

func (s *Session) IsClosed() bool

func (*Session) RemoveAll

func (s *Session) RemoveAll(selector interface{}) error

func (*Session) Update

func (s *Session) Update(selector interface{}, update interface{}) error

func (*Session) UpdateAll

func (s *Session) UpdateAll(selector interface{}, update interface{}) error

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
	BuildInfo *mgo.BuildInfo
}

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) (store.Session, error)

Jump to

Keyboard shortcuts

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