internal

package
v0.8.2 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIClientErr

type APIClientErr struct {
	Message string
	URL     string
	Cause   error
}

func (APIClientErr) Error

func (e APIClientErr) Error() string

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(baseURL, apiPath, token, agent string, client *http.Client) *Client

func (*Client) AddWebhook

func (c *Client) AddWebhook(globalKey, projectName, link string) error

func (*Client) Do

func (c *Client) Do(method, u string, params url.Values) ([]byte, error)

Generic method for requesting Coding OAuth API

func (*Client) Get

func (c *Client) Get(u string, params url.Values) ([]byte, error)

Generic GET for requesting Coding OAuth API

func (*Client) GetCurrentUser

func (c *Client) GetCurrentUser() (*User, error)

func (*Client) GetDepot

func (c *Client) GetDepot(globalKey, projectName string) (*Depot, error)

func (*Client) GetFile

func (c *Client) GetFile(globalKey, projectName, ref, path string) ([]byte, error)

func (*Client) GetProject

func (c *Client) GetProject(globalKey, projectName string) (*Project, error)

func (*Client) GetProjectList

func (c *Client) GetProjectList() ([]*Project, error)

func (*Client) GetWebhooks

func (c *Client) GetWebhooks(globalKey, projectName string) ([]*Webhook, error)

func (*Client) RemoveWebhook

func (c *Client) RemoveWebhook(globalKey, projectName, link string) error

type Commit

type Commit struct {
	File *File `json:"file"`
}

type Depot

type Depot struct {
	DefaultBranch string `json:"default_branch"`
}

type File

type File struct {
	Data string `json:"data"`
}

type GenericAPIResponse

type GenericAPIResponse struct {
	Code int             `json:"code"`
	Data json.RawMessage `json:"data,omitempty"`
}

type Project

type Project struct {
	Owner     string `json:"owner_user_name"`
	Name      string `json:"name"`
	DepotPath string `json:"depot_path"`
	HttpsURL  string `json:"https_url"`
	IsPublic  bool   `json:"is_public"`
	Icon      string `json:"icon"`
	Role      string `json:"current_user_role"`
}

type ProjectListData

type ProjectListData struct {
	Page      int        `json:"page"`
	PageSize  int        `json:"pageSize"`
	TotalPage int        `json:"totalPage"`
	TotalRow  int        `json:"totalRow"`
	List      []*Project `json:"list"`
}

type User

type User struct {
	GlobalKey string `json:"global_key"`
	Email     string `json:"email"`
	Avatar    string `json:"avatar"`
}

type Webhook

type Webhook struct {
	Id      int    `json:"id"`
	HookURL string `json:"hook_url"`
}

Jump to

Keyboard shortcuts

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