jkdbs

package
v0.0.0-...-a9e9222 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2022 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CMMysql

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

func NewCMMysql

func NewCMMysql(dsn string) (*CMMysql, error)

func (*CMMysql) Add

func (ms *CMMysql) Add(dbname string, coll string, data interface{}) error

func (*CMMysql) Close

func (ms *CMMysql) Close()

func (*CMMysql) Query

func (ms *CMMysql) Query(dbname string, coll string, condition interface{}, result interface{}) error

func (*CMMysql) Remove

func (ms *CMMysql) Remove(dbname string, coll string, condition interface{}) error

func (*CMMysql) Update

func (ms *CMMysql) Update(dbname string, coll string, condition interface{}) error

type CMMysqlSC

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

func NewCMMysqlSC

func NewCMMysqlSC(username, password string, dbname string) (*CMMysqlSC, error)

func (*CMMysqlSC) AddDevStatus

func (msc *CMMysqlSC) AddDevStatus(st SCDevStatus) error

func (*CMMysqlSC) Close

func (ms *CMMysqlSC) Close()

func (*CMMysqlSC) QueryDevStatus

func (msc *CMMysqlSC) QueryDevStatus() ([]*SCDevStatus, error)

func (*CMMysqlSC) QueryDevStatusMac

func (msc *CMMysqlSC) QueryDevStatusMac(mac string) (*SCDevStatus, error)

func (*CMMysqlSC) RemoveDevStatus

func (msc *CMMysqlSC) RemoveDevStatus() error

func (*CMMysqlSC) UpdateDevStatusMac

func (msc *CMMysqlSC) UpdateDevStatusMac(st SCDevStatus) error

type JKDBS

type JKDBS interface {
	Query(dbname string, coll string, condition interface{}, result interface{}) error
	Update(dbname string, coll string, condition interface{}) error
	Add(dbname string, coll string, data interface{}) error
	Remove(dbname string, coll string, condition interface{}) error
}

type JKDBSBase

type JKDBSBase struct {
}

type Mongo

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

func NewMongo

func NewMongo(mgoDns string) *Mongo

func (*Mongo) Add

func (m *Mongo) Add(dbname string, coll string, data interface{}) error

func (*Mongo) C

func (m *Mongo) C(col map[string]interface{}) *mgo.Collection

func (*Mongo) Close

func (m *Mongo) Close()

func (*Mongo) Cnew

func (m *Mongo) Cnew(dbname string, cname string) *mgo.Collection

get collections

func (*Mongo) DB

func (m *Mongo) DB(dbname string) *mgo.Database

get databse

func (*Mongo) DBSession

func (m *Mongo) DBSession() *mgo.Session

func (*Mongo) DbName

func (m *Mongo) DbName() string

get database name

func (*Mongo) Query

func (m *Mongo) Query(dbname string, coll string, find interface{}, condition interface{}, result interface{}) error

func (*Mongo) QueryCount

func (m *Mongo) QueryCount(dbname string, coll string, find interface{}) (int, error)

func (*Mongo) Remove

func (m *Mongo) Remove(dbname string, coll string, condition interface{}) error

func (*Mongo) Update

func (m *Mongo) Update(dbname string, coll string, find interface{}, updater interface{}) error

type MongoCondition

type MongoCondition struct {
	Limit    int
	Skip     int
	Order    bool
	Orderkey string
}

type SCDevStatus

type SCDevStatus struct {
	Mac        string
	IP         string
	DevType    string
	Version    string
	Time       int64
	RemoteIp   string
	ActionType string
	Online     bool
}

type SCDevStatusHistory

type SCDevStatusHistory struct {
	Index      int64
	Version    string
	Time       int64
	DevTime    int64
	RemoteIp   string
	DevType    string
	Mac        string
	IP         string
	ActionType string
	Duration   int
}

Jump to

Keyboard shortcuts

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