sdk

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var FlagSet = pflag.NewFlagSet("License", pflag.ExitOnError)

Functions

func ExecCommand

func ExecCommand(cmd string, args ...string) (lines []string)

func LicenseInit

func LicenseInit()

func Md5Str

func Md5Str(str string) string

func SetEnvInt

func SetEnvInt(env string, value int64) int64

func SetEnvStr

func SetEnvStr(env string, value string) string

Types

type LicenseClient

type LicenseClient struct {
	TimeOut time.Duration

	ClientId     string
	ProductId    string
	NodeName     string
	NodeIp       string
	InstanceId   string
	Desc         string
	Licensestate bool
	// contains filtered or unexported fields
}

func NewLicenseClient

func NewLicenseClient() (client *LicenseClient, err error)

获取授权服务客户端

addr grpc服务端地址

timeOut 会话超时时间\断线重连间隔 默认 10秒

func (*LicenseClient) Close

func (l *LicenseClient) Close()

func (*LicenseClient) GetConState

func (l *LicenseClient) GetConState() string

获取连接实时状态

1.IDLE 空闲

2.CONNECTING 连接中

3.TRANSIENT_FAILURE 断线期待恢复

4.READY 就绪

5.SHUTDOWN

6.INVALID_STATE 未知

func (*LicenseClient) GetInstanceLicense

func (l *LicenseClient) GetInstanceLicense() (pb.License_HandleInstanceConnectClient, error)

func (*LicenseClient) GetProductLicense

func (l *LicenseClient) GetProductLicense() (pb.License_HandleProductConnectClient, error)

获取产品类授权

productId 产品ID

func (*LicenseClient) GetProductLicenseCount

func (l *LicenseClient) GetProductLicenseCount() (*pb.Res, error)

获取产品已授权实例数量

func (*LicenseClient) LicenseVerify

func (l *LicenseClient) LicenseVerify(data string) (*license.License, error)

func (*LicenseClient) Println

func (l *LicenseClient) Println(title string, err error)

func (*LicenseClient) SendProductInstanceInfo

func (l *LicenseClient) SendProductInstanceInfo(instanceId string, instancePod int32) (*pb.Res, error)

推送产品实例部署信息

productId 产品ID

instanceId 实例ID

instancePod 实例运行POD数

func (*LicenseClient) Start

func (l *LicenseClient) Start(funct func(*LicenseClient))

开始执行任务 以设置的timeOut时间间隔进行心跳检测,断线自动重连重新执行

Jump to

Keyboard shortcuts

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