mongo

package
v0.0.1-alpha.10 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2016 License: BSD-3-Clause Imports: 11 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 does not 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 Session

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

func (*Session) ActivateAllDatasetData

func (s *Session) ActivateAllDatasetData(dataset *upload.Upload) error

func (*Session) C

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

func (*Session) Close

func (s *Session) Close()

func (*Session) CreateDataset

func (s *Session) CreateDataset(dataset *upload.Upload) error

func (*Session) CreateDatasetData

func (s *Session) CreateDatasetData(dataset *upload.Upload, datasetData []data.Datum) error

func (*Session) GetDataset

func (s *Session) GetDataset(datasetID string) (*upload.Upload, error)

func (*Session) IsClosed

func (s *Session) IsClosed() bool

func (*Session) RemoveAllOtherDatasetData

func (s *Session) RemoveAllOtherDatasetData(dataset *upload.Upload) error

func (*Session) UpdateDataset

func (s *Session) UpdateDataset(dataset *upload.Upload) 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
}

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