Documentation ¶
Index ¶
- Variables
- func ExecCommand(cmd string, args ...string) (lines []string)
- func LicenseInit()
- func Md5Str(str string) string
- func SetEnvInt(env string, value int64) int64
- func SetEnvStr(env string, value string) string
- type LicenseClient
- func (l *LicenseClient) Close()
- func (l *LicenseClient) GetConState() string
- func (l *LicenseClient) GetInstanceLicense() (pb.License_HandleInstanceConnectClient, error)
- func (l *LicenseClient) GetProductLicense() (pb.License_HandleProductConnectClient, error)
- func (l *LicenseClient) GetProductLicenseCount() (*pb.Res, error)
- func (l *LicenseClient) LicenseVerify(data string) (*license.License, error)
- func (l *LicenseClient) Println(title string, err error)
- func (l *LicenseClient) SendProductInstanceInfo(instanceId string, instancePod int32) (*pb.Res, error)
- func (l *LicenseClient) Start(funct func(*LicenseClient))
Constants ¶
This section is empty.
Variables ¶
View Source
var FlagSet = pflag.NewFlagSet("License", pflag.ExitOnError)
Functions ¶
func ExecCommand ¶
func LicenseInit ¶
func LicenseInit()
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时间间隔进行心跳检测,断线自动重连重新执行
Click to show internal directories.
Click to hide internal directories.