logic

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2019 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Device embedder.Embed
	Serial *model.SerialNum
	Self   *node.Node

	PutWhiteList = map[string]string{"members": ""} // 在白名单的配置外部无法编辑
)

Functions

func ChkLicense

func ChkLicense(cipher string) (lic *model.License, ok bool, msg string)

检查授权码是否合法

func ClientCount

func ClientCount(app string) (count int64, err error)

获取所有Client个数

func DefaultConf

func DefaultConf()

func DelClient

func DelClient(key string, leaseId int64) (err error)

删除Client

func DelConfig

func DelConfig(key string) (err error)

删除配置

func DelLicense

func DelLicense() (err error)

删除license

func GenClearLicense

func GenClearLicense() (text string, err error)

生成注销码

func GetAllClient

func GetAllClient(app string) (all map[string]string, err error)

获取所有Client

func GetAllConfig

func GetAllConfig() (infos map[string]string, err error)

获取所有配置

func GetAllNodes

func GetAllNodes() (nodes map[string]*node.Node)

func GetClearLicense

func GetClearLicense() (info string, err error)

获取注销码

func GetClient

func GetClient(key string) (cli *model.Cli, ok bool)

获取Client

func GetConfig

func GetConfig(key string) (val string, err error)

获取配置

func GetLicense

func GetLicense() (cipher string, err error)

从etcd获取license

func GetSerialNum

func GetSerialNum() (info string, err error)

从etcd获取序列号

func InitEmbed

func InitEmbed() (err error)

func InitStore

func InitStore(ip, port, user, pwd string, timeout time.Duration) (err error)

func KeepAliveClient

func KeepAliveClient(key string, leaseId int64) (err error)

续租

func LoadLic

func LoadLic() *model.License

func MemberConf

func MemberConf()

节点成员列表

func PutClearLicense

func PutClearLicense(info string) (err error)

写入注销码

func PutClient

func PutClient(key string, cli *model.Cli) (lease int64, err error)

写入Client

func PutConfig

func PutConfig(key, info string) (err error)

写入配置

func PutLicense

func PutLicense(val string) (err error)

刷新license

func PutSerialNum

func PutSerialNum(val string) (err error)

写入序列号

func ResetLicense

func ResetLicense() (err error)

重置license

func ResetSerialNum

func ResetSerialNum() (code string, err error)

func StoreLic

func StoreLic(lic *model.License)

func Str2lic

func Str2lic(text string) (lic *model.License, err error)

反序列化license

func WatchLicense

func WatchLicense()

监听license

Types

This section is empty.

Jump to

Keyboard shortcuts

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