client

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: MIT Imports: 7 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 Change added in v0.4.0

type Change struct {
	New string `mapstructure:"new"`
	Old string `mapstructure:"old"`
}

type Client

type Client struct {
	Username string
	Password string
}

func (Client) DiffGet

func (c Client) DiffGet(repoOrga string, repoSlug string, spec string) (string, error)

func (Client) GetBranch

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

func (Client) GetCommit

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

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

func (Client) GetDownloads

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

func (Client) GetEffectiveDefaultReviewers added in v0.6.0

func (c Client) GetEffectiveDefaultReviewers(repoOrga string, repoSlug string) (*EffectiveDefaultReviewers, error)

func (Client) GetPrIDBySourceBranch

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

func (Client) GetReadmeContent

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

func (Client) GetWorkspaceMembers

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

func (Client) GetWorkspaces

func (c Client) GetWorkspaces() (*Workspaces, error)

func (Client) IssuesComment added in v0.4.0

func (c Client) IssuesComment(repoOrga string, repoSlug string, id string, message string) (*IssueComment, error)

func (Client) IssuesCreate added in v0.4.0

func (c Client) IssuesCreate(repoOrga string, repoSlug string, options struct {
	Title       string
	Description string
	Assignee    string
	Kind        string
	Priority    string
	Status      string
	Version     string
	Milestone   string
	Component   string
}) (*Issue, error)

func (Client) IssuesDelete added in v0.4.0

func (c Client) IssuesDelete(repoOrga string, repoSlug string, id string) (interface{}, error)

func (Client) IssuesEdit added in v0.4.0

func (c Client) IssuesEdit(repoOrga string, repoSlug string, id string, options struct {
	Title       string
	Description string
	Assignee    string
	Kind        string
	Priority    string
	Status      string
	Version     string
	Milestone   string
	Component   string
}) (*Issue, error)

func (Client) IssuesList added in v0.4.0

func (c Client) IssuesList(repoOrga string, repoSlug string, states []string, types []string, priorities []string) (*ListIssues, error)

func (Client) IssuesView added in v0.4.0

func (c Client) IssuesView(repoOrga string, repoSlug string, id string) (*Issue, error)

func (Client) IssuesViewChanges added in v0.4.0

func (c Client) IssuesViewChanges(repoOrga string, repoSlug string, id string) (*IssueChanges, error)

func (Client) IssuesViewComments added in v0.4.0

func (c Client) IssuesViewComments(repoOrga string, repoSlug string, id string) (*IssueComments, error)

func (Client) PipelineGet

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

func (Client) PipelineList

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

func (Client) PipelineStepsList

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

func (Client) PipelinesLogs

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

func (Client) PrApprove

func (c Client) PrApprove(repoOrga string, repoSlug string, id string) (*Participant, error)

func (Client) PrComments

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,
	closeBranch bool) (*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) PrMergeWithCloseBranch

func (c Client) PrMergeWithCloseBranch(repoOrga string, repoSlug string, id string, closeBranch bool) (*PullRequest, error)

func (Client) PrRequestChanges

func (c Client) PrRequestChanges(repoOrga string, repoSlug string, id string) (*Participant, error)

func (Client) PrStatuses

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

func (Client) PrThreadedComments

func (c Client) PrThreadedComments(repoOrga string, repoSlug string, id string) ([]*Comment, error)

func (Client) PrUnApprove

func (c Client) PrUnApprove(repoOrga string, repoSlug string, id string) error

func (Client) PrUnRequestChanges

func (c Client) PrUnRequestChanges(repoOrga string, repoSlug string, id string) error

func (Client) PrView

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

func (Client) RepositoriesForWorkspace

func (c Client) RepositoriesForWorkspace(repoOrga string) ([]Repository, 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

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

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

type CommentInline

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

type CommentParent

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

	Comment *Comment
	// contains filtered or unexported fields
}

type Comments

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 Component added in v0.4.0

type Component struct {
	Name  string          `mapstructure:"name"`
	Links map[string]Link `mapstructure:"links"`
}

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 EffectiveDefaultReviewer added in v0.6.0

type EffectiveDefaultReviewer struct {
	Type         string
	ReviewerType string
	User         *Account
}

