db

package
v0.0.0-...-4e46751 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2016 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EMPTY_ID = "empty"
)

Variables

View Source
var (
	SERVER_TABLE   = "server"
	TEMPLATE_TABLE = "template"
	CONFIGS_TABLE  = "configs"
	COUNTER_TABLE  = "counter"

	TABLES = []string{SERVER_TABLE, TEMPLATE_TABLE, CONFIGS_TABLE, COUNTER_TABLE}
)
View Source
var (
	GLOBAL_SESSION *mgo.Session
)

Functions

func All

func All(table string, t reflect.Type) ([]interface{}, error)

func Get

func Get(table string, key string, t reflect.Type) (interface{}, error)

func GetNextID

func GetNextID(table string) (string, error)

func Set

func Set(table string, key string, value interface{}) error

func Unset

func Unset(table, key string) error

Types

type Counter

type Counter struct {
	ID  string `bson:"_id"`
	Seq int    `bson:"seq"`
}

Jump to

Keyboard shortcuts

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