api

package
v3.1.12+incompatible Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2020 License: MIT Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNameAndEmail

func GetNameAndEmail(raw string) (name string, email string)

func Paginate

func Paginate(log hclog.Logger, fn PaginateStartAtFn) error

func PaginateNewerThan

func PaginateNewerThan(log hclog.Logger, lastProcessed time.Time, fn PaginateNewerThanFn) error

func ReposAll

func ReposAll(qc interface{}, teamName string, res chan []commonrepo.Repo) error

func Teams

func Teams(qc QueryContext) (teamNames []string, err error)

func ValidateUser

func ValidateUser(qc QueryContext) (rerr error)

Types

type PageInfo

type PageInfo struct {
	PageSize int64
	NextPage string
	Page     int64
	Total    int
}

func CommitUsersSourcecodePage

func CommitUsersSourcecodePage(qc QueryContext, repo string, params url.Values) (page PageInfo, users []commitusers.CommitUser, err error)

func PullRequestCommentsPage

func PullRequestCommentsPage(
	qc QueryContext,
	repo commonrepo.Repo,
	pr sourcecode.PullRequest,
	params url.Values) (pi PageInfo, res []*sourcecode.PullRequestComment, err error)

func PullRequestCommitsPage

func PullRequestCommitsPage(
	qc QueryContext,
	repo commonrepo.Repo,
	prID string,
	params url.Values) (pi PageInfo, res []*sourcecode.PullRequestCommit, err error)

func PullRequestPage

func PullRequestPage(
	qc QueryContext,
	sender *objsender.Session,
	repoID string,
	repoName string,
	params url.Values,
	stopOnUpdatedAt time.Time) (pi PageInfo, res []sourcecode.PullRequest, err error)

func ReposOnboardPage

func ReposOnboardPage(qc QueryContext, teamName string, params url.Values) (page PageInfo, repos []*agent.RepoResponseRepos, err error)

func ReposPage

func ReposPage(qc QueryContext, teamName string, params url.Values) (page PageInfo, repos []commonrepo.Repo, err error)

func ReposSourcecodePage

func ReposSourcecodePage(qc QueryContext, teamName string, params url.Values, stopOnUpdatedAt time.Time) (page PageInfo, repos []*sourcecode.Repo, err error)

func UsersSourcecodePage

func UsersSourcecodePage(qc QueryContext, group string, params url.Values) (page PageInfo, users []*sourcecode.User, err error)

type PaginateNewerThanFn

type PaginateNewerThanFn func(log hclog.Logger, parameters url.Values, stopOnUpdatedAt time.Time) (PageInfo, error)

type PaginateStartAtFn

type PaginateStartAtFn func(log hclog.Logger, paginationParams url.Values) (page PageInfo, _ error)

type QueryContext

type QueryContext struct {
	BaseURL string
	Logger  hclog.Logger
	Request func(string, url.Values, bool, interface{}) (PageInfo, error)

	CustomerID string
	RefType    string

	IDs ids2.Gen
}

type Requester

type Requester struct {
	// contains filtered or unexported fields
}

func NewRequester

func NewRequester(opts RequesterOpts) *Requester

func (*Requester) Request

func (e *Requester) Request(url string, params url.Values, pageable bool, response interface{}) (pi PageInfo, err error)

Request make request

type RequesterOpts

type RequesterOpts struct {
	Logger     hclog.Logger
	APIURL     string
	Username   string
	Password   string
	UseOAuth   bool
	OAuth      *oauthtoken.Manager
	Agent      rpcdef.Agent
	HTTPClient *http.Client
}

type Response

type Response struct {
	TotalValues int             `json:"size"`
	Page        int64           `json:"page"`
	PageLen     int64           `json:"pagelen"`
	Next        string          `json:"next"`
	Values      json.RawMessage `json:"values"`
}

Jump to

Keyboard shortcuts

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