internal

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {
	AccountID   string `mapstructure:"account_id"`
	DisplayName string `mapstructure:"display_name"`
	Nickname    string `mapstructure:"nickname"`
	Type        string `mapstructure:"user"`
	UUID        string `mapstructure:"uuid"`
}

type Branch

type Branch struct {
	Name string `mapstructure:"name"`
}

type Client

type Client struct {
	Username string
	Password string
}

func (Client) GetCommits

func (c Client) GetCommits(repoOrga string, repoSlug string, branchOrTag string, include string, exclude string) (*Commits, error)

func (Client) GetDefaultReviewers

func (c Client) GetDefaultReviewers(repoOrga string, repoSlug string) (*DefaultReviewers, error)

func (Client) GetDownloads

func (c Client) GetDownloads(repoOrga string, repoSlug string) (*Downloads, error)

func (Client) GetPrIDBySourceBranch

func (c Client) GetPrIDBySourceBranch(repoOrga string, repoSlug string, sourceBranch string) (*ListPullRequests, error)

func (Client) PrCommits

func (c Client) PrCommits(repoOrga string, repoSlug string, id string) (*Commits, error)

func (Client) PrCreate

func (c Client) PrCreate(repoOrga string, repoSlug string, sourceBranch string, destinationBranch string, title string, body string, reviewers []string) (*PullRequest, error)

func (Client) PrDefaultTitleAndBody

func (c Client) PrDefaultTitleAndBody(repoOrga string, repoSlug string, sourceBranch string, destinationBranch string) (string, string, error)

func (Client) PrList

func (c Client) PrList(repoOrga string, repoSlug string, states []string) (*ListPullRequests, error)

func (Client) PrMerge

func (c Client) PrMerge(repoOrga string, repoSlug string, id string) (*PullRequest, error)

func (Client) PrStatuses

func (c Client) PrStatuses(repoOrga string, repoSlug string, id string) (*Statuses, error)

func (Client) PrView

func (c Client) PrView(repoOrga string, repoSlug string, id string) (*PullRequest, error)

func (Client) RepositoryGet

func (c Client) RepositoryGet(repoOrga string, repoSlug string) (*Repository, error)

func (Client) UploadDownload

func (c Client) UploadDownload(repoOrga string, repoSlug string, fpath string) (*Download, error)

type Commit

type Commit struct {
	Hash       string                 `mapstructure:"hash"`
	Type       string                 `mapstructure:"type"`
	Message    string                 `mapstructure:"message"`
	Parents    []*Commit              `mapstructure:"parents"`
	Repository *Repository            `mapstructure:"repository"`
	Author     map[string]interface{} `mapstructure:"author"`
}

type Commits

type Commits struct {
	Values []*Commit `mapstructure:"values"`
}

type DefaultReviewers

type DefaultReviewers struct {
	PageLen int        `json:"pagelen"`
	Values  []*Account `json:"values"`
	Page    int        `json:"page"`
	Size    int        `json:"size"`
	Next    string     `json:"next"`
}

type Download

type Download struct {
	Name      string          `mapstructure:"name"`
	Links     map[string]Link `mapstructure:"links"`
	Downloads int             `mapstructure:"downloads"`
	CreatedOn string          `mapstructure:"created_on"`
	User      Account         `mapstructure:"user"`
	Type      string          `mapstructure:"type"`
	Size      int             `mapstructure:"size"`
}

type Downloads

type Downloads struct {
	Values []Download `mapstructure:"values"`
}
type Link struct {
	Href string `mapstructure:"href"`
}

type ListPullRequests

type ListPullRequests struct {
	Size     int           `mapstructure:"size"`
	Page     int           `mapstructure:"page"`
	PageLen  int           `mapstructure:"pagelen"`
	Next     string        `mapstructure:"next"`
	Previous string        `mapstructure:"previous"`
	Values   []PullRequest `mapstructure:"values"`
}

type PullRequest

type PullRequest struct {
	ID                int             `mapstructure:"id"`
	Title             string          `mapstructure:"title"`
	State             string          `mapstructure:"state"`
	Source            Resource        `mapstructure:"source"`
	Destination       Resource        `mapstructure:"destination"`
	Type              string          `mapstructure:"type"`
	TaskCount         int             `mapstructure:"task_count"`
	Description       string          `mapstructure:"description"`
	Author            Account         `mapstructure:"author"`
	CloseSourceBranch bool            `mapstructure:"close_source_branch"`
	CommentCount      int             `mapstructure:"comment_count"`
	CreatedOn         string          `mapstructure:"created_on"`
	MergeCommit       Commit          `mapstructure:"merge_commit"`
	Reviewers         []Account       `mapstructure:"reviewers"`
	Links             map[string]Link `mapstructure:"links"`
}

type Repository

type Repository struct {
	Links       map[string]interface{} `mapstructure:"Links"`
	UUID        string                 `mapstructure:"Uuid"`
	FullName    string                 `mapstructure:"FullName"`
	IsPrivate   bool                   `mapstructure:"IsPrivate"`
	Parent      *Repository            `mapstructure:"Parent"`
	Owner       *Account               `mapstructure:"Owner"`
	Name        string                 `mapstructure:"Name"`
	Description string                 `mapstructure:"Description"`
	CreatedOn   time.Time              `mapstructure:"CreatedOn"`
	UpdatedOn   time.Time              `mapstructure:"UpdatedOn"`
	Size        int                    `mapstructure:"Size"`
	Language    string                 `mapstructure:"Language"`
	HasIssues   bool                   `mapstructure:"HasIssues"`
	HasWiki     bool                   `mapstructure:"HasWiki"`
	ForkPolicy  string                 `mapstructure:"ForkPolicy"`
	MainBranch  *Branch                `mapstructure:"Mainbranch"`
}

type Resource

type Resource struct {
	Branch     Branch     `mapstructure:"branch"`
	Commit     Commit     `mapstructure:"commit"`
	Repository Repository `mapstructure:"repository"`
}

type Status

type Status struct {
	Type        string                 `mapstructure:"type"`
	Links       map[string]interface{} `mapstructure:"links"`
	UUID        string                 `mapstructure:"uuid"`
	Key         string                 `mapstructure:"key"`
	Refname     string                 `mapstructure:"refname"`
	URL         string                 `mapstructure:"url"`
	State       string                 `mapstructure:"state"`
	Name        string                 `mapstructure:"name"`
	Description string                 `mapstructure:"description"`
	CreatedOn   string                 `mapstructure:"created_on"`
	UpdatedOn   string                 `mapstructure:"updated_on"`
}

type Statuses

type Statuses struct {
	Size     int      `mapstructure:"size"`
	Page     int      `mapstructure:"page"`
	PageLen  int      `mapstructure:"pagelen"`
	Next     string   `mapstructure:"next"`
	Previous string   `mapstructure:"previous"`
	Values   []Status `mapstructure:"values"`
}

Jump to

Keyboard shortcuts

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