Documentation ¶
Overview ¶
Package client provides app runtime client code
Client code demo:
//create app status client ctx, cancel := context.WithCancel(context.Background()) defer cancel() cli, err := client.NewClient(ctx, client.AppRuntimeSyncClientConf{ EtcdEndpoints: s.Config.EtcdEndpoint, }) if err != nil { logrus.Errorf("create app status client error, %v", err) return err }
Index ¶
- Constants
- type AppRuntimeSyncClient
- func (a *AppRuntimeSyncClient) CheckStatus(serviceID string)
- func (a *AppRuntimeSyncClient) Error(err error)
- func (a *AppRuntimeSyncClient) GetAllStatus() map[string]string
- func (a *AppRuntimeSyncClient) GetNeedBillingStatus() (map[string]string, error)
- func (a *AppRuntimeSyncClient) GetStatus(serviceID string) string
- func (a *AppRuntimeSyncClient) GetStatuss(serviceIDs string) map[string]string
- func (a *AppRuntimeSyncClient) IgnoreDelete(name string)
- func (a *AppRuntimeSyncClient) IsClosedStatus(curStatus string) bool
- func (a *AppRuntimeSyncClient) RmIgnoreDelete(name string)
- func (a *AppRuntimeSyncClient) SetStatus(serviceID, status string) error
- func (a *AppRuntimeSyncClient) UpdateEndpoints(endpoints ...*config.Endpoint)
- type AppRuntimeSyncClientConf
Constants ¶
View Source
const ( RUNNING string = "running" CLOSED = "closed" STARTING = "starting" STOPPING = "stopping" CHECKING = "checking" //运行异常 ABNORMAL = "abnormal" //升级中 UPGRADE = "upgrade" UNDEPLOY = "undeploy" //构建中 DEPLOYING = "deploying" // UNKNOW = "unknow" )
These are the available operation types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppRuntimeSyncClient ¶
type AppRuntimeSyncClient struct { pb.AppRuntimeSyncClient AppRuntimeSyncClientConf ServerAddress []string // contains filtered or unexported fields }
AppRuntimeSyncClient grpc client
func NewClient ¶
func NewClient(ctx context.Context, conf AppRuntimeSyncClientConf) (*AppRuntimeSyncClient, error)
NewClient new client ctx must be cancel where client not used
func (*AppRuntimeSyncClient) CheckStatus ¶
func (a *AppRuntimeSyncClient) CheckStatus(serviceID string)
CheckStatus CheckStatus
func (*AppRuntimeSyncClient) Error ¶
func (a *AppRuntimeSyncClient) Error(err error)
when watch occurred error,will exec this method
func (*AppRuntimeSyncClient) GetAllStatus ¶
func (a *AppRuntimeSyncClient) GetAllStatus() map[string]string
GetAllStatus get all status
func (*AppRuntimeSyncClient) GetNeedBillingStatus ¶
func (a *AppRuntimeSyncClient) GetNeedBillingStatus() (map[string]string, error)
GetNeedBillingStatus get need billing status
func (*AppRuntimeSyncClient) GetStatus ¶
func (a *AppRuntimeSyncClient) GetStatus(serviceID string) string
GetStatus get status
func (*AppRuntimeSyncClient) GetStatuss ¶
func (a *AppRuntimeSyncClient) GetStatuss(serviceIDs string) map[string]string
GetStatuss get multiple app status
func (*AppRuntimeSyncClient) IgnoreDelete ¶
func (a *AppRuntimeSyncClient) IgnoreDelete(name string)
IgnoreDelete IgnoreDelete
func (*AppRuntimeSyncClient) IsClosedStatus ¶
func (a *AppRuntimeSyncClient) IsClosedStatus(curStatus string) bool
IsClosedStatus check status
func (*AppRuntimeSyncClient) RmIgnoreDelete ¶
func (a *AppRuntimeSyncClient) RmIgnoreDelete(name string)
RmIgnoreDelete RmIgnoreDelete
func (*AppRuntimeSyncClient) SetStatus ¶
func (a *AppRuntimeSyncClient) SetStatus(serviceID, status string) error
SetStatus set app status
func (*AppRuntimeSyncClient) UpdateEndpoints ¶
func (a *AppRuntimeSyncClient) UpdateEndpoints(endpoints ...*config.Endpoint)
UpdateEndpoints update endpoints
type AppRuntimeSyncClientConf ¶
AppRuntimeSyncClientConf client conf
Click to show internal directories.
Click to hide internal directories.