storage

package
v0.0.0-...-620f6c9 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MGO_DB_NAME            = "gameServer"
	UserInfo_COLLECTION    = "UserInfo"
	RegistInput_COLLECTION = "RegistInput"
)

Variables

This section is empty.

Functions

func ReadMgoSettingFromEnv

func ReadMgoSettingFromEnv()

Types

type Db

type Db interface {
	Init(string, ...string)
	Save(string, interface{}) bool
	Update(string, interface{}, interface{}) bool
	Delete(string, interface{}) bool
	Find(string, interface{}) *mgo.Iter
}

type FileStore

type FileStore struct {
	FileName string
	Path     string
}

type MgoError

type MgoError struct {
	Op  string
	Err error
}

func (*MgoError) Error

func (e *MgoError) Error() string

type MongoDb

type MongoDb struct {
	Session     *mgo.Session
	Collections map[string]*mgo.Collection
}
var MgoDb *MongoDb = &MongoDb{}

func (*MongoDb) Delete

func (m *MongoDb) Delete(collectionName string, query interface{}) bool

func (*MongoDb) Find

func (m *MongoDb) Find(collectionName string, query interface{}) *mgo.Iter

func (*MongoDb) Init

func (m *MongoDb) Init(dbName string, collectionNames ...string)

func (*MongoDb) Save

func (m *MongoDb) Save(collectionName string, data interface{}) bool

func (*MongoDb) Update

func (m *MongoDb) Update(collectionName string, query interface{}, data interface{}) bool

Jump to

Keyboard shortcuts

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