Documentation ¶
Index ¶
- func BasicAuthEncode(user, pass string) string
- func ExtractKeysFromMapString(in map[string]VisibleType) (keys []string)
- func Version() string
- type AccessToken
- type AddCollaboratorOption
- type AddOrgMembershipOption
- type AddTimeOption
- type Attachment
- type Branch
- type Client
- func (c *Client) AddCollaborator(user, repo, collaborator string, opt AddCollaboratorOption) error
- func (c *Client) AddEmail(opt CreateEmailOption) ([]*Email, error)
- func (c *Client) AddIssueLabels(owner, repo string, index int64, opt IssueLabelsOption) ([]*Label, error)
- func (c *Client) AddIssueSubscription(owner, repo string, index int64, user string) error
- func (c *Client) AddOrgMembership(org, user string, opt AddOrgMembershipOption) error
- func (c *Client) AddRepoTopic(user, repo, topic string) error
- func (c *Client) AddTeamMember(id int64, user string) error
- func (c *Client) AddTeamRepository(id int64, org, repo string) error
- func (c *Client) AddTime(owner, repo string, index int64, opt AddTimeOption) (*TrackedTime, error)
- func (c *Client) AdminCreateOrg(user string, opt CreateOrgOption) (*Organization, error)
- func (c *Client) AdminCreateRepo(user string, opt CreateRepoOption) (*Repository, error)
- func (c *Client) AdminCreateUser(opt CreateUserOption) (*User, error)
- func (c *Client) AdminCreateUserPublicKey(user string, opt CreateKeyOption) (*PublicKey, error)
- func (c *Client) AdminDeleteUser(user string) error
- func (c *Client) AdminDeleteUserPublicKey(user string, keyID int) error
- func (c *Client) AdminEditUser(user string, opt EditUserOption) error
- func (c *Client) AdminListOrgs() ([]*Organization, error)
- func (c *Client) AdminListUsers() ([]*User, error)
- func (c *Client) CheckRepoWatch(repoUser, repoName string) (bool, error)
- func (c *Client) CheckServerVersionConstraint(constraint string) error
- func (c *Client) ClearIssueLabels(owner, repo string, index int64) error
- func (c *Client) CreateAccessToken(user, pass string, opt CreateAccessTokenOption) (*AccessToken, error)
- func (c *Client) CreateDeployKey(user, repo string, opt CreateKeyOption) (*DeployKey, error)
- func (c *Client) CreateFork(user, repo string, form CreateForkOption) (*Repository, error)
- func (c *Client) CreateGPGKey(opt CreateGPGKeyOption) (*GPGKey, error)
- func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue, error)
- func (c *Client) CreateIssueComment(owner, repo string, index int64, opt CreateIssueCommentOption) (*Comment, error)
- func (c *Client) CreateLabel(owner, repo string, opt CreateLabelOption) (*Label, error)
- func (c *Client) CreateMilestone(owner, repo string, opt CreateMilestoneOption) (*Milestone, error)
- func (c *Client) CreateOrg(opt CreateOrgOption) (*Organization, error)
- func (c *Client) CreateOrgHook(org string, opt CreateHookOption) (*Hook, error)
- func (c *Client) CreateOrgRepo(org string, opt CreateRepoOption) (*Repository, error)
- func (c *Client) CreatePublicKey(opt CreateKeyOption) (*PublicKey, error)
- func (c *Client) CreatePullRequest(owner, repo string, opt CreatePullRequestOption) (*PullRequest, error)
- func (c *Client) CreateRelease(user, repo string, form CreateReleaseOption) (*Release, error)
- func (c *Client) CreateReleaseAttachment(user, repo string, release int64, file io.Reader, filename string) (*Attachment, error)
- func (c *Client) CreateRepo(opt CreateRepoOption) (*Repository, error)
- func (c *Client) CreateRepoHook(user, repo string, opt CreateHookOption) (*Hook, error)
- func (c *Client) CreateStatus(owner, repo, sha string, opts CreateStatusOption) (*Status, error)
- func (c *Client) CreateTeam(org string, opt CreateTeamOption) (*Team, error)
- func (c *Client) DeleteAccessToken(user string, keyID int64) error
- func (c *Client) DeleteCollaborator(user, repo, collaborator string) error
- func (c *Client) DeleteDeployKey(owner, repo string, keyID int64) error
- func (c *Client) DeleteEmail(opt DeleteEmailOption) error
- func (c *Client) DeleteGPGKey(keyID int64) error
- func (c *Client) DeleteIssueComment(owner, repo string, commentID int64) error
- func (c *Client) DeleteIssueCommentReaction(owner, repo string, commentID int64, reaction string) error
- func (c *Client) DeleteIssueLabel(owner, repo string, index, label int64) error
- func (c *Client) DeleteIssueReaction(owner, repo string, index int64, reaction string) error
- func (c *Client) DeleteIssueStopwatch(owner, repo string, index int64) error
- func (c *Client) DeleteIssueSubscription(owner, repo string, index int64, user string) error
- func (c *Client) DeleteLabel(owner, repo string, id int64) error
- func (c *Client) DeleteMilestone(owner, repo string, id int64) error
- func (c *Client) DeleteOrg(orgname string) error
- func (c *Client) DeleteOrgHook(org string, id int64) error
- func (c *Client) DeletePublicKey(keyID int64) error
- func (c *Client) DeleteRelease(user, repo string, id int64) error
- func (c *Client) DeleteReleaseAttachment(user, repo string, release int64, id int64) error
- func (c *Client) DeleteRepo(owner, repo string) error
- func (c *Client) DeleteRepoGitHook(user, repo, id string) error
- func (c *Client) DeleteRepoHook(user, repo string, id int64) error
- func (c *Client) DeleteRepoTopic(user, repo, topic string) error
- func (c *Client) DeleteTeam(id int64) error
- func (c *Client) DeleteTime(owner, repo string, index, timeID int64) error
- func (c *Client) EditIssue(owner, repo string, index int64, opt EditIssueOption) (*Issue, error)
- func (c *Client) EditIssueComment(owner, repo string, commentID int64, opt EditIssueCommentOption) (*Comment, error)
- func (c *Client) EditLabel(owner, repo string, id int64, opt EditLabelOption) (*Label, error)
- func (c *Client) EditMilestone(owner, repo string, id int64, opt EditMilestoneOption) (*Milestone, error)
- func (c *Client) EditOrg(orgname string, opt EditOrgOption) error
- func (c *Client) EditOrgHook(org string, id int64, opt EditHookOption) error
- func (c *Client) EditPullRequest(owner, repo string, index int64, opt EditPullRequestOption) (*PullRequest, error)
- func (c *Client) EditRelease(user, repo string, id int64, form EditReleaseOption) (*Release, error)
- func (c *Client) EditReleaseAttachment(user, repo string, release int64, attachment int64, form EditAttachmentOptions) (*Attachment, error)
- func (c *Client) EditRepo(owner, reponame string, opt EditRepoOption) (*Repository, error)
- func (c *Client) EditRepoGitHook(user, repo, id string, opt EditGitHookOption) error
- func (c *Client) EditRepoHook(user, repo string, id int64, opt EditHookOption) error
- func (c *Client) EditTeam(id int64, opt EditTeamOption) error
- func (c *Client) Follow(target string) error
- func (c *Client) GetBlob(user, repo, sha string) (*GitBlobResponse, error)
- func (c *Client) GetCombinedStatus(owner, repo, sha string) (*CombinedStatus, error)
- func (c *Client) GetDeployKey(user, repo string, keyID int64) (*DeployKey, error)
- func (c *Client) GetFile(user, repo, ref, tree string) ([]byte, error)
- func (c *Client) GetGPGKey(keyID int64) (*GPGKey, error)
- func (c *Client) GetIssue(owner, repo string, index int64) (*Issue, error)
- func (c *Client) GetIssueCommentReactions(owner, repo string, commentID int64) ([]*Reaction, error)
- func (c *Client) GetIssueLabels(owner, repo string, index int64) ([]*Label, error)
- func (c *Client) GetIssueReactions(owner, repo string, index int64) ([]*Reaction, error)
- func (c *Client) GetIssueSubscribers(owner, repo string, index int64) ([]*User, error)
- func (c *Client) GetMilestone(owner, repo string, id int64) (*Milestone, error)
- func (c *Client) GetMyStopwatches() ([]*StopWatch, error)
- func (c *Client) GetMyTrackedTimes() ([]*TrackedTime, error)
- func (c *Client) GetMyUserInfo() (*User, error)
- func (c *Client) GetMyWatchedRepos() ([]*Repository, error)
- func (c *Client) GetOrg(orgname string) (*Organization, error)
- func (c *Client) GetOrgHook(org string, id int64) (*Hook, error)
- func (c *Client) GetPublicKey(keyID int64) (*PublicKey, error)
- func (c *Client) GetPullRequest(owner, repo string, index int64) (*PullRequest, error)
- func (c *Client) GetRelease(user, repo string, id int64) (*Release, error)
- func (c *Client) GetReleaseAttachment(user, repo string, release int64, id int64) (*Attachment, error)
- func (c *Client) GetRepo(owner, reponame string) (*Repository, error)
- func (c *Client) GetRepoBranch(user, repo, branch string) (*Branch, error)
- func (c *Client) GetRepoGitHook(user, repo, id string) (*GitHook, error)
- func (c *Client) GetRepoHook(user, repo string, id int64) (*Hook, error)
- func (c *Client) GetRepoLabel(owner, repo string, id int64) (*Label, error)
- func (c *Client) GetRepoRef(user, repo, ref string) (*Reference, error)
- func (c *Client) GetRepoRefs(user, repo, ref string) ([]*Reference, error)
- func (c *Client) GetRepoTrackedTimes(owner, repo string) ([]*TrackedTime, error)
- func (c *Client) GetSingleCommit(user, repo, commitID string) (*Commit, error)
- func (c *Client) GetTeam(id int64) (*Team, error)
- func (c *Client) GetTeamMember(id int64, user string) (*User, error)
- func (c *Client) GetTrees(user, repo, ref string, recursive bool) (*GitTreeResponse, error)
- func (c *Client) GetUserInfo(user string) (*User, error)
- func (c *Client) GetUserTrackedTimes(owner, repo, user string) ([]*TrackedTime, error)
- func (c *Client) GetWatchedRepos(user string) ([]*Repository, error)
- func (c *Client) IsCollaborator(user, repo, collaborator string) (bool, error)
- func (c *Client) IsFollowing(target string) bool
- func (c *Client) IsPullRequestMerged(owner, repo string, index int64) (bool, error)
- func (c *Client) IsUserFollowing(user, target string) bool
- func (c *Client) IssueSubscribe(owner, repo string, index int64) error
- func (c *Client) IssueUnSubscribe(owner, repo string, index int64) error
- func (c *Client) ListAccessTokens(user, pass string) ([]*AccessToken, error)
- func (c *Client) ListCollaborators(user, repo string) ([]*User, error)
- func (c *Client) ListDeployKeys(user, repo string) ([]*DeployKey, error)
- func (c *Client) ListEmails() ([]*Email, error)
- func (c *Client) ListFollowers(user string, page int) ([]*User, error)
- func (c *Client) ListFollowing(user string, page int) ([]*User, error)
- func (c *Client) ListForks(user, repo string) ([]*Repository, error)
- func (c *Client) ListGPGKeys(user string) ([]*GPGKey, error)
- func (c *Client) ListIssueComments(owner, repo string, index int64) ([]*Comment, error)
- func (c *Client) ListIssues(opt ListIssueOption) ([]*Issue, error)
- func (c *Client) ListMyFollowers(page int) ([]*User, error)
- func (c *Client) ListMyFollowing(page int) ([]*User, error)
- func (c *Client) ListMyGPGKeys() ([]*GPGKey, error)
- func (c *Client) ListMyOrgs() ([]*Organization, error)
- func (c *Client) ListMyPublicKeys() ([]*PublicKey, error)
- func (c *Client) ListMyRepos() ([]*Repository, error)
- func (c *Client) ListMyTeams() ([]*Team, error)
- func (c *Client) ListOrgHooks(org string) ([]*Hook, error)
- func (c *Client) ListOrgRepos(org string) ([]*Repository, error)
- func (c *Client) ListOrgTeams(org string) ([]*Team, error)
- func (c *Client) ListPublicKeys(user string) ([]*PublicKey, error)
- func (c *Client) ListReleaseAttachments(user, repo string, release int64) ([]*Attachment, error)
- func (c *Client) ListReleases(user, repo string) ([]*Release, error)
- func (c *Client) ListRepoBranches(user, repo string) ([]*Branch, error)
- func (c *Client) ListRepoGitHooks(user, repo string) ([]*GitHook, error)
- func (c *Client) ListRepoHooks(user, repo string) ([]*Hook, error)
- func (c *Client) ListRepoIssueComments(owner, repo string) ([]*Comment, error)
- func (c *Client) ListRepoIssues(owner, repo string, opt ListIssueOption) ([]*Issue, error)
- func (c *Client) ListRepoLabels(owner, repo string) ([]*Label, error)
- func (c *Client) ListRepoMilestones(owner, repo string, opt ListMilestoneOption) ([]*Milestone, error)
- func (c *Client) ListRepoPullRequests(owner, repo string, opt ListPullRequestsOptions) ([]*PullRequest, error)
- func (c *Client) ListRepoTags(user, repo string) ([]*Tag, error)
- func (c *Client) ListRepoTopics(user, repo string) (*TopicsList, error)
- func (c *Client) ListStatuses(owner, repo, sha string, opts ListStatusesOption) ([]*Status, error)
- func (c *Client) ListTeamMembers(id int64) ([]*User, error)
- func (c *Client) ListTeamRepositories(id int64) ([]*Repository, error)
- func (c *Client) ListTrackedTimes(owner, repo string, index int64) ([]*TrackedTime, error)
- func (c *Client) ListUserIssues(opt ListIssueOption) ([]*Issue, error)
- func (c *Client) ListUserOrgs(user string) ([]*Organization, error)
- func (c *Client) ListUserRepos(user string) ([]*Repository, error)
- func (c *Client) MergePullRequest(owner, repo string, index int64, opt MergePullRequestOption) (*MergePullRequestResponse, error)
- func (c *Client) MigrateRepo(opt MigrateRepoOption) (*Repository, error)
- func (c *Client) MirrorSync(owner, repo string) error
- func (c *Client) PostIssueCommentReaction(owner, repo string, commentID int64, reaction string) (*Reaction, error)
- func (c *Client) PostIssueReaction(owner, repo string, index int64, reaction string) (*Reaction, error)
- func (c *Client) RemoveTeamMember(id int64, user string) error
- func (c *Client) RemoveTeamRepository(id int64, org, repo string) error
- func (c *Client) ReplaceIssueLabels(owner, repo string, index int64, opt IssueLabelsOption) ([]*Label, error)
- func (c *Client) ResetIssueTime(owner, repo string, index int64) error
- func (c *Client) SearchUsers(query string, limit int) ([]*User, error)
- func (c *Client) ServerVersion() (string, error)
- func (c *Client) SetBasicAuth(username, password string)
- func (c *Client) SetHTTPClient(client *http.Client)
- func (c *Client) SetRepoTopics(user, repo, list TopicsList) error
- func (c *Client) SetSudo(sudo string)
- func (c *Client) StartIssueStopWatch(owner, repo string, index int64) error
- func (c *Client) StopIssueStopWatch(owner, repo string, index int64) error
- func (c *Client) UnWatchRepo(repoUser, repoName string) error
- func (c *Client) Unfollow(target string) error
- func (c *Client) WatchRepo(repoUser, repoName string) error
- type CombinedStatus
- type Comment
- type Commit
- type CommitMeta
- type CommitUser
- type CreateAccessTokenOption
- type CreateEmailOption
- type CreateForkOption
- type CreateGPGKeyOption
- type CreateHookOption
- type CreateIssueCommentOption
- type CreateIssueOption
- type CreateKeyOption
- type CreateLabelOption
- type CreateMilestoneOption
- type CreateOrgOption
- type CreatePullRequestOption
- type CreateReleaseOption
- type CreateRepoOption
- type CreateStatusOption
- type CreateTeamOption
- type CreateUserOption
- type DeleteEmailOption
- type DeployKey
- type EditAttachmentOptions
- type EditGitHookOption
- type EditHookOption
- type EditIssueCommentOption
- type EditIssueOption
- type EditLabelOption
- type EditMilestoneOption
- type EditOrgOption
- type EditPullRequestOption
- type EditReleaseOption
- type EditRepoOption
- type EditTeamOption
- type EditUserOption
- type Email
- type GPGKey
- type GPGKeyEmail
- type GitBlobResponse
- type GitEntry
- type GitHook
- type GitObject
- type GitTreeResponse
- type Hook
- type Identity
- type Issue
- type IssueLabelsOption
- type Label
- type ListIssueOption
- type ListMilestoneOption
- type ListOptions
- type ListPullRequestsOptions
- type ListStatusesOption
- type MergePullRequestOption
- type MergePullRequestResponse
- type MigrateRepoOption
- type Milestone
- type Organization
- type PRBranchInfo
- type PayloadCommit
- type PayloadCommitVerification
- type PayloadUser
- type Permission
- type PublicKey
- type PullRequest
- type PullRequestMeta
- type Reaction
- type Reference
- type Release
- type RepoCommit
- type Repository
- type StateType
- type Status
- type StatusState
- type StopWatch
- type Tag
- type Team
- type TopicsList
- type TrackedTime
- type User
- type VisibleType
- type WatchInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuthEncode ¶
BasicAuthEncode generate base64 of basic auth head
func ExtractKeysFromMapString ¶
func ExtractKeysFromMapString(in map[string]VisibleType) (keys []string)
ExtractKeysFromMapString provides a slice of keys from map
Types ¶
type AccessToken ¶
type AccessToken struct { ID int64 `json:"id"` Name string `json:"name"` Token string `json:"sha1"` TokenLastEight string `json:"token_last_eight"` }
AccessToken represents an API access token.
type AddCollaboratorOption ¶
type AddCollaboratorOption struct {
Permission *string `json:"permission"`
}
AddCollaboratorOption options when adding a user as a collaborator of a repository
type AddOrgMembershipOption ¶
type AddOrgMembershipOption struct {
Role string `json:"role"`
}
AddOrgMembershipOption add user to organization options
type AddTimeOption ¶
type AddTimeOption struct { // time in seconds Time int64 `json:"time" binding:"Required"` // optional Created time.Time `json:"created"` // optional User string `json:"user_name"` }
AddTimeOption options for adding time to an issue
type Attachment ¶
type Attachment struct { ID int64 `json:"id"` Name string `json:"name"` Size int64 `json:"size"` DownloadCount int64 `json:"download_count"` Created time.Time `json:"created_at"` UUID string `json:"uuid"` DownloadURL string `json:"browser_download_url"` }
Attachment a generic attachment
type Branch ¶
type Branch struct { Name string `json:"name"` Commit *PayloadCommit `json:"commit"` }
Branch represents a repository branch
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client represents a Gitea API client.
func NewClientWithHTTP ¶
NewClientWithHTTP creates an API client with a custom http client
func (*Client) AddCollaborator ¶
func (c *Client) AddCollaborator(user, repo, collaborator string, opt AddCollaboratorOption) error
AddCollaborator add some user as a collaborator of a repository
func (*Client) AddEmail ¶
func (c *Client) AddEmail(opt CreateEmailOption) ([]*Email, error)
AddEmail add one email to current user with options
func (*Client) AddIssueLabels ¶
func (c *Client) AddIssueLabels(owner, repo string, index int64, opt IssueLabelsOption) ([]*Label, error)
AddIssueLabels add one or more labels to one issue
func (*Client) AddIssueSubscription ¶
AddIssueSubscription Subscribe user to issue
func (*Client) AddOrgMembership ¶
func (c *Client) AddOrgMembership(org, user string, opt AddOrgMembershipOption) error
AddOrgMembership add some one to an organization's member
func (*Client) AddRepoTopic ¶
AddRepoTopic adds a topic to a repo's topics list
func (*Client) AddTeamMember ¶
AddTeamMember adds a member to a team
func (*Client) AddTeamRepository ¶
AddTeamRepository adds a repository to a team
func (*Client) AddTime ¶
func (c *Client) AddTime(owner, repo string, index int64, opt AddTimeOption) (*TrackedTime, error)
AddTime adds time to issue with the given index
func (*Client) AdminCreateOrg ¶
func (c *Client) AdminCreateOrg(user string, opt CreateOrgOption) (*Organization, error)
AdminCreateOrg create an organization
func (*Client) AdminCreateRepo ¶
func (c *Client) AdminCreateRepo(user string, opt CreateRepoOption) (*Repository, error)
AdminCreateRepo create a repo
func (*Client) AdminCreateUser ¶
func (c *Client) AdminCreateUser(opt CreateUserOption) (*User, error)
AdminCreateUser create a user
func (*Client) AdminCreateUserPublicKey ¶
func (c *Client) AdminCreateUserPublicKey(user string, opt CreateKeyOption) (*PublicKey, error)
AdminCreateUserPublicKey adds a public key for the user
func (*Client) AdminDeleteUser ¶
AdminDeleteUser delete one user according name
func (*Client) AdminDeleteUserPublicKey ¶
AdminDeleteUserPublicKey deletes a user's public key
func (*Client) AdminEditUser ¶
func (c *Client) AdminEditUser(user string, opt EditUserOption) error
AdminEditUser modify user informations
func (*Client) AdminListOrgs ¶
func (c *Client) AdminListOrgs() ([]*Organization, error)
AdminListOrgs lists all orgs
func (*Client) AdminListUsers ¶
AdminListUsers lists all users
func (*Client) CheckRepoWatch ¶
CheckRepoWatch check if the current user is watching a repo
func (*Client) CheckServerVersionConstraint ¶
CheckServerVersionConstraint validates that the login's server satisfies a given version constraint such as ">= 1.11.0+dev"
func (*Client) ClearIssueLabels ¶
ClearIssueLabels delete all the labels of one issue.
func (*Client) CreateAccessToken ¶
func (c *Client) CreateAccessToken(user, pass string, opt CreateAccessTokenOption) (*AccessToken, error)
CreateAccessToken create one access token with options
func (*Client) CreateDeployKey ¶
func (c *Client) CreateDeployKey(user, repo string, opt CreateKeyOption) (*DeployKey, error)
CreateDeployKey options when create one deploy key
func (*Client) CreateFork ¶
func (c *Client) CreateFork(user, repo string, form CreateForkOption) (*Repository, error)
CreateFork create a fork of a repository
func (*Client) CreateGPGKey ¶
func (c *Client) CreateGPGKey(opt CreateGPGKeyOption) (*GPGKey, error)
CreateGPGKey create GPG key with options
func (*Client) CreateIssue ¶
func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue, error)
CreateIssue create a new issue for a given repository
func (*Client) CreateIssueComment ¶
func (c *Client) CreateIssueComment(owner, repo string, index int64, opt CreateIssueCommentOption) (*Comment, error)
CreateIssueComment create comment on an issue.
func (*Client) CreateLabel ¶
func (c *Client) CreateLabel(owner, repo string, opt CreateLabelOption) (*Label, error)
CreateLabel create one label of repository
func (*Client) CreateMilestone ¶
func (c *Client) CreateMilestone(owner, repo string, opt CreateMilestoneOption) (*Milestone, error)
CreateMilestone create one milestone with options
func (*Client) CreateOrg ¶
func (c *Client) CreateOrg(opt CreateOrgOption) (*Organization, error)
CreateOrg creates an organization
func (*Client) CreateOrgHook ¶
func (c *Client) CreateOrgHook(org string, opt CreateHookOption) (*Hook, error)
CreateOrgHook create one hook for an organization, with options
func (*Client) CreateOrgRepo ¶
func (c *Client) CreateOrgRepo(org string, opt CreateRepoOption) (*Repository, error)
CreateOrgRepo creates an organization repository for authenticated user.
func (*Client) CreatePublicKey ¶
func (c *Client) CreatePublicKey(opt CreateKeyOption) (*PublicKey, error)
CreatePublicKey create public key with options
func (*Client) CreatePullRequest ¶
func (c *Client) CreatePullRequest(owner, repo string, opt CreatePullRequestOption) (*PullRequest, error)
CreatePullRequest create pull request with options
func (*Client) CreateRelease ¶
func (c *Client) CreateRelease(user, repo string, form CreateReleaseOption) (*Release, error)
CreateRelease create a release
func (*Client) CreateReleaseAttachment ¶
func (c *Client) CreateReleaseAttachment(user, repo string, release int64, file io.Reader, filename string) (*Attachment, error)
CreateReleaseAttachment creates an attachment for the given release
func (*Client) CreateRepo ¶
func (c *Client) CreateRepo(opt CreateRepoOption) (*Repository, error)
CreateRepo creates a repository for authenticated user.
func (*Client) CreateRepoHook ¶
func (c *Client) CreateRepoHook(user, repo string, opt CreateHookOption) (*Hook, error)
CreateRepoHook create one hook for a repository, with options
func (*Client) CreateStatus ¶
func (c *Client) CreateStatus(owner, repo, sha string, opts CreateStatusOption) (*Status, error)
CreateStatus creates a new Status for a given Commit
POST /repos/:owner/:repo/statuses/:sha
func (*Client) CreateTeam ¶
func (c *Client) CreateTeam(org string, opt CreateTeamOption) (*Team, error)
CreateTeam creates a team for an organization
func (*Client) DeleteAccessToken ¶
DeleteAccessToken delete token with key id
func (*Client) DeleteCollaborator ¶
DeleteCollaborator remove a collaborator from a repository
func (*Client) DeleteDeployKey ¶
DeleteDeployKey delete deploy key with key id
func (*Client) DeleteEmail ¶
func (c *Client) DeleteEmail(opt DeleteEmailOption) error
DeleteEmail delete one email of current users'
func (*Client) DeleteGPGKey ¶
DeleteGPGKey delete GPG key with key id
func (*Client) DeleteIssueComment ¶
DeleteIssueComment deletes an issue comment.
func (*Client) DeleteIssueCommentReaction ¶
func (c *Client) DeleteIssueCommentReaction(owner, repo string, commentID int64, reaction string) error
DeleteIssueCommentReaction remove a reaction from a comment of an issue
func (*Client) DeleteIssueLabel ¶
DeleteIssueLabel delete one label of one issue by issue id and label id TODO: maybe we need delete by label name and issue id
func (*Client) DeleteIssueReaction ¶
DeleteIssueReaction remove a reaction from an issue
func (*Client) DeleteIssueStopwatch ¶
DeleteIssueStopwatch delete / cancel a specific stopwatch
func (*Client) DeleteIssueSubscription ¶
DeleteIssueSubscription unsubscribe user from issue
func (*Client) DeleteLabel ¶
DeleteLabel delete one label of repository by id TODO: maybe we need delete by name
func (*Client) DeleteMilestone ¶
DeleteMilestone delete one milestone by milestone id
func (*Client) DeleteOrgHook ¶
DeleteOrgHook delete one hook from an organization, with hook id
func (*Client) DeletePublicKey ¶
DeletePublicKey delete public key with key id
func (*Client) DeleteRelease ¶
DeleteRelease delete a release from a repository
func (*Client) DeleteReleaseAttachment ¶
DeleteReleaseAttachment deletes the given attachment including the uploaded file
func (*Client) DeleteRepo ¶
DeleteRepo deletes a repository of user or organization.
func (*Client) DeleteRepoGitHook ¶
DeleteRepoGitHook delete one Git hook from a repository
func (*Client) DeleteRepoHook ¶
DeleteRepoHook delete one hook from a repository, with hook id
func (*Client) DeleteRepoTopic ¶
DeleteRepoTopic deletes a topic from repo's topics list
func (*Client) DeleteTeam ¶
DeleteTeam deletes a team of an organization
func (*Client) DeleteTime ¶
DeleteTime delete a specific tracked time by id of a single issue for a given repository
func (*Client) EditIssueComment ¶
func (c *Client) EditIssueComment(owner, repo string, commentID int64, opt EditIssueCommentOption) (*Comment, error)
EditIssueComment edits an issue comment.
func (*Client) EditMilestone ¶
func (c *Client) EditMilestone(owner, repo string, id int64, opt EditMilestoneOption) (*Milestone, error)
EditMilestone modify milestone with options
func (*Client) EditOrg ¶
func (c *Client) EditOrg(orgname string, opt EditOrgOption) error
EditOrg modify one organization via options
func (*Client) EditOrgHook ¶
func (c *Client) EditOrgHook(org string, id int64, opt EditHookOption) error
EditOrgHook modify one hook of an organization, with hook id and options
func (*Client) EditPullRequest ¶
func (c *Client) EditPullRequest(owner, repo string, index int64, opt EditPullRequestOption) (*PullRequest, error)
EditPullRequest modify pull request with PR id and options
func (*Client) EditRelease ¶
EditRelease edit a release
func (*Client) EditReleaseAttachment ¶
func (c *Client) EditReleaseAttachment(user, repo string, release int64, attachment int64, form EditAttachmentOptions) (*Attachment, error)
EditReleaseAttachment updates the given attachment with the given options
func (*Client) EditRepo ¶
func (c *Client) EditRepo(owner, reponame string, opt EditRepoOption) (*Repository, error)
EditRepo edit the properties of a repository
func (*Client) EditRepoGitHook ¶
func (c *Client) EditRepoGitHook(user, repo, id string, opt EditGitHookOption) error
EditRepoGitHook modify one Git hook of a repository
func (*Client) EditRepoHook ¶
func (c *Client) EditRepoHook(user, repo string, id int64, opt EditHookOption) error
EditRepoHook modify one hook of a repository, with hook id and options
func (*Client) EditTeam ¶
func (c *Client) EditTeam(id int64, opt EditTeamOption) error
EditTeam edits a team of an organization
func (*Client) GetBlob ¶
func (c *Client) GetBlob(user, repo, sha string) (*GitBlobResponse, error)
GetBlob get the blob of a repository file
func (*Client) GetCombinedStatus ¶
func (c *Client) GetCombinedStatus(owner, repo, sha string) (*CombinedStatus, error)
GetCombinedStatus returns the CombinedStatus for a given Commit
GET /repos/:owner/:repo/commits/:ref/status
func (*Client) GetDeployKey ¶
GetDeployKey get one deploy key with key id
func (*Client) GetFile ¶
GetFile downloads a file of repository, ref can be branch/tag/commit. e.g.: ref -> master, tree -> macaron.go(no leading slash)
func (*Client) GetIssueCommentReactions ¶
GetIssueCommentReactions get a list of reactions from a comment of an issue
func (*Client) GetIssueLabels ¶
GetIssueLabels get labels of one issue via issue id
func (*Client) GetIssueReactions ¶
GetIssueReactions get a list reactions of an issue
func (*Client) GetIssueSubscribers ¶
GetIssueSubscribers get list of users who subscribed on an issue
func (*Client) GetMilestone ¶
GetMilestone get one milestone by repo name and milestone id
func (*Client) GetMyStopwatches ¶
GetMyStopwatches list all stopwatches
func (*Client) GetMyTrackedTimes ¶
func (c *Client) GetMyTrackedTimes() ([]*TrackedTime, error)
GetMyTrackedTimes list tracked times of the current user
func (*Client) GetMyUserInfo ¶
GetMyUserInfo get user info of current user
func (*Client) GetMyWatchedRepos ¶
func (c *Client) GetMyWatchedRepos() ([]*Repository, error)
GetMyWatchedRepos list repositories watched by the authenticated user
func (*Client) GetOrg ¶
func (c *Client) GetOrg(orgname string) (*Organization, error)
GetOrg get one organization by name
func (*Client) GetOrgHook ¶
GetOrgHook get a hook of an organization
func (*Client) GetPublicKey ¶
GetPublicKey get current user's public key by key id
func (*Client) GetPullRequest ¶
func (c *Client) GetPullRequest(owner, repo string, index int64) (*PullRequest, error)
GetPullRequest get information of one PR
func (*Client) GetRelease ¶
GetRelease get a release of a repository
func (*Client) GetReleaseAttachment ¶
func (c *Client) GetReleaseAttachment(user, repo string, release int64, id int64) (*Attachment, error)
GetReleaseAttachment returns the requested attachment
func (*Client) GetRepo ¶
func (c *Client) GetRepo(owner, reponame string) (*Repository, error)
GetRepo returns information of a repository of given owner.
func (*Client) GetRepoBranch ¶
GetRepoBranch get one branch's information of one repository
func (*Client) GetRepoGitHook ¶
GetRepoGitHook get a Git hook of a repository
func (*Client) GetRepoHook ¶
GetRepoHook get a hook of a repository
func (*Client) GetRepoLabel ¶
GetRepoLabel get one label of repository by repo it TODO: maybe we need get a label by name
func (*Client) GetRepoRef ¶
GetRepoRef get one ref's information of one repository
func (*Client) GetRepoRefs ¶
GetRepoRefs get list of ref's information of one repository
func (*Client) GetRepoTrackedTimes ¶
func (c *Client) GetRepoTrackedTimes(owner, repo string) ([]*TrackedTime, error)
GetRepoTrackedTimes list tracked times of a repository
func (*Client) GetSingleCommit ¶
GetSingleCommit returns a single commit
func (*Client) GetTeamMember ¶
GetTeamMember gets a member of a team
func (*Client) GetTrees ¶
func (c *Client) GetTrees(user, repo, ref string, recursive bool) (*GitTreeResponse, error)
GetTrees downloads a file of repository, ref can be branch/tag/commit. e.g.: ref -> master, tree -> macaron.go(no leading slash)
func (*Client) GetUserInfo ¶
GetUserInfo get user info by user's name
func (*Client) GetUserTrackedTimes ¶
func (c *Client) GetUserTrackedTimes(owner, repo, user string) ([]*TrackedTime, error)
GetUserTrackedTimes list tracked times of a user
func (*Client) GetWatchedRepos ¶
func (c *Client) GetWatchedRepos(user string) ([]*Repository, error)
GetWatchedRepos list all the watched repos of user
func (*Client) IsCollaborator ¶
IsCollaborator check if a user is a collaborator of a repository
func (*Client) IsFollowing ¶
IsFollowing if current user followed the target
func (*Client) IsPullRequestMerged ¶
IsPullRequestMerged test if one PR is merged to one repository
func (*Client) IsUserFollowing ¶
IsUserFollowing if the user followed the target
func (*Client) IssueSubscribe ¶
IssueSubscribe subscribe current user to an issue
func (*Client) IssueUnSubscribe ¶
IssueUnSubscribe unsubscribe current user from an issue
func (*Client) ListAccessTokens ¶
func (c *Client) ListAccessTokens(user, pass string) ([]*AccessToken, error)
ListAccessTokens lista all the access tokens of user
func (*Client) ListCollaborators ¶
ListCollaborators list a repository's collaborators
func (*Client) ListDeployKeys ¶
ListDeployKeys list all the deploy keys of one repository
func (*Client) ListEmails ¶
ListEmails all the email addresses of user
func (*Client) ListFollowers ¶
ListFollowers list all the followers of one user
func (*Client) ListFollowing ¶
ListFollowing list all the users the user followed
func (*Client) ListForks ¶
func (c *Client) ListForks(user, repo string) ([]*Repository, error)
ListForks list a repository's forks
func (*Client) ListGPGKeys ¶
ListGPGKeys list all the GPG keys of the user
func (*Client) ListIssueComments ¶
ListIssueComments list comments on an issue.
func (*Client) ListIssues ¶
func (c *Client) ListIssues(opt ListIssueOption) ([]*Issue, error)
ListIssues returns all issues assigned the authenticated user
func (*Client) ListMyFollowers ¶
ListMyFollowers list all the followers of current user
func (*Client) ListMyFollowing ¶
ListMyFollowing list all the users current user followed
func (*Client) ListMyGPGKeys ¶
ListMyGPGKeys list all the GPG keys of current user
func (*Client) ListMyOrgs ¶
func (c *Client) ListMyOrgs() ([]*Organization, error)
ListMyOrgs list all of current user's organizations
func (*Client) ListMyPublicKeys ¶
ListMyPublicKeys list all the public keys of current user
func (*Client) ListMyRepos ¶
func (c *Client) ListMyRepos() ([]*Repository, error)
ListMyRepos lists all repositories for the authenticated user that has access to.
func (*Client) ListMyTeams ¶
ListMyTeams lists all the teams of the current user
func (*Client) ListOrgHooks ¶
ListOrgHooks list all the hooks of one organization
func (*Client) ListOrgRepos ¶
func (c *Client) ListOrgRepos(org string) ([]*Repository, error)
ListOrgRepos list all repositories of one organization by organization's name
func (*Client) ListOrgTeams ¶
ListOrgTeams lists all teams of an organization
func (*Client) ListPublicKeys ¶
ListPublicKeys list all the public keys of the user
func (*Client) ListReleaseAttachments ¶
func (c *Client) ListReleaseAttachments(user, repo string, release int64) ([]*Attachment, error)
ListReleaseAttachments list release's attachments
func (*Client) ListReleases ¶
ListReleases list releases of a repository
func (*Client) ListRepoBranches ¶
ListRepoBranches list all the branches of one repository
func (*Client) ListRepoGitHooks ¶
ListRepoGitHooks list all the Git hooks of one repository
func (*Client) ListRepoHooks ¶
ListRepoHooks list all the hooks of one repository
func (*Client) ListRepoIssueComments ¶
ListRepoIssueComments list comments for a given repo.
func (*Client) ListRepoIssues ¶
func (c *Client) ListRepoIssues(owner, repo string, opt ListIssueOption) ([]*Issue, error)
ListRepoIssues returns all issues for a given repository
func (*Client) ListRepoLabels ¶
ListRepoLabels list labels of one repository
func (*Client) ListRepoMilestones ¶
func (c *Client) ListRepoMilestones(owner, repo string, opt ListMilestoneOption) ([]*Milestone, error)
ListRepoMilestones list all the milestones of one repository
func (*Client) ListRepoPullRequests ¶
func (c *Client) ListRepoPullRequests(owner, repo string, opt ListPullRequestsOptions) ([]*PullRequest, error)
ListRepoPullRequests list PRs of one repository
func (*Client) ListRepoTags ¶
ListRepoTags list all the branches of one repository
func (*Client) ListRepoTopics ¶
func (c *Client) ListRepoTopics(user, repo string) (*TopicsList, error)
ListRepoTopics list all repository's topics
func (*Client) ListStatuses ¶
func (c *Client) ListStatuses(owner, repo, sha string, opts ListStatusesOption) ([]*Status, error)
ListStatuses returns all statuses for a given Commit
GET /repos/:owner/:repo/commits/:ref/statuses
func (*Client) ListTeamMembers ¶
ListTeamMembers lists all members of a team
func (*Client) ListTeamRepositories ¶
func (c *Client) ListTeamRepositories(id int64) ([]*Repository, error)
ListTeamRepositories lists all repositories of a team
func (*Client) ListTrackedTimes ¶
func (c *Client) ListTrackedTimes(owner, repo string, index int64) ([]*TrackedTime, error)
ListTrackedTimes list tracked times of a single issue for a given repository
func (*Client) ListUserIssues ¶
func (c *Client) ListUserIssues(opt ListIssueOption) ([]*Issue, error)
ListUserIssues returns all issues assigned to the authenticated user
func (*Client) ListUserOrgs ¶
func (c *Client) ListUserOrgs(user string) ([]*Organization, error)
ListUserOrgs list all of some user's organizations
func (*Client) ListUserRepos ¶
func (c *Client) ListUserRepos(user string) ([]*Repository, error)
ListUserRepos list all repositories of one user by user's name
func (*Client) MergePullRequest ¶
func (c *Client) MergePullRequest(owner, repo string, index int64, opt MergePullRequestOption) (*MergePullRequestResponse, error)
MergePullRequest merge a PR to repository by PR id
func (*Client) MigrateRepo ¶
func (c *Client) MigrateRepo(opt MigrateRepoOption) (*Repository, error)
MigrateRepo migrates a repository from other Git hosting sources for the authenticated user.
To migrate a repository for a organization, the authenticated user must be a owner of the specified organization.
func (*Client) MirrorSync ¶
MirrorSync adds a mirrored repository to the mirror sync queue.
func (*Client) PostIssueCommentReaction ¶
func (c *Client) PostIssueCommentReaction(owner, repo string, commentID int64, reaction string) (*Reaction, error)
PostIssueCommentReaction add a reaction to a comment of an issue
func (*Client) PostIssueReaction ¶
func (c *Client) PostIssueReaction(owner, repo string, index int64, reaction string) (*Reaction, error)
PostIssueReaction add a reaction to an issue
func (*Client) RemoveTeamMember ¶
RemoveTeamMember removes a member from a team
func (*Client) RemoveTeamRepository ¶
RemoveTeamRepository removes a repository from a team
func (*Client) ReplaceIssueLabels ¶
func (c *Client) ReplaceIssueLabels(owner, repo string, index int64, opt IssueLabelsOption) ([]*Label, error)
ReplaceIssueLabels replace old labels of issue with new labels
func (*Client) ResetIssueTime ¶
ResetIssueTime reset tracked time of a single issue for a given repository
func (*Client) SearchUsers ¶
SearchUsers finds users by query
func (*Client) ServerVersion ¶
ServerVersion returns the version of the server
func (*Client) SetBasicAuth ¶
SetBasicAuth sets basicauth
func (*Client) SetHTTPClient ¶
SetHTTPClient replaces default http.Client with user given one.
func (*Client) SetRepoTopics ¶
func (c *Client) SetRepoTopics(user, repo, list TopicsList) error
SetRepoTopics replaces the list of repo's topics
func (*Client) StartIssueStopWatch ¶
StartIssueStopWatch starts a stopwatch for an existing issue for a given repository
func (*Client) StopIssueStopWatch ¶
StopIssueStopWatch stops an existing stopwatch for an issue in a given repository
func (*Client) UnWatchRepo ¶
UnWatchRepo stop to watch a repository
type CombinedStatus ¶
type CombinedStatus struct { State StatusState `json:"state"` SHA string `json:"sha"` TotalCount int `json:"total_count"` Statuses []*Status `json:"statuses"` Repository *Repository `json:"repository"` CommitURL string `json:"commit_url"` URL string `json:"url"` }
CombinedStatus holds the combined state of several statuses for a single commit
type Comment ¶
type Comment struct { ID int64 `json:"id"` HTMLURL string `json:"html_url"` PRURL string `json:"pull_request_url"` IssueURL string `json:"issue_url"` Poster *User `json:"user"` OriginalAuthor string `json:"original_author"` OriginalAuthorID int64 `json:"original_author_id"` Body string `json:"body"` Created time.Time `json:"created_at"` Updated time.Time `json:"updated_at"` }
Comment represents a comment on a commit or issue
type Commit ¶
type Commit struct { *CommitMeta HTMLURL string `json:"html_url"` RepoCommit *RepoCommit `json:"commit"` Author *User `json:"author"` Committer *User `json:"committer"` Parents []*CommitMeta `json:"parents"` }
Commit contains information generated from a Git commit.
type CommitMeta ¶
CommitMeta contains meta information of a commit in terms of API.
type CommitUser ¶
CommitUser contains information of a user in the context of a commit.
type CreateAccessTokenOption ¶
type CreateAccessTokenOption struct {
Name string `json:"name"`
}
CreateAccessTokenOption options when create access token
type CreateEmailOption ¶
type CreateEmailOption struct { // email addresses to add Emails []string `json:"emails"` }
CreateEmailOption options when creating email addresses
type CreateForkOption ¶
type CreateForkOption struct { // organization name, if forking into an organization Organization *string `json:"organization"` }
CreateForkOption options for creating a fork
type CreateGPGKeyOption ¶
type CreateGPGKeyOption struct { // An armored GPG key to add // ArmoredKey string `json:"armored_public_key"` }
CreateGPGKeyOption options create user GPG key
type CreateHookOption ¶
type CreateHookOption struct { Type string `json:"type"` Config map[string]string `json:"config"` Events []string `json:"events"` BranchFilter string `json:"branch_filter"` Active bool `json:"active"` }
CreateHookOption options when create a hook
type CreateIssueCommentOption ¶
type CreateIssueCommentOption struct {
Body string `json:"body"`
}
CreateIssueCommentOption options for creating a comment on an issue
type CreateIssueOption ¶
type CreateIssueOption struct { Title string `json:"title"` Body string `json:"body"` // username of assignee Assignee string `json:"assignee"` Assignees []string `json:"assignees"` Deadline *time.Time `json:"due_date"` // milestone id Milestone int64 `json:"milestone"` // list of label ids Labels []int64 `json:"labels"` Closed bool `json:"closed"` }
CreateIssueOption options to create one issue
type CreateKeyOption ¶
type CreateKeyOption struct { // Title of the key to add Title string `json:"title"` // An armored SSH key to add Key string `json:"key"` // Describe if the key has only read access or read/write ReadOnly bool `json:"read_only"` }
CreateKeyOption options when creating a key
type CreateLabelOption ¶
type CreateLabelOption struct { Name string `json:"name"` // example: #00aabb Color string `json:"color"` Description string `json:"description"` }
CreateLabelOption options for creating a label
type CreateMilestoneOption ¶
type CreateMilestoneOption struct { Title string `json:"title"` Description string `json:"description"` Deadline *time.Time `json:"due_on"` }
CreateMilestoneOption options for creating a milestone
type CreateOrgOption ¶
type CreateOrgOption struct { UserName string `json:"username"` FullName string `json:"full_name"` Description string `json:"description"` Website string `json:"website"` Location string `json:"location"` // possible values are `public` (default), `limited` or `private` // enum: public,limited,private Visibility string `json:"visibility"` }
CreateOrgOption options for creating an organization
type CreatePullRequestOption ¶
type CreatePullRequestOption struct { Head string `json:"head"` Base string `json:"base"` Title string `json:"title"` Body string `json:"body"` Assignee string `json:"assignee"` Assignees []string `json:"assignees"` Milestone int64 `json:"milestone"` Labels []int64 `json:"labels"` Deadline *time.Time `json:"due_date"` }
CreatePullRequestOption options when creating a pull request
type CreateReleaseOption ¶
type CreateReleaseOption struct { TagName string `json:"tag_name"` Target string `json:"target_commitish"` Title string `json:"name"` Note string `json:"body"` IsDraft bool `json:"draft"` IsPrerelease bool `json:"prerelease"` }
CreateReleaseOption options when creating a release
type CreateRepoOption ¶
type CreateRepoOption struct { // Name of the repository to create // Name string `json:"name"` // Description of the repository to create Description string `json:"description"` // Whether the repository is private Private bool `json:"private"` // Issue Label set to use IssueLabels string `json:"issue_labels"` // Whether the repository should be auto-intialized? AutoInit bool `json:"auto_init"` // Gitignores to use Gitignores string `json:"gitignores"` // License to use License string `json:"license"` // Readme of the repository to create Readme string `json:"readme"` }
CreateRepoOption options when creating repository
type CreateStatusOption ¶
type CreateStatusOption struct { State StatusState `json:"state"` TargetURL string `json:"target_url"` Description string `json:"description"` Context string `json:"context"` }
CreateStatusOption holds the information needed to create a new Status for a Commit
type CreateTeamOption ¶
type CreateTeamOption struct { Name string `json:"name"` Description string `json:"description"` // enum: read,write,admin Permission string `json:"permission"` // example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.ext_wiki"] Units []string `json:"units"` }
CreateTeamOption options for creating a team
type CreateUserOption ¶
type CreateUserOption struct { SourceID int64 `json:"source_id"` LoginName string `json:"login_name"` Username string `json:"username"` FullName string `json:"full_name"` Email string `json:"email"` Password string `json:"password"` MustChangePassword *bool `json:"must_change_password"` SendNotify bool `json:"send_notify"` }
CreateUserOption create user options
type DeleteEmailOption ¶
type DeleteEmailOption struct { // email addresses to delete Emails []string `json:"emails"` }
DeleteEmailOption options when deleting email addresses
type DeployKey ¶
type DeployKey struct { ID int64 `json:"id"` KeyID int64 `json:"key_id"` Key string `json:"key"` URL string `json:"url"` Title string `json:"title"` Fingerprint string `json:"fingerprint"` Created time.Time `json:"created_at"` ReadOnly bool `json:"read_only"` Repository *Repository `json:"repository,omitempty"` }
DeployKey a deploy key
type EditAttachmentOptions ¶
type EditAttachmentOptions struct {
Name string `json:"name"`
}
EditAttachmentOptions options for editing attachments
type EditGitHookOption ¶
type EditGitHookOption struct {
Content string `json:"content"`
}
EditGitHookOption options when modifying one Git hook
type EditHookOption ¶
type EditHookOption struct { Config map[string]string `json:"config"` Events []string `json:"events"` BranchFilter string `json:"branch_filter"` Active *bool `json:"active"` }
EditHookOption options when modify one hook
type EditIssueCommentOption ¶
type EditIssueCommentOption struct {
Body string `json:"body"`
}
EditIssueCommentOption options for editing a comment
type EditIssueOption ¶
type EditIssueOption struct { Title string `json:"title"` Body *string `json:"body"` Assignee *string `json:"assignee"` Assignees []string `json:"assignees"` Milestone *int64 `json:"milestone"` State *string `json:"state"` Deadline *time.Time `json:"due_date"` }
EditIssueOption options for editing an issue
type EditLabelOption ¶
type EditLabelOption struct { Name *string `json:"name"` Color *string `json:"color"` Description *string `json:"description"` }
EditLabelOption options for editing a label
type EditMilestoneOption ¶
type EditMilestoneOption struct { Title string `json:"title"` Description *string `json:"description"` State *string `json:"state"` Deadline *time.Time `json:"due_on"` }
EditMilestoneOption options for editing a milestone
type EditOrgOption ¶
type EditOrgOption struct { FullName string `json:"full_name"` Description string `json:"description"` Website string `json:"website"` Location string `json:"location"` // possible values are `public`, `limited` or `private` // enum: public,limited,private Visibility string `json:"visibility"` }
EditOrgOption options for editing an organization
type EditPullRequestOption ¶
type EditPullRequestOption struct { Title string `json:"title"` Body string `json:"body"` Assignee string `json:"assignee"` Assignees []string `json:"assignees"` Milestone int64 `json:"milestone"` Labels []int64 `json:"labels"` State *string `json:"state"` Deadline *time.Time `json:"due_date"` }
EditPullRequestOption options when modify pull request
type EditReleaseOption ¶
type EditReleaseOption struct { TagName string `json:"tag_name"` Target string `json:"target_commitish"` Title string `json:"name"` Note string `json:"body"` IsDraft *bool `json:"draft"` IsPrerelease *bool `json:"prerelease"` }
EditReleaseOption options when editing a release
type EditRepoOption ¶
type EditRepoOption struct { // name of the repository Name *string `json:"name,omitempty"` // a short description of the repository. Description *string `json:"description,omitempty"` // a URL with more information about the repository. Website *string `json:"website,omitempty"` // either `true` to make the repository private or `false` to make it public. // Note: you will get a 422 error if the organization restricts changing repository visibility to organization // owners and a non-owner tries to change the value of private. Private *bool `json:"private,omitempty"` // either `true` to enable issues for this repository or `false` to disable them. HasIssues *bool `json:"has_issues,omitempty"` // either `true` to enable the wiki for this repository or `false` to disable it. HasWiki *bool `json:"has_wiki,omitempty"` // sets the default branch for this repository. DefaultBranch *string `json:"default_branch,omitempty"` // either `true` to allow pull requests, or `false` to prevent pull request. HasPullRequests *bool `json:"has_pull_requests,omitempty"` // either `true` to ignore whitespace for conflicts, or `false` to not ignore whitespace. `has_pull_requests` must be `true`. IgnoreWhitespaceConflicts *bool `json:"ignore_whitespace_conflicts,omitempty"` // either `true` to allow merging pull requests with a merge commit, or `false` to prevent merging pull requests with merge commits. `has_pull_requests` must be `true`. AllowMerge *bool `json:"allow_merge_commits,omitempty"` // either `true` to allow rebase-merging pull requests, or `false` to prevent rebase-merging. `has_pull_requests` must be `true`. AllowRebase *bool `json:"allow_rebase,omitempty"` // either `true` to allow rebase with explicit merge commits (--no-ff), or `false` to prevent rebase with explicit merge commits. `has_pull_requests` must be `true`. AllowRebaseMerge *bool `json:"allow_rebase_explicit,omitempty"` // either `true` to allow squash-merging pull requests, or `false` to prevent squash-merging. `has_pull_requests` must be `true`. AllowSquash *bool `json:"allow_squash_merge,omitempty"` // set to `true` to archive this repository. Archived *bool `json:"archived,omitempty"` }
EditRepoOption options when editing a repository's properties
type EditTeamOption ¶
type EditTeamOption struct { Name string `json:"name"` Description string `json:"description"` // enum: read,write,admin Permission string `json:"permission"` // example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.ext_wiki"] Units []string `json:"units"` }
EditTeamOption options for editing a team
type EditUserOption ¶
type EditUserOption struct { SourceID int64 `json:"source_id"` LoginName string `json:"login_name"` FullName string `json:"full_name"` Email string `json:"email"` Password string `json:"password"` MustChangePassword *bool `json:"must_change_password"` Website string `json:"website"` Location string `json:"location"` Active *bool `json:"active"` Admin *bool `json:"admin"` AllowGitHook *bool `json:"allow_git_hook"` AllowImportLocal *bool `json:"allow_import_local"` MaxRepoCreation *int `json:"max_repo_creation"` ProhibitLogin *bool `json:"prohibit_login"` AllowCreateOrganization *bool `json:"allow_create_organization"` }
EditUserOption edit user options
type Email ¶
type Email struct { Email string `json:"email"` Verified bool `json:"verified"` Primary bool `json:"primary"` }
Email an email address belonging to a user
type GPGKey ¶
type GPGKey struct { ID int64 `json:"id"` PrimaryKeyID string `json:"primary_key_id"` KeyID string `json:"key_id"` PublicKey string `json:"public_key"` Emails []*GPGKeyEmail `json:"emails"` SubsKey []*GPGKey `json:"subkeys"` CanSign bool `json:"can_sign"` CanEncryptComms bool `json:"can_encrypt_comms"` CanEncryptStorage bool `json:"can_encrypt_storage"` CanCertify bool `json:"can_certify"` Created time.Time `json:"created_at,omitempty"` Expires time.Time `json:"expires_at,omitempty"` }
GPGKey a user GPG key to sign commit and tag in repository
type GPGKeyEmail ¶
GPGKeyEmail an email attached to a GPGKey
type GitBlobResponse ¶
type GitBlobResponse struct { Content string `json:"content"` Encoding string `json:"encoding"` URL string `json:"url"` SHA string `json:"sha"` Size int64 `json:"size"` }
GitBlobResponse represents a git blob
type GitEntry ¶
type GitEntry struct { Path string `json:"path"` Mode string `json:"mode"` Type string `json:"type"` Size int64 `json:"size"` SHA string `json:"sha"` URL string `json:"url"` }
GitEntry represents a git tree
type GitHook ¶
type GitHook struct { Name string `json:"name"` IsActive bool `json:"is_active"` Content string `json:"content,omitempty"` }
GitHook represents a Git repository hook
type GitTreeResponse ¶
type GitTreeResponse struct { SHA string `json:"sha"` URL string `json:"url"` Entries []GitEntry `json:"tree"` Truncated bool `json:"truncated"` Page int `json:"page"` TotalCount int `json:"total_count"` }
GitTreeResponse returns a git tree
type Hook ¶
type Hook struct { ID int64 `json:"id"` Type string `json:"type"` URL string `json:"-"` Config map[string]string `json:"config"` Events []string `json:"events"` Active bool `json:"active"` Updated time.Time `json:"updated_at"` Created time.Time `json:"created_at"` }
Hook a hook is a web hook when one repository changed
type Issue ¶
type Issue struct { ID int64 `json:"id"` URL string `json:"url"` Index int64 `json:"number"` Poster *User `json:"user"` OriginalAuthor string `json:"original_author"` OriginalAuthorID int64 `json:"original_author_id"` Title string `json:"title"` Body string `json:"body"` Labels []*Label `json:"labels"` Milestone *Milestone `json:"milestone"` Assignee *User `json:"assignee"` Assignees []*User `json:"assignees"` // Whether the issue is open or closed State StateType `json:"state"` Comments int `json:"comments"` Created time.Time `json:"created_at"` Updated time.Time `json:"updated_at"` Closed *time.Time `json:"closed_at"` Deadline *time.Time `json:"due_date"` PullRequest *PullRequestMeta `json:"pull_request"` }
Issue represents an issue in a repository
type IssueLabelsOption ¶
type IssueLabelsOption struct { // list of label IDs Labels []int64 `json:"labels"` }
IssueLabelsOption a collection of labels
type Label ¶
type Label struct { ID int64 `json:"id"` Name string `json:"name"` // example: 00aabb Color string `json:"color"` Description string `json:"description"` URL string `json:"url"` }
Label a label to an issue or a pr
type ListIssueOption ¶
type ListIssueOption struct { Page int // open, closed, all State string Labels []string KeyWord string }
ListIssueOption list issue options
func (*ListIssueOption) QueryEncode ¶
func (opt *ListIssueOption) QueryEncode() string
QueryEncode turns options into querystring argument
type ListMilestoneOption ¶
type ListMilestoneOption struct { ListOptions // open, closed, all State StateType }
ListMilestoneOption list milestone options
func (*ListMilestoneOption) QueryEncode ¶
func (opt *ListMilestoneOption) QueryEncode() string
QueryEncode turns options into querystring argument
type ListOptions ¶
ListOptions options for using Gitea's API pagination
type ListPullRequestsOptions ¶
type ListPullRequestsOptions struct { Page int `json:"page"` // open, closed, all State string `json:"state"` // oldest, recentupdate, leastupdate, mostcomment, leastcomment, priority Sort string `json:"sort"` Milestone int64 `json:"milestone"` }
ListPullRequestsOptions options for listing pull requests
type ListStatusesOption ¶
type ListStatusesOption struct {
Page int
}
ListStatusesOption holds pagination information
type MergePullRequestOption ¶
type MergePullRequestOption struct { // required: true // enum: merge,rebase,rebase-merge,squash Do string `json:"Do" binding:"Required;In(merge,rebase,rebase-merge,squash)"` MergeTitleField string `json:"MergeTitleField"` MergeMessageField string `json:"MergeMessageField"` }
MergePullRequestOption options when merging a pull request
type MergePullRequestResponse ¶
type MergePullRequestResponse struct { }
MergePullRequestResponse response when merging a pull request
type MigrateRepoOption ¶
type MigrateRepoOption struct { CloneAddr string `json:"clone_addr"` AuthUsername string `json:"auth_username"` AuthPassword string `json:"auth_password"` UID int `json:"uid"` RepoName string `json:"repo_name"` Mirror bool `json:"mirror"` Private bool `json:"private"` Description string `json:"description"` }
MigrateRepoOption options for migrating a repository from an external service
type Milestone ¶
type Milestone struct { ID int64 `json:"id"` Title string `json:"title"` Description string `json:"description"` State StateType `json:"state"` OpenIssues int `json:"open_issues"` ClosedIssues int `json:"closed_issues"` Closed *time.Time `json:"closed_at"` Deadline *time.Time `json:"due_on"` }
Milestone milestone is a collection of issues on one repository
type Organization ¶
type Organization struct { ID int64 `json:"id"` UserName string `json:"username"` FullName string `json:"full_name"` AvatarURL string `json:"avatar_url"` Description string `json:"description"` Website string `json:"website"` Location string `json:"location"` Visibility string `json:"visibility"` }
Organization represents an organization
type PRBranchInfo ¶
type PRBranchInfo struct { Name string `json:"label"` Ref string `json:"ref"` Sha string `json:"sha"` RepoID int64 `json:"repo_id"` Repository *Repository `json:"repo"` }
PRBranchInfo information about a branch
type PayloadCommit ¶
type PayloadCommit struct { // sha1 hash of the commit ID string `json:"id"` Message string `json:"message"` URL string `json:"url"` Author *PayloadUser `json:"author"` Committer *PayloadUser `json:"committer"` Verification *PayloadCommitVerification `json:"verification"` Timestamp time.Time `json:"timestamp"` Added []string `json:"added"` Removed []string `json:"removed"` Modified []string `json:"modified"` }
PayloadCommit represents a commit
type PayloadCommitVerification ¶
type PayloadCommitVerification struct { Verified bool `json:"verified"` Reason string `json:"reason"` Signature string `json:"signature"` Payload string `json:"payload"` }
PayloadCommitVerification represents the GPG verification of a commit
type PayloadUser ¶
type PayloadUser struct { // Full name of the commit author Name string `json:"name"` Email string `json:"email"` UserName string `json:"username"` }
PayloadUser represents the author or committer of a commit
type Permission ¶
type Permission struct { Admin bool `json:"admin"` Push bool `json:"push"` Pull bool `json:"pull"` }
Permission represents a set of permissions
type PublicKey ¶
type PublicKey struct { ID int64 `json:"id"` Key string `json:"key"` URL string `json:"url,omitempty"` Title string `json:"title,omitempty"` Fingerprint string `json:"fingerprint,omitempty"` Created time.Time `json:"created_at,omitempty"` Owner *User `json:"user,omitempty"` ReadOnly bool `json:"read_only,omitempty"` KeyType string `json:"key_type,omitempty"` }
PublicKey publickey is a user key to push code to repository
type PullRequest ¶
type PullRequest struct { ID int64 `json:"id"` URL string `json:"url"` Index int64 `json:"number"` Poster *User `json:"user"` Title string `json:"title"` Body string `json:"body"` Labels []*Label `json:"labels"` Milestone *Milestone `json:"milestone"` Assignee *User `json:"assignee"` Assignees []*User `json:"assignees"` State StateType `json:"state"` Comments int `json:"comments"` HTMLURL string `json:"html_url"` DiffURL string `json:"diff_url"` PatchURL string `json:"patch_url"` Mergeable bool `json:"mergeable"` HasMerged bool `json:"merged"` Merged *time.Time `json:"merged_at"` MergedCommitID *string `json:"merge_commit_sha"` MergedBy *User `json:"merged_by"` Base *PRBranchInfo `json:"base"` Head *PRBranchInfo `json:"head"` MergeBase string `json:"merge_base"` Deadline *time.Time `json:"due_date"` Created *time.Time `json:"created_at"` Updated *time.Time `json:"updated_at"` Closed *time.Time `json:"closed_at"` }
PullRequest represents a pull request
type PullRequestMeta ¶
PullRequestMeta PR info if an issue is a PR
type Reaction ¶
type Reaction struct { User *User `json:"user"` Reaction string `json:"content"` Created time.Time `json:"created_at"` }
Reaction contain one reaction
type Reference ¶
type Reference struct { Ref string `json:"ref"` URL string `json:"url"` Object *GitObject `json:"object"` }
Reference represents a Git reference.
type Release ¶
type Release struct { ID int64 `json:"id"` TagName string `json:"tag_name"` Target string `json:"target_commitish"` Title string `json:"name"` Note string `json:"body"` URL string `json:"url"` TarURL string `json:"tarball_url"` ZipURL string `json:"zipball_url"` IsDraft bool `json:"draft"` IsPrerelease bool `json:"prerelease"` CreatedAt time.Time `json:"created_at"` PublishedAt time.Time `json:"published_at"` Publisher *User `json:"author"` Attachments []*Attachment `json:"assets"` }
Release represents a repository release
type RepoCommit ¶
type RepoCommit struct { URL string `json:"url"` Author *CommitUser `json:"author"` Committer *CommitUser `json:"committer"` Message string `json:"message"` Tree *CommitMeta `json:"tree"` }
RepoCommit contains information of a commit in the context of a repository.
type Repository ¶
type Repository struct { ID int64 `json:"id"` Owner *User `json:"owner"` Name string `json:"name"` FullName string `json:"full_name"` Description string `json:"description"` Empty bool `json:"empty"` Private bool `json:"private"` Fork bool `json:"fork"` Parent *Repository `json:"parent"` Mirror bool `json:"mirror"` Size int `json:"size"` HTMLURL string `json:"html_url"` SSHURL string `json:"ssh_url"` CloneURL string `json:"clone_url"` OriginalURL string `json:"original_url"` Website string `json:"website"` Stars int `json:"stars_count"` Forks int `json:"forks_count"` Watchers int `json:"watchers_count"` OpenIssues int `json:"open_issues_count"` DefaultBranch string `json:"default_branch"` Archived bool `json:"archived"` Created time.Time `json:"created_at"` Updated time.Time `json:"updated_at"` Permissions *Permission `json:"permissions,omitempty"` HasIssues bool `json:"has_issues"` HasWiki bool `json:"has_wiki"` HasPullRequests bool `json:"has_pull_requests"` IgnoreWhitespaceConflicts bool `json:"ignore_whitespace_conflicts"` AllowMerge bool `json:"allow_merge_commits"` AllowRebase bool `json:"allow_rebase"` AllowRebaseMerge bool `json:"allow_rebase_explicit"` AllowSquash bool `json:"allow_squash_merge"` AvatarURL string `json:"avatar_url"` }
Repository represents a repository
type Status ¶
type Status struct { ID int64 `json:"id"` State StatusState `json:"status"` TargetURL string `json:"target_url"` Description string `json:"description"` URL string `json:"url"` Context string `json:"context"` Creator *User `json:"creator"` Created time.Time `json:"created_at"` Updated time.Time `json:"updated_at"` }
Status holds a single Status of a single Commit
type StatusState ¶
type StatusState string
StatusState holds the state of a Status It can be "pending", "success", "error", "failure", and "warning"
const ( // StatusPending is for when the Status is Pending StatusPending StatusState = "pending" // StatusSuccess is for when the Status is Success StatusSuccess StatusState = "success" // StatusError is for when the Status is Error StatusError StatusState = "error" // StatusFailure is for when the Status is Failure StatusFailure StatusState = "failure" // StatusWarning is for when the Status is Warning StatusWarning StatusState = "warning" )
type Tag ¶
type Tag struct { Name string `json:"name"` ID string `json:"id"` Commit *CommitMeta `json:"commit"` ZipballURL string `json:"zipball_url"` TarballURL string `json:"tarball_url"` }
Tag represents a repository tag
type Team ¶
type Team struct { ID int64 `json:"id"` Name string `json:"name"` Description string `json:"description"` Organization *Organization `json:"organization"` // enum: none,read,write,admin,owner Permission string `json:"permission"` // example: ["repo.code","repo.issues","repo.ext_issues","repo.wiki","repo.pulls","repo.releases","repo.ext_wiki"] Units []string `json:"units"` }
Team represents a team in an organization
type TopicsList ¶
type TopicsList struct {
Topics []string `json:"topics"`
}
TopicsList represents a list of repo's topics
type TrackedTime ¶
type TrackedTime struct { ID int64 `json:"id"` Created time.Time `json:"created"` // Time in seconds Time int64 `json:"time"` // deprecated (only for backwards compatibility) UserID int64 `json:"user_id"` UserName string `json:"user_name"` // deprecated (only for backwards compatibility) IssueID int64 `json:"issue_id"` Issue *Issue `json:"issue"` }
TrackedTime worked time for an issue / pr
type User ¶
type User struct { // the user's id ID int64 `json:"id"` // the user's username UserName string `json:"login"` // the user's full name FullName string `json:"full_name"` Email string `json:"email"` // URL to the user's avatar AvatarURL string `json:"avatar_url"` // User locale Language string `json:"language"` // Is the user an administrator IsAdmin bool `json:"is_admin"` LastLogin time.Time `json:"last_login,omitempty"` Created time.Time `json:"created,omitempty"` }
User represents a user
type VisibleType ¶
type VisibleType int
VisibleType defines the visibility (Organization only)
const ( // VisibleTypePublic Visible for everyone VisibleTypePublic VisibleType = iota // VisibleTypeLimited Visible for every connected user VisibleTypeLimited // VisibleTypePrivate Visible only for organization's members VisibleTypePrivate )
type WatchInfo ¶
type WatchInfo struct { Subscribed bool `json:"subscribed"` Ignored bool `json:"ignored"` Reason interface{} `json:"reason"` CreatedAt time.Time `json:"created_at"` URL string `json:"url"` RepositoryURL string `json:"repository_url"` }
WatchInfo represents an API watch status of one repository
Source Files ¶
- admin_org.go
- admin_repo.go
- admin_user.go
- attachment.go
- client.go
- doc.go
- fork.go
- git_blob.go
- git_hook.go
- hook.go
- issue.go
- issue_comment.go
- issue_label.go
- issue_milestone.go
- issue_reaction.go
- issue_stopwatch.go
- issue_subscription.go
- issue_tracked_time.go
- list_options.go
- org.go
- org_member.go
- org_team.go
- org_type.go
- pull.go
- release.go
- repo.go
- repo_branch.go
- repo_collaborator.go
- repo_commit.go
- repo_file.go
- repo_key.go
- repo_refs.go
- repo_tag.go
- repo_topics.go
- repo_tree.go
- repo_watch.go
- status.go
- user.go
- user_app.go
- user_email.go
- user_follow.go
- user_gpgkey.go
- user_key.go
- user_search.go
- version.go