Documentation ¶
Index ¶
- type Badge
- type Branch
- type BuildReq
- type Builds
- type Client
- func (c *Client) AddReviewer(pullRequestID int32, reviewer gitclient.IdentityRefWithVote) error
- func (c *Client) AddReviewers(pullRequestID int32, reviewers []gitclient.IdentityRef) error
- func (c *Client) AddThread(pullRequestID int32, comment string) error
- func (c *Client) CommitChanges(changes interface{}, branchName, commitID, changePath, commitMessage string) error
- func (c *Client) CompletePullRequest(pullRequestID int, commitID string, mergeMessage string, bypassPolicy bool, ...) error
- func (c *Client) CreateBranch(newBranchName string, commitID string) error
- func (c *Client) GetBranch(branchName string) (*Ref, error)
- func (c *Client) GetBranches(branchName string) (*Refs, error)
- func (c *Client) GetBuildDefinitions(definitionPath, definitionName string) (*Definitions, error)
- func (c *Client) GetBuilds(buildDefinitionID int) (*Builds, error)
- func (c *Client) GetCommit(commitID string) (*Commit, error)
- func (c *Client) GetCommits(branch string, startTime time.Time, endTime time.Time, versionPath string) (*Commits, error)
- func (c *Client) GetDiffsBetweenBranches(baseBranch string, targetBranch string) (*Diffs, error)
- func (c *Client) GetFileFromRepo(branchName string, filePath string, target interface{}) error
- func (c *Client) GetPullRequests(localVarOptionals *gitclient.GetPullRequestsOpts) ([]gitclient.GitPullRequest, error)
- func (c *Client) GetThreads(pullRequestID int32, localVarOptionals *gitclient.ListPRThreadsOpts) ([]gitclient.GitPullRequestCommentThread, error)
- func (c *Client) PostBuild(buildDefinitionID int, branch string, parameters interface{}) (*PostBuildResponse, error)
- func (c *Client) SubmitPullRequest(targetBranch string, sourceBranch string, title string, description string) error
- type Commit
- type Commits
- type CompletionOptions
- type Config
- type Definition
- type Definitions
- type Diffs
- type LastChangedBy
- type LastMergeSourceCommit
- type PostBuildResponse
- type PostBuildResponseLinks
- type Project
- type PullRequest
- type PullRequests
- type Ref
- type Refs
- type RestClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Branch ¶
type Branch struct { Name string `json:"name"` OldObjectID string `json:"oldObjectId"` NewObjectID string `json:"newObjectId"` }
Branch reference for a branch
type BuildReq ¶
type BuildReq struct { Definition Definition `json:"definition"` SourceBranch string `json:"sourceBranch"` Parameters string `json:"parameters"` }
BuildReq stores is a request for a build
type Builds ¶
type Builds struct { Count int `json:"count"` Value []struct { ID int `json:"id"` URL string `json:"url"` BuildNumber string `json:"buildNumber"` URI string `json:"uri"` SourceBranch string `json:"sourceBranch"` SourceVersion string `json:"sourceVersion"` Status string `json:"status"` QueueTime time.Time `json:"queueTime"` Priority string `json:"priority"` StartTime time.Time `json:"startTime"` FinishTime time.Time `json:"finishTime"` Reason string `json:"reason"` Result string `json:"result"` Parameters string `json:"parameters"` KeepForever bool `json:"keepForever"` } `json:"value"` }
Builds hold multiple builds
type Client ¶
type Client struct { Instance string Project string Repo string APIVersion string RestClient *RestClient // contains filtered or unexported fields }
Client implementation for the vsts client
func (*Client) AddReviewer ¶
func (c *Client) AddReviewer(pullRequestID int32, reviewer gitclient.IdentityRefWithVote) error
AddReviewer Create a comment on the pull request
func (*Client) AddReviewers ¶
func (c *Client) AddReviewers(pullRequestID int32, reviewers []gitclient.IdentityRef) error
AddReviewers Create a comment on the pull request
func (*Client) CommitChanges ¶
func (c *Client) CommitChanges(changes interface{}, branchName, commitID, changePath, commitMessage string) error
CommitChanges commits the staged commits
func (*Client) CompletePullRequest ¶
func (c *Client) CompletePullRequest(pullRequestID int, commitID string, mergeMessage string, bypassPolicy bool, deleteSourceBranch bool) error
CompletePullRequest completes the specified pull request
func (*Client) CreateBranch ¶
CreateBranch creates a new branch
func (*Client) GetBranch ¶
GetBranch returns the matching branch. If there are multiple matching, returns the first
func (*Client) GetBranches ¶
GetBranches returns branches matching a branch name
func (*Client) GetBuildDefinitions ¶
func (c *Client) GetBuildDefinitions(definitionPath, definitionName string) (*Definitions, error)
GetBuildDefinitions returns the matching build definitions
func (*Client) GetCommits ¶
func (c *Client) GetCommits(branch string, startTime time.Time, endTime time.Time, versionPath string) (*Commits, error)
GetCommits retrieves commits for a branch in a specified time range
func (*Client) GetDiffsBetweenBranches ¶
GetDiffsBetweenBranches returns the diffs of two branches
func (*Client) GetFileFromRepo ¶
GetFileFromRepo returns the file at an empty interface
func (*Client) GetPullRequests ¶
func (c *Client) GetPullRequests(localVarOptionals *gitclient.GetPullRequestsOpts) ([]gitclient.GitPullRequest, error)
GetPullRequests returns the pull requests for la specific repository
func (*Client) GetThreads ¶
func (c *Client) GetThreads(pullRequestID int32, localVarOptionals *gitclient.ListPRThreadsOpts) ([]gitclient.GitPullRequestCommentThread, error)
GetThreads lists all the threads on a pull request
type Commit ¶
type Commit struct { CommitID string `json:"commitId"` ChangeCounts struct { Edit int `json:"Edit"` } `json:"changeCounts"` Changes []struct { Item struct { ObjectID string `json:"objectId"` OriginalObjectID string `json:"originalObjectId"` GitObjectType string `json:"gitObjectType"` CommitID string `json:"commitId"` Path string `json:"path"` IsFolder bool `json:"isFolder"` URL string `json:"url"` } `json:"item"` ChangeType string `json:"changeType"` } `json:"changes"` }
Commit holds data about a commit
type Commits ¶
type Commits struct { Count int `json:"count"` Value []struct { CommitID string `json:"commitId"` Comment string `json:"comment"` ChangeCounts struct { Add int `json:"Add"` } `json:"changeCounts"` URL string `json:"url"` RemoteURL string `json:"remoteUrl"` } `json:"value"` }
Commits stores multiple commits and metadata
type CompletionOptions ¶
type CompletionOptions struct { DeleteSourceBranch string `json:"deleteSourceBranch"` MergeCommitMessage string `json:"mergeCommitMessage"` SquashMerge string `json:"squashMerge"` BypassPolicy string `json:"bypassPolicy"` }
CompletionOptions options for completing a pull request
type Config ¶
type Config struct { Token string Username string APIVersion string RepositoryName string Project string Instance string }
Config stores the configurations for the vsts client
type Definition ¶
type Definition struct { Drafts []interface{} `json:"drafts"` ID int `json:"id"` Name string `json:"name"` URL string `json:"url"` URI string `json:"uri"` Path string `json:"path"` Type string `json:"type"` QueueStatus string `json:"queueStatus"` Revision int64 `json:"revision"` Project Project `json:"project"` }
Definition is the build definition
type Definitions ¶
type Definitions struct { Count int `json:"count"` Value []Definition `json:"value"` }
Definitions stores multiple definitions
type Diffs ¶
type Diffs struct { AllChangesIncluded bool `json:"allChangesIncluded"` ChangeCounts struct { Edit int `json:"Edit"` } `json:"changeCounts"` Changes []struct { Item struct { ObjectID string `json:"objectId"` OriginalObjectID string `json:"originalObjectId"` GitObjectType string `json:"gitObjectType"` CommitID string `json:"commitId"` Path string `json:"path"` IsFolder bool `json:"isFolder"` URL string `json:"url"` } `json:"item"` ChangeType string `json:"changeType"` } `json:"changes"` CommonCommit string `json:"commonCommit"` BaseCommit string `json:"baseCommit"` TargetCommit string `json:"targetCommit"` AheadCount int `json:"aheadCount"` BehindCount int `json:"behindCount"` }
Diffs stores the diffs of two branches
type LastChangedBy ¶
type LastChangedBy struct { DisplayName string `json:"displayName"` URL string `json:"url"` Links struct { Avatar Badge `json:"avatar"` } `json:"_links"` ID string `json:"id"` UniqueName string `json:"uniqueName"` ImageURL string `json:"imageUrl"` Descriptor string `json:"descriptor"` }
LastChangedBy shows the last changed by status
type LastMergeSourceCommit ¶
type LastMergeSourceCommit struct {
CommitID string `json:"commitId"`
}
LastMergeSourceCommit commit id of the last merged commit
type PostBuildResponse ¶
type PostBuildResponse struct { Links PostBuildResponseLinks `json:"_links"` Tags []interface{} `json:"tags"` ValidationResults []interface{} `json:"validationResults"` ID int64 `json:"id"` BuildNumber string `json:"buildNumber"` Status string `json:"status"` QueueTime string `json:"queueTime"` URL string `json:"url"` Definition Definition `json:"definition"` Project Project `json:"project"` URI string `json:"uri"` SourceBranch string `json:"sourceBranch"` Priority string `json:"priority"` Reason string `json:"reason"` RequestedFor LastChangedBy `json:"requestedFor"` RequestedBy LastChangedBy `json:"requestedBy"` LastChangedDate string `json:"lastChangedDate"` LastChangedBy LastChangedBy `json:"lastChangedBy"` Parameters string `json:"parameters"` KeepForever bool `json:"keepForever"` RetainedByRelease bool `json:"retainedByRelease"` TriggeredByBuild interface{} `json:"triggeredByBuild"` }
PostBuildResponse holds the api response from posting a new build
type PostBuildResponseLinks ¶
type PostBuildResponseLinks struct { Self Badge `json:"self"` Web Badge `json:"web"` SourceVersionDisplayURI Badge `json:"sourceVersionDisplayUri"` Timeline Badge `json:"timeline"` Badge Badge `json:"badge"` }
PostBuildResponseLinks store all links referenced to a build
type Project ¶
type Project struct { ID string `json:"id"` Name string `json:"name"` Description string `json:"description"` URL string `json:"url"` State string `json:"state"` Revision int64 `json:"revision"` Visibility string `json:"visibility"` }
Project holds info about the current project
type PullRequest ¶
type PullRequest struct { PullRequestID int `json:"pullRequestId"` CodeReviewID int `json:"codeReviewId"` Status string `json:"status"` CreationDate time.Time `json:"creationDate"` Title string `json:"title"` Description string `json:"description"` SourceRefName string `json:"sourceRefName"` TargetRefName string `json:"targetRefName"` MergeStatus string `json:"mergeStatus"` MergeID string `json:"mergeId"` URL string `json:"url"` SupportsIterations bool `json:"supportsIterations"` }
PullRequest reference to a pull request
type PullRequests ¶
type PullRequests struct { Value []PullRequest `json:"value"` Count int `json:"count"` }
PullRequests holds multiple pull requests
type Ref ¶
type Ref struct { Name string `json:"name"` ObjectID string `json:"objectId"` URL string `json:"url"` }
Ref holds the object references
type RestClient ¶ added in v0.0.3
type RestClient struct {
// contains filtered or unexported fields
}
RestClient client to handle auth when calling the azure devops api