Documentation
¶
Index ¶
- type API
- func (api *API) FetchAllRepos(includedByName []string, excludedids []string, includedids []string) (projectids []string, repos []*sourcecode.Repo, err error)
- func (api *API) FetchItemIDs(projid string, fromdate time.Time) ([]string, error)
- func (api *API) FetchProjects(projectsByName []string, excludedids []string, includedids []string) (res []*work.Project, err error)
- func (api *API) FetchPullRequests(ctx *repoprojects.ProjectCtx, repoid string, reponame string, ...) (_ []rpcdef.GitRepoFetchPR, rerr error)
- func (api *API) FetchSourcecodeUsers(projid string, teamids []string, usermap map[string]*sourcecode.User) error
- func (api *API) FetchSprint(projid string, teamid string) (sprints []*work.Sprint, err error)
- func (api *API) FetchTeamIDs(projid string) (ids []string, _ error)
- func (api *API) FetchWorkConfig() (*agent.WorkStatusResponseWorkConfig, error)
- func (api *API) FetchWorkItemsByIDs(projid string, ids []string) ([]WorkItemResponse, []*work.Issue, error)
- func (api *API) FetchWorkUsers(projid string, teamids []string) (users []*work.User, err error)
- func (api *API) GetRequest(endPoint string, params stringmap, out interface{}) error
- type CommitResponse
- type Creds
- type WorkItemResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type API ¶
API the api object for azure/fts
func NewAPI ¶
func NewAPI(ctx context.Context, logger hclog.Logger, concurrency int, customerid, reftype string, creds *Creds, istfs bool) *API
NewAPI initializer
func (*API) FetchAllRepos ¶
func (api *API) FetchAllRepos(includedByName []string, excludedids []string, includedids []string) (projectids []string, repos []*sourcecode.Repo, err error)
FetchAllRepos gets the repos and filters the inclided and excludedids if any passed, and sends them to the repochan channel
func (*API) FetchItemIDs ¶
func (*API) FetchProjects ¶
func (api *API) FetchProjects(projectsByName []string, excludedids []string, includedids []string) (res []*work.Project, err error)
FetchProjects gets the projects and sends them to the projchan channel
func (*API) FetchPullRequests ¶
func (api *API) FetchPullRequests(ctx *repoprojects.ProjectCtx, repoid string, reponame string, repoSender *objsender.Session) (_ []rpcdef.GitRepoFetchPR, rerr error)
FetchPullRequests calls the pull request api and processes the reponse sending each object to the corresponding channel async sourcecode.PullRequest, sourcecode.PullRequestReview, sourcecode.PullRequestComment, and sourcecode.PullRequestCommit
func (*API) FetchSourcecodeUsers ¶
func (api *API) FetchSourcecodeUsers(projid string, teamids []string, usermap map[string]*sourcecode.User) error
FetchSourcecodeUsers gets users from the teams and memembers api, passing in a map to avoid dups
func (*API) FetchSprint ¶
func (*API) FetchTeamIDs ¶
FetchTeamIDs gets the team ids
func (*API) FetchWorkConfig ¶
func (api *API) FetchWorkConfig() (*agent.WorkStatusResponseWorkConfig, error)
func (*API) FetchWorkItemsByIDs ¶
func (api *API) FetchWorkItemsByIDs(projid string, ids []string) ([]WorkItemResponse, []*work.Issue, error)
FetchWorkItemsByIDs used by onboard and export
func (*API) FetchWorkUsers ¶
FetchWorkUsers gets all users from all the teams from a single project
func (*API) GetRequest ¶
type CommitResponse ¶
type CommitResponse struct {
Author struct {
Date time.Time `json:"date"`
Email string `json:"email"`
Name string `json:"name"`
} `json:"author"`
Comment string `json:"comment"`
CommitID string `json:"commitId"`
Committer struct {
Date time.Time `json:"date"`
Email string `json:"email"`
Name string `json:"name"`
} `json:"committer"`
URL string `json:"url"`
RemoteURL string `json:"remoteUrl"`
}
CommitResponse used in src_commit_users.go - FetchLastCommit
type Creds ¶
type Creds struct {
URL string `json:"url"`
CollectionName string `json:"collection_name"`
Organization string `json:"organization"`
Username string `json:"username"`
Password string `json:"password"`
APIKey string `json:"api_key"` // https://your_url/tfs/DefaultCollection/_details/security/tokens
APIVersion string `json:"api_version"` // https://your_url/tfs/DefaultCollection/_details/security/tokens
}
Creds a credentials object, all properties are required
type WorkItemResponse ¶
type WorkItemResponse struct {
Links struct {
HTML struct {
HREF string `json:"href"`
} `json:"html"`
} `json:"_links"`
Fields struct {
AssignedTo usersResponse `json:"System.AssignedTo"`
ChangedDate time.Time `json:"System.ChangedDate"`
CreatedDate time.Time `json:"System.CreatedDate"`
CreatedBy usersResponse `json:"System.CreatedBy"`
Description string `json:"System.Description"`
DueDate time.Time `json:"Microsoft.VSTS.Scheduling.DueDate"` // ??
IterationPath string `json:"System.IterationPath"`
TeamProject string `json:"System.TeamProject"`
Priority int `json:"Microsoft.VSTS.Common.Priority"`
Reason string `json:"System.Reason"`
ResolvedReason string `json:"Microsoft.VSTS.Common.ResolvedReason"`
ResolvedDate time.Time `json:"Microsoft.VSTS.Common.ResolvedDate"`
StoryPoints float64 `json:"Microsoft.VSTS.Scheduling.StoryPoints"`
State string `json:"System.State"`
Tags string `json:"System.Tags"`
Title string `json:"System.Title"`
WorkItemType string `json:"System.WorkItemType"`
} `json:"fields"`
Relations []struct {
Rel string `json:"rel"`
URL string `json:"url"`
} `json:"relations"`
ID int `json:"id"`
URL string `json:"url"`
}
used in work_item.go - FetchWorkItems