internal

package
v0.8.11 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2019 License: Apache-2.0 Imports: 6 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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