mongo

package
v0.0.0-...-db8a3e8 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func All

func All(table string, m bson.M, out interface{}) error

func AllPipe

func AllPipe(table string, m []bson.M, out interface{}) error

func Collection

func Collection(collection string) (*mgo.Session, *mgo.Collection)

func Get

func Get(table string) (*mgo.Session, *mgo.Collection)

func Insert

func Insert(table string, input ...interface{}) error

func One

func One(table string, m bson.M, out interface{}) error

func OnePipe

func OnePipe(table string, m []bson.M, out interface{}) error

func SetRibbitItem

func SetRibbitItem(item CacheItem) error

func Update

func Update(table string, query bson.M, input interface{}) error

Types

type CacheItem

type CacheItem struct {
	ID      bson.ObjectId `bson:"_id,omitempty" json:"-"`
	Code    string        `bson:"code"`
	Seqn    string        `bson:"seqn"`
	File    string        `bson:"file"`
	Indexed time.Time     `bson:"indexed"`
	Raw     string        `bson:"raw"`
}

func GetRibbitItem

func GetRibbitItem(code, seqn, file string) (CacheItem, error)

func LatestSummary

func LatestSummary() (CacheItem, error)

type Mongo

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

func Instance

func Instance() (*Mongo, error)

func New

func New(settings MongoSettings) *Mongo

func (*Mongo) Collection

func (mg *Mongo) Collection(collection string) (*mgo.Session, *mgo.Collection)

type MongoSettings

type MongoSettings struct {
	Host, Username, Password, Database string
}

Jump to

Keyboard shortcuts

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