database

package
Version: v0.0.0-...-043d1ac Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2017 License: AGPL-3.0-or-later, GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Session *mgo.Session
)

Functions

func Connect

func Connect() (err error)

func GetErrorCode

func GetErrorCode(err error) (errCode int)

Get mongodb error code from error

func ParseError

func ParseError(err error) (newErr error)

Parse database error data and return error type

func SelectFields

func SelectFields(obj interface{}, fields set.Set) (data bson.M)

Types

type CertificateError

type CertificateError struct {
	errors.DropboxError
}

type Collection

type Collection struct {
	mgo.Collection
	Database *Database
}

func (*Collection) Commit

func (c *Collection) Commit(id interface{}, data interface{}) (err error)

func (*Collection) CommitFields

func (c *Collection) CommitFields(id interface{}, data interface{},
	fields set.Set) (err error)

func (*Collection) FindOne

func (c *Collection) FindOne(query interface{}, result interface{}) (
	err error)

func (*Collection) FindOneId

func (c *Collection) FindOneId(id interface{}, result interface{}) (
	err error)

type ConnectionError

type ConnectionError struct {
	errors.DropboxError
}

type Database

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

func GetDatabase

func GetDatabase() (db *Database)

func (*Database) Builds

func (d *Database) Builds() (coll *Collection)

func (*Database) BuildsLog

func (d *Database) BuildsLog() (coll *Collection)

func (*Database) Close

func (d *Database) Close()

func (*Database) Events

func (d *Database) Events() (coll *Collection)

func (*Database) Nodes

func (d *Database) Nodes() (coll *Collection)

func (*Database) NodesSettings

func (d *Database) NodesSettings() (coll *Collection)

func (*Database) PkgBuildGrid

func (d *Database) PkgBuildGrid() *mgo.GridFS

func (*Database) PkgGrid

func (d *Database) PkgGrid() *mgo.GridFS

func (*Database) Settings

func (d *Database) Settings() (coll *Collection)

func (*Database) Sources

func (d *Database) Sources() (coll *Collection)

func (*Database) SourcesState

func (d *Database) SourcesState() (coll *Collection)

type DuplicateKeyError

type DuplicateKeyError struct {
	errors.DropboxError
}

type IndexError

type IndexError struct {
	errors.DropboxError
}

type NotFoundError

type NotFoundError struct {
	errors.DropboxError
}

type UnknownError

type UnknownError struct {
	errors.DropboxError
}

Jump to

Keyboard shortcuts

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