Documentation ¶
Index ¶
- Constants
- Variables
- func PostJSON(uri string, v interface{}, headers ...map[string]string) ([]byte, error)
- type ActionData
- type ActionReq
- type ActionResp
- type ActionType
- type BaseRet
- type Client
- type CreateProjectDataRet
- type CreateProjectReq
- type CreateProjectRet
- type Mac
- type OpsSupervisorExecInfo
- type OpsSupervisorReq
- type OpsSupervisorRet
- type Req
- type Ret
- type RetExecInfo
- type Supervisor
Constants ¶
View Source
const DefaultAPIHost string = "http://www.gitcenter.dev"
DefaultAPIHost 默认API接口地址
Variables ¶
View Source
var ActionMap = map[ActionType]string{ ActionType_StartAction: "start", ActionType_StatusAction: "status", ActionType_StopAction: "stop", ActionType_RelaodAction: "restart", }
Functions ¶
Types ¶
type ActionData ¶
type ActionReq ¶
type ActionReq struct { Aid uint64 AppName string ZoneCode string HostName string Action ActionType }
type ActionResp ¶
type ActionResp struct { Code int64 Msg string Data map[string]*ActionData }
type ActionType ¶
type ActionType int32
const ( ActionType_StatusAction ActionType = 0 ActionType_StartAction ActionType = 1 ActionType_StopAction ActionType = 2 ActionType_RelaodAction ActionType = 3 )
noinspection ALL
type Client ¶
type Client struct { Host string // contains filtered or unexported fields }
func NewOpsClient ¶
func (*Client) CreateProject ¶
func (c *Client) CreateProject(req *CreateProjectReq) (*CreateProjectRet, error)
func (*Client) Supervisor ¶
func (c *Client) Supervisor(req *OpsSupervisorReq) (*OpsSupervisorRet, error)
type CreateProjectDataRet ¶
type CreateProjectReq ¶
type CreateProjectReq struct { ProjectName string `json:"project_name"` DeployPath string `json:"deploy_path"` Username string `json:"username"` Password string `json:"password"` }
func (*CreateProjectReq) ToString ¶
func (t *CreateProjectReq) ToString() string
type CreateProjectRet ¶
type CreateProjectRet struct { BaseRet Data CreateProjectDataRet `json:"data"` }
func (*CreateProjectRet) ToString ¶
func (t *CreateProjectRet) ToString() string
type Mac ¶
func (*Mac) GenarateHeaderMap ¶
type OpsSupervisorExecInfo ¶
type OpsSupervisorReq ¶
type OpsSupervisorRet ¶
type OpsSupervisorRet struct { BaseRet Data map[string]OpsSupervisorExecInfo `json:"data"` }
type Ret ¶
type Ret struct { BaseRet Data map[string]RetExecInfo `json:"data"` }
type RetExecInfo ¶
type Supervisor ¶
type Supervisor struct{}
func NewSupervisor ¶
func NewSupervisor() *Supervisor
func (*Supervisor) DoCtrl ¶
func (s *Supervisor) DoCtrl(action string, supervisorReq Req) (ret *OpsSupervisorRet, err error)
Click to show internal directories.
Click to hide internal directories.