Documentation ¶
Index ¶
- Variables
- type APIError
- type AddSaNsRequestBody
- type CMClient
- func (c *CMClient) Cluster_Create(project_name, cluster_name, description string) (*clusterOne, error)
- func (c *CMClient) Cluster_Delete(project_name, cluster_name string) (*clusterData, error)
- func (c *CMClient) Cluster_GetId(project_name, cluster_name string) (*clusterData, error)
- func (c *CMClient) Cluster_List(project_name, cluster_name string) (*clusterList, error)
- func (c *CMClient) Cluster_Update(cluster_id, project_name, new_cluster_name, new_description string) (*clusterData, error)
- func (c *CMClient) Cluster_label(project_name, label_key, label_value string) (*clusterList, error)
- func (c *CMClient) IsLogged() bool
- func (c *CMClient) Label_Create(project_name, cluster_name, label_key, label_value string) (*labelList, error)
- func (c *CMClient) Label_Delete(project_name, cluster_name, label_key, label_value string) (*labelData, error)
- func (c *CMClient) Label_List(project_name, cluster_name string) (*labelList, error)
- func (c *CMClient) LoginWithToken(BearerAuthToken string) *CMClient
- func (c *CMClient) Project_Create(project_name, description string) (*projectOne, error)
- func (c *CMClient) Project_Delete(project_name string) (*projectData, error)
- func (c *CMClient) Project_GetId(project_name string) (*projectData, error)
- func (c *CMClient) Project_List(project_name string) (*projectList, error)
- func (c *CMClient) Project_Update(project_id, new_project_name, new_description string) (*projectData, error)
- func (c *CMClient) Proxy_Create(image, cluster, gatewayUrl, namespace string) (string, error)
- func (c *CMClient) Sa_AddNs(project_name, cluster_name, sa_name, namespace string) (*saList, error)
- func (c *CMClient) Sa_Create(project_name, cluster_name, sa_name, sa_token, namespace string) (*saList, error)
- func (c *CMClient) Sa_DelNs(project_name, cluster_name, sa_name, namespace string) (*saData, error)
- func (c *CMClient) Sa_Delete(project_name, cluster_name, sa_name string) (*saData, error)
- func (c *CMClient) Sa_GetToken(project_name, cluster_name, ns_name string) (*saData, error)
- func (c *CMClient) Sa_List(project_name, cluster_name, sa_name string) (*saList, error)
- func (c *CMClient) Sa_ListNs(project_name, cluster_name, sa_name string) (*nsList, error)
- func (c *CMClient) Sa_Update(project_name, cluster_name, sa_name, sa_token string) (*saData, error)
- func (c *CMClient) SetDebug(enable bool) *CMClient
- func (c *CMClient) User_Login(username, password string) (*UserData, error)
- func (c *CMClient) User_VerifyToken(token string) (*UserData, error)
- type CluseterLabel
- type CreateClusterRequestBody
- type CreateLabelRequestBody
- type CreateSaRequestBody
- type GlobalRes
- type ProjectRequestBody
- type ProxyRequestBody
- type SaRes
- type UpdateClusterRequestBody
- type UpdateSaRequestBody
- type UserData
Constants ¶
This section is empty.
Variables ¶
var ( ReplicasDefault = 2 DataTunnelCountDefault = 50 RetryIntervalDefault = "5s" )
Functions ¶
This section is empty.
Types ¶
type APIError ¶
type APIError struct { Code int `json:"code"` Data interface{} `json:"data,omitempty"` Msg string `json:"msg"` Errors []struct { Resource string `json:"resource"` Field string `json:"field"` Code string `json:"code"` } `json:"errors,omitempty"` }
APIError represents the error message that GitHub API returns. GitHub API doc: https://docs.github.com/en/rest/overview/resources-in-the-rest-api#client-errors
type AddSaNsRequestBody ¶
type CMClient ¶
type CMClient struct { *req.Client // contains filtered or unexported fields }
GithubClient is the go client for GitHub API.
func NewGithubClient ¶
NewGithubClient create a GitHub client.
func (*CMClient) Cluster_Create ¶
func (c *CMClient) Cluster_Create(project_name, cluster_name, description string) (*clusterOne, error)
Cluster_Create /cluster/create
func (*CMClient) Cluster_Delete ¶
Cluster_Delete /cluster/delete
func (*CMClient) Cluster_GetId ¶
Cluster_GetId /cluster/get_id
func (*CMClient) Cluster_List ¶
Cluster_List /cluster/list
func (*CMClient) Cluster_Update ¶
func (c *CMClient) Cluster_Update(cluster_id, project_name, new_cluster_name, new_description string) (*clusterData, error)
Cluster_Update /cluster/update
func (*CMClient) Cluster_label ¶
Cluster_Label /cluster/label
func (*CMClient) Label_Create ¶
func (c *CMClient) Label_Create(project_name, cluster_name, label_key, label_value string) (*labelList, error)
Label_Create /label/create
func (*CMClient) Label_Delete ¶
func (c *CMClient) Label_Delete(project_name, cluster_name, label_key, label_value string) (*labelData, error)
Label_Delete /label/delete
func (*CMClient) Label_List ¶
Label_List /label/list
func (*CMClient) LoginWithToken ¶
LoginWithToken login with GitHub personal access token.
func (*CMClient) Project_Create ¶
Project_Create /project/create
func (*CMClient) Project_Delete ¶
Project_Delete /project/delete
func (*CMClient) Project_GetId ¶
Project_GetId /project/get_id
func (*CMClient) Project_List ¶
Project_List /project/list
func (*CMClient) Project_Update ¶
func (c *CMClient) Project_Update(project_id, new_project_name, new_description string) (*projectData, error)
Project_Update /project/update
func (*CMClient) Proxy_Create ¶
Proxy_Create /console/proxies
func (*CMClient) Sa_Create ¶
func (c *CMClient) Sa_Create(project_name, cluster_name, sa_name, sa_token, namespace string) (*saList, error)
Sa_Create /sa/create
func (*CMClient) Sa_GetToken ¶
Sa_GetToken /sa/gettoken
func (*CMClient) User_Login ¶
User_Login /user/login
type CluseterLabel ¶
type CreateLabelRequestBody ¶
type CreateSaRequestBody ¶
type ProjectRequestBody ¶
type ProxyRequestBody ¶
type ProxyRequestBody struct { Image string `json:"image"` Cluster string `json:"cluster"` GatewayUrl string `json:"gatewayUrl"` Namespace string `json:"namespace,omitempty"` Replicas int `json:"replicas,omitempty"` RetryInterval string `json:"retryInterval,omitempty"` DataTunnelCount int `json:"dataTunnelCount,omitempty"` }
type UpdateSaRequestBody ¶
type UpdateSaRequestBody struct {
SaToken string `json:"sa_token,omitempty"`
}