v1

package
v0.0.0-...-83adff0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dao

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

Dao dao.

func New

func New(c *conf.Config) *Dao

New new a dao.

func (*Dao) BeginTran

func (d *Dao) BeginTran(c context.Context) (tx *sql.Tx, err error)

BeginTran begin transcation.

func (*Dao) BuildVersion

func (d *Dao) BuildVersion(c context.Context, svr, bver, env string) (version int64, err error)

BuildVersion return service build version from mysql.

func (*Dao) Builds

func (d *Dao) Builds(c context.Context, svr, env string) (rs []string, err error)

Builds get service builds.

func (*Dao) ClearHost

func (d *Dao) ClearHost(c context.Context, svr, env string) (err error)

ClearHost clear all hosts.

func (*Dao) Close

func (d *Dao) Close()

Close close resuouces.

func (*Dao) DelFile

func (d *Dao) DelFile(name string) (err error)

DelFile delete file cache.

func (*Dao) File

func (d *Dao) File(name string) (res *model.Content, err error)

File return config file.

func (*Dao) FileStr

func (d *Dao) FileStr(name string) (file string, err error)

FileStr get string file.

func (*Dao) Hosts

func (d *Dao) Hosts(c context.Context, svr, env string) (hosts []*model.Host, err error)

Hosts return service hosts from redis.

func (*Dao) InsertLog

func (d *Dao) InsertLog(c context.Context, user, business, info string) (err error)

InsertLog insert log.

func (*Dao) Namespaces

func (d *Dao) Namespaces(c context.Context, ver int64) (rs map[int64]string, err error)

Namespaces return namespaces from mysql

func (*Dao) Ping

func (d *Dao) Ping(c context.Context) (err error)

Ping ping is ok.

func (*Dao) ServiceID

func (d *Dao) ServiceID(c context.Context, svr, env string) (ID int64, err error)

ServiceID get ServiceID.

func (*Dao) SetFile

func (d *Dao) SetFile(name string, conf *model.Content) (err error)

SetFile set config file.

func (*Dao) SetFileStr

func (d *Dao) SetFileStr(name string, val string) (err error)

SetFileStr save string file.

func (*Dao) SetHost

func (d *Dao) SetHost(c context.Context, host *model.Host, svr, env string) (err error)

SetHost add service host to redis.

func (*Dao) Token

func (d *Dao) Token(c context.Context, svr, env string) (token string, err error)

Token return a Secret from mysql.

func (*Dao) TxInsertValues

func (d *Dao) TxInsertValues(c context.Context, tx *sql.Tx, verID int64, user string, data map[string]string) (err error)

TxInsertValues insert config values.

func (*Dao) TxInsertVer

func (d *Dao) TxInsertVer(tx *sql.Tx, svrID int64, user string) (verID int64, err error)

TxInsertVer insert version.

func (*Dao) TxUpdateValues

func (d *Dao) TxUpdateValues(tx *sql.Tx, verID int64, user string, data map[string]string) (err error)

TxUpdateValues update config values.

func (*Dao) Value

func (d *Dao) Value(c context.Context, fname string, ver int64) (file string, err error)

Value return values from mysql.

func (*Dao) Values

func (d *Dao) Values(c context.Context, ver int64) (rs []*model.NSValue, err error)

Values return values from mysql.

func (*Dao) Versions

func (d *Dao) Versions(c context.Context, svr, env string, state int8) (rs []*model.ReVer, err error)

Versions return versions from mysql

Jump to

Keyboard shortcuts

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