type EffectiveDefaultReviewers added in v0.6.0

type EffectiveDefaultReviewers struct {
	Values []*EffectiveDefaultReviewer `mapstructure:"EffectiveDefaultReviewers"`
}

type Issue added in v0.4.0

type Issue struct {
	ID         int             `mapstructure:"id"`
	Priority   string          `mapstructure:"priority"`
	Kind       string          `mapstructure:"kind"`
	Type       string          `mapstructure:"type"`
	Repository Repository      `mapstructure:"repository"`
	Links      map[string]Link `mapstructure:"links"`
	Reporter   Account         `mapstructure:"reporter"`
	Title      string          `mapstructure:"title"`
	Component  Component       `mapstructure:"component"`
	Votes      int64           `mapstructure:"votes"`
	Watches    int64           `mapstructure:"watches"`
	Content    CommentContent  `mapstructure:"content"`
	Assignee   Account         `mapstructure:"assignee"`
	State      string          `mapstructure:"state"`
	Version    Version         `mapstructure:"version"`
	CreatedOn  string          `mapstructure:"created_on"`
	EditedOn   string          `mapstructure:"edited_on"`
	UpdatedOn  string          `mapstructure:"edited_on"`
	Milestone  Milestone       `mapstructure:"milestone"`
}

type IssueChange added in v0.4.0

type IssueChange struct {
	ID        int               `mapstructure:"id"`
	Type      string            `mapstructure:"type"`
	Links     map[string]Link   `mapstructure:"links"`
	Issue     Issue             `mapstructure:"issue"`
	CreatedOn string            `mapstructure:"created_on"`
	User      Account           `mapstructure:"user"`
	Changes   map[string]Change `mapstructure:"changes"`
	Message   CommentContent    `mapstructure:"message"`
}

type IssueChanges added in v0.4.0

type IssueChanges struct {
	Values []IssueChange `mapstructure:"values"`
	Size   int           `mapstructure:"size"`
}

type IssueComment added in v0.4.0

type IssueComment struct {
	ID        int             `mapstructure:"id"`
	Type      string          `mapstructure:"type"`
	Links     map[string]Link `mapstructure:"links"`
	Issue     Issue           `mapstructure:"issue"`
	Content   CommentContent  `mapstructure:"content"`
	CreatedOn string          `mapstructure:"created_on"`
	User      Account         `mapstructure:"user"`
	UpdatedOn string          `mapstructure:"edited_on"`
}

type IssueComments added in v0.4.0

type IssueComments struct {
	Values []IssueComment `mapstructure:"values"`
	Size   int            `mapstructure:"size"`
}
type Link struct {
	Href string `mapstructure:"href"`
}

type ListIssues added in v0.4.0

type ListIssues struct {
	Values []Issue `mapstructure:"values"`
	Size   int     `mapstructure:"size"`
}

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

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

type Milestone added in v0.4.0

type Milestone struct {
	Name  string          `mapstructure:"name"`
	Links map[string]Link `mapstructure:"links"`
}

type Participant

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

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

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

type PipelineStateResult

type PipelineStateResult struct {
	Name string
	Type string
}

type PipelineTrigger

type PipelineTrigger struct {
	Name string
	Type string
}

type Project

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

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

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

type StepImage

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

type Version added in v0.4.0

type Version struct {
	Name  string          `mapstructure:"name"`
	Links map[string]Link `mapstructure:"links"`
}

type Workspace

type Workspace struct {
	CreatedOn string                 `mapstructure:"created_on"`
	Links     map[string]interface{} `mapstructure:"links"`
	Name      string                 `mapstructure:"name"`
	Slug      string                 `mapstructure:"slug"`
	IsPrivate bool                   `mapstructure:"is_private"`
	Type      string                 `mapstructure:"type"`
	UUID      string                 `mapstructure:"uuid"`
}

type WorkspaceMembership added in v0.3.1

type WorkspaceMembership struct {
	User      Account   `mapstructure:"user"`
	Workspace Workspace `mapstructure:"workspace"`
}

type Workspaces

type Workspaces struct {
	Workspaces []Workspace `mapstructure:"workspaces"`
}

Jump to

Keyboard shortcuts

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