internal

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 5 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) GetBranch added in v0.2.0

func (c Client) GetBranch(repoOrga string, repoSlug string, branchName string) (*bitbucket.RepositoryBranch, error)

func (Client) GetCommit added in v0.2.0

func (c Client) GetCommit(repoOrga string, repoSlug string, rev string) (*Commit, error)

func (Client) GetCommits

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

func (Client) GetCurrentUser added in v0.2.0

func (c Client) GetCurrentUser() (*bitbucket.User, 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) GetReadmeContent added in v0.2.0

func (c Client) GetReadmeContent(repoOrga string, repoSlug string, branch string) (string, error)

func (Client) GetWorkspaceMembers added in v0.2.0

func (c Client) GetWorkspaceMembers(workspace string) (*Members, error)

func (Client) PipelineGet added in v0.2.0

func (c Client) PipelineGet(repoOrga string, repoSlug string, idOrUuid string) (*Pipeline, error)

func (Client) PipelineList added in v0.2.0

func (c Client) PipelineList(repoOrga string, repoSlug string) (*[]Pipeline, error)

func (Client) PipelineStepsList added in v0.2.0

func (c Client) PipelineStepsList(repoOrga string, repoSlug, idOrUuid string) (*[]Step, error)

func (Client) PipelinesLogs added in v0.2.0

func (c Client) PipelinesLogs(repoOrga string, repoSlug, idOrUuid string, StepUuid string) (string, error)

func (Client) PrComments added in v0.2.0

func (c Client) PrComments(repoOrga string, repoSlug string, id string) (*Comments, 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) PrThreadedComments added in v0.2.0

func (c Client) PrThreadedComments(repoOrga string, repoSlug string, id string) ([]*Comment, 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 Comment added in v0.2.0

type Comment struct {
	Links       map[string]interface{} `mapstructure:"links"`
	Parent      CommentParent          `mapstructure:"parent"`
	Deleted     bool                   `mapstructure:"deleted"`
	PullRequest PullRequest            `mapstructure:"pullrequest"`
	Content     CommentContent         `mapstructure:"content"`
	CreatedOn   string                 `mapstructure:"created_on"`
	UpdatedOn   string                 `mapstructure:"updated_on"`
	User        Account                `mapstructure:"user"`
	Inline      CommentInline          `mapstructure:"inline"`
	ID          int                    `mapstructure:"id"`
	Type        string                 `mapstructure:"type"`
	Children    []*Comment
}

type CommentContent added in v0.2.0

type CommentContent struct {
	Type   string `mapstructure:"type"`
	Raw    string `mapstructure:"raw"`
	Markup string `mapstructure:"markdown"`
	HTML   string `mapstructure:"html"`
}

type CommentInline added in v0.2.0

type CommentInline struct {
	To   int    `mapstructure:"to"`
	From int    `mapstructure:"from"`
	Path string `mapstructure:"path"`
}

type CommentParent added in v0.2.0

type CommentParent struct {
	ID int `mapstructure:"id"`

	Comment *Comment
	// contains filtered or unexported fields
}

type Comments added in v0.2.0

type Comments struct {
	Values []*Comment `mapstructure:"values"`
}

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 {
	Values []*Account `json:"values"`
}

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 Members added in v0.2.0

type Members struct {
	Values []Account `mapstructure:"values"`
}

type Participant added in v0.2.0

type Participant struct {
	Role           string  `mapstructure:"role"`
	State          string  `mapstructure:"state"`
	ParticipatedOn string  `mapstructure:"participated_on"`
	Type           string  `mapstructure:"type"`
	Approved       bool    `mapstructure:"approved"`
	User           Account `mapstructure:"user"`
}

type Pipeline added in v0.2.0

type Pipeline struct {
	Type              string
	UUID              string        `mapstructure:"uuid"`
	PipelineState     PipelineState `mapstructure:"state"`
	BuildNumber       int           `mapstructure:"build_number"`
	Creator           Account
	CreatedOn         string `mapstructure:"created_on"`
	CompletedOn       string `mapstructure:"completed_on"`
	Target            interface{}
	Trigger           PipelineTrigger
	RunNumber         int  `mapstructure:"run_number"`
	DurationInSeconds int  `mapstructure:"duration_in_seconds"`
	BuildSecondsUsed  int  `mapstructure:"build_seconds_used"`
	FirstSuccessful   bool `mapstructure:"first_successful"`
	Expired           bool
}

type PipelineState added in v0.2.0

type PipelineState struct {
	Name   string
	Type   string
	Result PipelineStateResult
	Stage  PipelineStateResult
}

type PipelineStateResult added in v0.2.0

type PipelineStateResult struct {
	Name string
	Type string
}

type PipelineTrigger added in v0.2.0

type PipelineTrigger struct {
	Name string
	Type string
}

type Project added in v0.2.0

type Project struct {
	Key  string
	Name string
}

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"`
	Participants      []Participant   `mapstructure:"participants"`
	Links             map[string]Link `mapstructure:"links"`
}

type Repository

type Repository struct {
	Links       map[string]interface{} `mapstructure:"Links"`
	UUID        string                 `mapstructure:"Uuid"`
	FullName    string                 `mapstructure:"Full_name"`
	IsPrivate   bool                   `mapstructure:"Is_private"`
	Owner       *Account               `mapstructure:"Owner"`
	Name        string                 `mapstructure:"Name"`
	Description string                 `mapstructure:"Description"`
	Size        int                    `mapstructure:"Size"`
	Language    string                 `mapstructure:"Language"`
	HasIssues   bool                   `mapstructure:"Has_issues"`
	ForkPolicy  string                 `mapstructure:"ForkPolicy"`
	MainBranch  *Branch                `mapstructure:"Mainbranch"`
	Project     Project                `mapstructure:"Project"`
}

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"`
}

type Step added in v0.2.0

type Step struct {
	Name              string        `mapstructure:"name"`
	Pipeline          Pipeline      `mapstructure:"pipeline"`
	State             PipelineState `mapstructure:"state"`
	RunNumber         int           `mapstructure:"run_number"`
	CompletedOn       string        `mapstructure:"completed_on"`
	MaxTime           int           `mapstructure:"maxTime"`
	Image             StepImage     `mapstructure:"image"`
	UUID              string        `mapstructure:"uuid"`
	CreatedOn         string        `mapstructure:"created_on"`
	BuildSecondsUsed  int           `mapstructure:"build_seconds_used"`
	DurationInSeconds int           `mapstructure:"duration_in_seconds"`
	TeardownCommands  []StepCommand `mapstructure:"teardown_commands"`
	ScriptCommands    []StepCommand `mapstructure:"script_commands"`
	SetupCommands     []StepCommand `mapstructure:"setup_commands"`
	Type              string        `mapstructure:"type"`
}

type StepCommand added in v0.2.0

type StepCommand struct {
	Name        string `mapstructure:"name"`
	Command     string `mapstructure:"command"`
	Action      string `mapstructure:"action"`
	CommandType string `mapstructure:"commandType"`
}

type StepImage added in v0.2.0

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

Directories

Path Synopsis
Package run contains code from cli/cli As cli/cli uses an internal package for internal/run/run.go, we need to copy the code from them :( https://github.com/cli/cli/blob/34d549e7b61660c7c993181c0be046d6277cad03/internal/run/run.go
Package run contains code from cli/cli As cli/cli uses an internal package for internal/run/run.go, we need to copy the code from them :( https://github.com/cli/cli/blob/34d549e7b61660c7c993181c0be046d6277cad03/internal/run/run.go

Jump to

Keyboard shortcuts

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