sdk: code.gitea.io/sdk/gitea Index | Files

package gitea

import "code.gitea.io/sdk/gitea"

Index

Package Files

admin_cron.go 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 notifications.go oauth2.go org.go org_member.go org_team.go pull.go pull_review.go release.go repo.go repo_branch.go repo_branch_protection.go repo_collaborator.go repo_commit.go repo_file.go repo_key.go repo_migrate.go repo_refs.go repo_tag.go repo_topics.go repo_transfer.go repo_tree.go repo_watch.go settings.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

func SetBasicAuth Uses

func SetBasicAuth(username, password string) func(client *Client)

SetBasicAuth is an option for NewClient to set username and password

func SetContext Uses

func SetContext(ctx context.Context) func(client *Client)

SetContext is an option for NewClient to set context

func SetDebugMode Uses

func SetDebugMode() func(client *Client)

SetDebugMode is an option for NewClient to enable debug mode

func SetHTTPClient Uses

func SetHTTPClient(httpClient *http.Client) func(client *Client)

SetHTTPClient is an option for NewClient to set custom http client

func SetOTP Uses

func SetOTP(otp string) func(client *Client)

SetOTP is an option for NewClient to set OTP for 2FA

func SetSudo Uses

func SetSudo(sudo string) func(client *Client)

SetSudo is an option for NewClient to set sudo header

func SetToken Uses

func SetToken(token string) func(client *Client)

SetToken is an option for NewClient to set token

func Version Uses

func Version() string

Version return the library version

type AccessMode Uses

type AccessMode string

AccessMode represent the grade of access you have to something

const (
    // AccessModeNone no access
    AccessModeNone AccessMode = "none"
    // AccessModeRead read access
    AccessModeRead AccessMode = "read"
    // AccessModeWrite write access
    AccessModeWrite AccessMode = "write"
    // AccessModeAdmin admin access
    AccessModeAdmin AccessMode = "admin"
    // AccessModeOwner owner
    AccessModeOwner AccessMode = "owner"
)

type AccessToken Uses

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 Uses

type AddCollaboratorOption struct {
    Permission *AccessMode `json:"permission"`
}

AddCollaboratorOption options when adding a user as a collaborator of a repository

func (AddCollaboratorOption) Validate Uses

func (opt AddCollaboratorOption) Validate() error

Validate the AddCollaboratorOption struct

type AddTimeOption Uses

type AddTimeOption struct {
    // time in seconds
    Time int64 `json:"time"`
    // optional
    Created time.Time `json:"created"`
    // optional
    User string `json:"user_name"`
}

AddTimeOption options for adding time to an issue

func (AddTimeOption) Validate Uses

func (opt AddTimeOption) Validate() error

Validate the AddTimeOption struct

type AdminListOrgsOptions Uses

type AdminListOrgsOptions struct {
    ListOptions
}

AdminListOrgsOptions options for listing admin's organizations

type AdminListUsersOptions Uses

type AdminListUsersOptions struct {
    ListOptions
}

AdminListUsersOptions options for listing admin users

type ArchiveType Uses

type ArchiveType string

ArchiveType represent supported archive formats by gitea

const (
    // ZipArchive represent zip format
    ZipArchive ArchiveType = ".zip"
    // TarGZArchive represent tar.gz format
    TarGZArchive ArchiveType = ".tar.gz"
)

type Attachment Uses

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 Uses

type Branch struct {
    Name                          string         `json:"name"`
    Commit                        *PayloadCommit `json:"commit"`
    Protected                     bool           `json:"protected"`
    RequiredApprovals             int64          `json:"required_approvals"`
    EnableStatusCheck             bool           `json:"enable_status_check"`
    StatusCheckContexts           []string       `json:"status_check_contexts"`
    UserCanPush                   bool           `json:"user_can_push"`
    UserCanMerge                  bool           `json:"user_can_merge"`
    EffectiveBranchProtectionName string         `json:"effective_branch_protection_name"`
}

Branch represents a repository branch

type BranchProtection Uses

type BranchProtection struct {
    BranchName                  string    `json:"branch_name"`
    EnablePush                  bool      `json:"enable_push"`
    EnablePushWhitelist         bool      `json:"enable_push_whitelist"`
    PushWhitelistUsernames      []string  `json:"push_whitelist_usernames"`
    PushWhitelistTeams          []string  `json:"push_whitelist_teams"`
    PushWhitelistDeployKeys     bool      `json:"push_whitelist_deploy_keys"`
    EnableMergeWhitelist        bool      `json:"enable_merge_whitelist"`
    MergeWhitelistUsernames     []string  `json:"merge_whitelist_usernames"`
    MergeWhitelistTeams         []string  `json:"merge_whitelist_teams"`
    EnableStatusCheck           bool      `json:"enable_status_check"`
    StatusCheckContexts         []string  `json:"status_check_contexts"`
    RequiredApprovals           int64     `json:"required_approvals"`
    EnableApprovalsWhitelist    bool      `json:"enable_approvals_whitelist"`
    ApprovalsWhitelistUsernames []string  `json:"approvals_whitelist_username"`
    ApprovalsWhitelistTeams     []string  `json:"approvals_whitelist_teams"`
    BlockOnRejectedReviews      bool      `json:"block_on_rejected_reviews"`
    BlockOnOutdatedBranch       bool      `json:"block_on_outdated_branch"`
    DismissStaleApprovals       bool      `json:"dismiss_stale_approvals"`
    RequireSignedCommits        bool      `json:"require_signed_commits"`
    ProtectedFilePatterns       string    `json:"protected_file_patterns"`
    Created                     time.Time `json:"created_at"`
    Updated                     time.Time `json:"updated_at"`
}

BranchProtection represents a branch protection for a repository

type Client Uses

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

Client represents a Gitea API client.

func NewClient Uses

func NewClient(url string, options ...func(*Client)) (*Client, error)

NewClient initializes and returns a API client.

func NewClientWithHTTP Uses

func NewClientWithHTTP(url string, httpClient *http.Client) *Client

NewClientWithHTTP creates an API client with a custom http client Deprecated use SetHTTPClient option

func (*Client) AddCollaborator Uses

func (c *Client) AddCollaborator(user, repo, collaborator string, opt AddCollaboratorOption) (*Response, error)

AddCollaborator add some user as a collaborator of a repository

func (*Client) AddEmail Uses

func (c *Client) AddEmail(opt CreateEmailOption) ([]*Email, *Response, error)

AddEmail add one email to current user with options

func (*Client) AddIssueLabels Uses

func (c *Client) AddIssueLabels(owner, repo string, index int64, opt IssueLabelsOption) ([]*Label, *Response, error)

AddIssueLabels add one or more labels to one issue

func (*Client) AddIssueSubscription Uses

func (c *Client) AddIssueSubscription(owner, repo string, index int64, user string) (*Response, error)

AddIssueSubscription Subscribe user to issue

func (*Client) AddRepoTopic Uses

func (c *Client) AddRepoTopic(user, repo, topic string) (*Response, error)

AddRepoTopic adds a topic to a repo's topics list

func (*Client) AddTeamMember Uses

func (c *Client) AddTeamMember(id int64, user string) (*Response, error)

AddTeamMember adds a member to a team

func (*Client) AddTeamRepository Uses

func (c *Client) AddTeamRepository(id int64, org, repo string) (*Response, error)

AddTeamRepository adds a repository to a team

func (*Client) AddTime Uses

func (c *Client) AddTime(owner, repo string, index int64, opt AddTimeOption) (*TrackedTime, *Response, error)

AddTime adds time to issue with the given index

func (*Client) AdminCreateOrg Uses

func (c *Client) AdminCreateOrg(user string, opt CreateOrgOption) (*Organization, *Response, error)

AdminCreateOrg create an organization

func (*Client) AdminCreateRepo Uses

func (c *Client) AdminCreateRepo(user string, opt CreateRepoOption) (*Repository, *Response, error)

AdminCreateRepo create a repo

func (*Client) AdminCreateUser Uses

func (c *Client) AdminCreateUser(opt CreateUserOption) (*User, *Response, error)

AdminCreateUser create a user

func (*Client) AdminCreateUserPublicKey Uses

func (c *Client) AdminCreateUserPublicKey(user string, opt CreateKeyOption) (*PublicKey, *Response, error)

AdminCreateUserPublicKey adds a public key for the user

func (*Client) AdminDeleteUser Uses

func (c *Client) AdminDeleteUser(user string) (*Response, error)

AdminDeleteUser delete one user according name

func (*Client) AdminDeleteUserPublicKey Uses

func (c *Client) AdminDeleteUserPublicKey(user string, keyID int) (*Response, error)

AdminDeleteUserPublicKey deletes a user's public key

func (*Client) AdminEditUser Uses

func (c *Client) AdminEditUser(user string, opt EditUserOption) (*Response, error)

AdminEditUser modify user informations

func (*Client) AdminListOrgs Uses

func (c *Client) AdminListOrgs(opt AdminListOrgsOptions) ([]*Organization, *Response, error)

AdminListOrgs lists all orgs

func (*Client) AdminListUsers Uses

func (c *Client) AdminListUsers(opt AdminListUsersOptions) ([]*User, *Response, error)

AdminListUsers lists all users

func (*Client) CheckIssueSubscription Uses

func (c *Client) CheckIssueSubscription(owner, repo string, index int64) (*WatchInfo, *Response, error)

CheckIssueSubscription check if current user is subscribed to an issue

func (*Client) CheckNotifications Uses

func (c *Client) CheckNotifications() (int64, *Response, error)

CheckNotifications list users's notification threads

func (*Client) CheckOrgMembership Uses

func (c *Client) CheckOrgMembership(org, user string) (bool, *Response, error)

CheckOrgMembership Check if a user is a member of an organization

func (*Client) CheckPublicOrgMembership Uses

func (c *Client) CheckPublicOrgMembership(org, user string) (bool, *Response, error)

CheckPublicOrgMembership Check if a user is a member of an organization

func (*Client) CheckRepoWatch Uses

func (c *Client) CheckRepoWatch(repoUser, repoName string) (bool, *Response, error)

CheckRepoWatch check if the current user is watching a repo

func (*Client) CheckServerVersionConstraint Uses

func (c *Client) CheckServerVersionConstraint(constraint string) error

CheckServerVersionConstraint validates that the login's server satisfies a given version constraint such as ">= 1.11.0+dev"

func (*Client) ClearIssueLabels Uses

func (c *Client) ClearIssueLabels(owner, repo string, index int64) (*Response, error)

ClearIssueLabels delete all the labels of one issue.

func (*Client) CreateAccessToken Uses

func (c *Client) CreateAccessToken(opt CreateAccessTokenOption) (*AccessToken, *Response, error)

CreateAccessToken create one access token with options

func (*Client) CreateBranch Uses

func (c *Client) CreateBranch(owner, repo string, opt CreateBranchOption) (*Branch, *Response, error)

CreateBranch creates a branch for a user's repository

func (*Client) CreateBranchProtection Uses

func (c *Client) CreateBranchProtection(owner, repo string, opt CreateBranchProtectionOption) (*BranchProtection, *Response, error)

CreateBranchProtection creates a branch protection for a repo

func (*Client) CreateDeployKey Uses

func (c *Client) CreateDeployKey(user, repo string, opt CreateKeyOption) (*DeployKey, *Response, error)

CreateDeployKey options when create one deploy key

func (*Client) CreateFile Uses

func (c *Client) CreateFile(owner, repo, filepath string, opt CreateFileOptions) (*FileResponse, *Response, error)

CreateFile create a file in a repository

func (*Client) CreateFork Uses

func (c *Client) CreateFork(user, repo string, form CreateForkOption) (*Repository, *Response, error)

CreateFork create a fork of a repository

func (*Client) CreateGPGKey Uses

func (c *Client) CreateGPGKey(opt CreateGPGKeyOption) (*GPGKey, *Response, error)

CreateGPGKey create GPG key with options

func (*Client) CreateIssue Uses

func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue, *Response, error)

CreateIssue create a new issue for a given repository

func (*Client) CreateIssueComment Uses

func (c *Client) CreateIssueComment(owner, repo string, index int64, opt CreateIssueCommentOption) (*Comment, *Response, error)

CreateIssueComment create comment on an issue.

func (*Client) CreateLabel Uses

func (c *Client) CreateLabel(owner, repo string, opt CreateLabelOption) (*Label, *Response, error)

CreateLabel create one label of repository

func (*Client) CreateMilestone Uses

func (c *Client) CreateMilestone(owner, repo string, opt CreateMilestoneOption) (*Milestone, *Response, error)

CreateMilestone create one milestone with options

func (*Client) CreateOauth2 Uses

func (c *Client) CreateOauth2(opt CreateOauth2Option) (*Oauth2, *Response, error)

CreateOauth2 create an Oauth2 Application and returns a completed Oauth2 object.

func (*Client) CreateOrg Uses

func (c *Client) CreateOrg(opt CreateOrgOption) (*Organization, *Response, error)

CreateOrg creates an organization

func (*Client) CreateOrgHook Uses

func (c *Client) CreateOrgHook(org string, opt CreateHookOption) (*Hook, *Response, error)

CreateOrgHook create one hook for an organization, with options

func (*Client) CreateOrgRepo Uses

func (c *Client) CreateOrgRepo(org string, opt CreateRepoOption) (*Repository, *Response, error)

CreateOrgRepo creates an organization repository for authenticated user.

func (*Client) CreatePublicKey Uses

func (c *Client) CreatePublicKey(opt CreateKeyOption) (*PublicKey, *Response, error)

CreatePublicKey create public key with options

func (*Client) CreatePullRequest Uses

func (c *Client) CreatePullRequest(owner, repo string, opt CreatePullRequestOption) (*PullRequest, *Response, error)

CreatePullRequest create pull request with options

func (*Client) CreatePullReview Uses

func (c *Client) CreatePullReview(owner, repo string, index int64, opt CreatePullReviewOptions) (*PullReview, *Response, error)

CreatePullReview create a review to an pull request

func (*Client) CreateRelease Uses

func (c *Client) CreateRelease(user, repo string, opt CreateReleaseOption) (*Release, *Response, error)

CreateRelease create a release

func (*Client) CreateReleaseAttachment Uses

func (c *Client) CreateReleaseAttachment(user, repo string, release int64, file io.Reader, filename string) (*Attachment, *Response, error)

CreateReleaseAttachment creates an attachment for the given release

func (*Client) CreateRepo Uses

func (c *Client) CreateRepo(opt CreateRepoOption) (*Repository, *Response, error)

CreateRepo creates a repository for authenticated user.

func (*Client) CreateRepoHook Uses

func (c *Client) CreateRepoHook(user, repo string, opt CreateHookOption) (*Hook, *Response, error)

CreateRepoHook create one hook for a repository, with options

func (*Client) CreateStatus Uses

func (c *Client) CreateStatus(owner, repo, sha string, opts CreateStatusOption) (*Status, *Response, error)

CreateStatus creates a new Status for a given Commit

func (*Client) CreateTeam Uses

func (c *Client) CreateTeam(org string, opt CreateTeamOption) (*Team, *Response, error)

CreateTeam creates a team for an organization

func (*Client) DeleteAccessToken Uses

func (c *Client) DeleteAccessToken(value interface{}) (*Response, error)

DeleteAccessToken delete token, identified by ID and if not available by name

func (*Client) DeleteBranchProtection Uses

func (c *Client) DeleteBranchProtection(owner, repo, name string) (*Response, error)

DeleteBranchProtection deletes a branch protection for a repo

func (*Client) DeleteCollaborator Uses

func (c *Client) DeleteCollaborator(user, repo, collaborator string) (*Response, error)

DeleteCollaborator remove a collaborator from a repository

func (*Client) DeleteDeployKey Uses

func (c *Client) DeleteDeployKey(owner, repo string, keyID int64) (*Response, error)

DeleteDeployKey delete deploy key with key id

func (*Client) DeleteEmail Uses

func (c *Client) DeleteEmail(opt DeleteEmailOption) (*Response, error)

DeleteEmail delete one email of current users'

func (*Client) DeleteFile Uses

func (c *Client) DeleteFile(owner, repo, filepath string, opt DeleteFileOptions) (*Response, error)

DeleteFile delete a file from repository

func (*Client) DeleteGPGKey Uses

func (c *Client) DeleteGPGKey(keyID int64) (*Response, error)

DeleteGPGKey delete GPG key with key id

func (*Client) DeleteIssueComment Uses

func (c *Client) DeleteIssueComment(owner, repo string, commentID int64) (*Response, error)

DeleteIssueComment deletes an issue comment.

func (*Client) DeleteIssueCommentReaction Uses

func (c *Client) DeleteIssueCommentReaction(owner, repo string, commentID int64, reaction string) (*Response, error)

DeleteIssueCommentReaction remove a reaction from a comment of an issue

func (*Client) DeleteIssueLabel Uses

func (c *Client) DeleteIssueLabel(owner, repo string, index, label int64) (*Response, error)

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 Uses

func (c *Client) DeleteIssueReaction(owner, repo string, index int64, reaction string) (*Response, error)

DeleteIssueReaction remove a reaction from an issue

func (*Client) DeleteIssueStopwatch Uses

func (c *Client) DeleteIssueStopwatch(owner, repo string, index int64) (*Response, error)

DeleteIssueStopwatch delete / cancel a specific stopwatch

func (*Client) DeleteIssueSubscription Uses

func (c *Client) DeleteIssueSubscription(owner, repo string, index int64, user string) (*Response, error)

DeleteIssueSubscription unsubscribe user from issue

func (*Client) DeleteLabel Uses

func (c *Client) DeleteLabel(owner, repo string, id int64) (*Response, error)

DeleteLabel delete one label of repository by id

func (*Client) DeleteMilestone Uses

func (c *Client) DeleteMilestone(owner, repo string, id int64) (*Response, error)

DeleteMilestone delete one milestone by id

func (*Client) DeleteMilestoneByName Uses

func (c *Client) DeleteMilestoneByName(owner, repo string, name string) (*Response, error)

DeleteMilestoneByName delete one milestone by name

func (*Client) DeleteOauth2 Uses

func (c *Client) DeleteOauth2(oauth2id int64) (*Response, error)

DeleteOauth2 delete an Oauth2 application by ID

func (*Client) DeleteOrg Uses

func (c *Client) DeleteOrg(orgname string) (*Response, error)

DeleteOrg deletes an organization

func (*Client) DeleteOrgHook Uses

func (c *Client) DeleteOrgHook(org string, id int64) (*Response, error)

DeleteOrgHook delete one hook from an organization, with hook id

func (*Client) DeleteOrgMembership Uses

func (c *Client) DeleteOrgMembership(org, user string) (*Response, error)

DeleteOrgMembership remove a member from an organization

func (*Client) DeletePublicKey Uses

func (c *Client) DeletePublicKey(keyID int64) (*Response, error)

DeletePublicKey delete public key with key id

func (*Client) DeletePullReview Uses

func (c *Client) DeletePullReview(owner, repo string, index, id int64) (*Response, error)

DeletePullReview delete a specific review from a pull request

func (*Client) DeleteRelease Uses

func (c *Client) DeleteRelease(user, repo string, id int64) (*Response, error)

DeleteRelease delete a release from a repository

func (*Client) DeleteReleaseAttachment Uses

func (c *Client) DeleteReleaseAttachment(user, repo string, release int64, id int64) (*Response, error)

DeleteReleaseAttachment deletes the given attachment including the uploaded file

func (*Client) DeleteRepo Uses

func (c *Client) DeleteRepo(owner, repo string) (*Response, error)

DeleteRepo deletes a repository of user or organization.

func (*Client) DeleteRepoBranch Uses

func (c *Client) DeleteRepoBranch(user, repo, branch string) (bool, *Response, error)

DeleteRepoBranch delete a branch in a repository

func (*Client) DeleteRepoGitHook Uses

func (c *Client) DeleteRepoGitHook(user, repo, id string) (*Response, error)

DeleteRepoGitHook delete one Git hook from a repository

func (*Client) DeleteRepoHook Uses

func (c *Client) DeleteRepoHook(user, repo string, id int64) (*Response, error)

DeleteRepoHook delete one hook from a repository, with hook id

func (*Client) DeleteRepoTopic Uses

func (c *Client) DeleteRepoTopic(user, repo, topic string) (*Response, error)

DeleteRepoTopic deletes a topic from repo's topics list

func (*Client) DeleteTeam Uses

func (c *Client) DeleteTeam(id int64) (*Response, error)

DeleteTeam deletes a team of an organization

func (*Client) DeleteTime Uses

func (c *Client) DeleteTime(owner, repo string, index, timeID int64) (*Response, error)

DeleteTime delete a specific tracked time by id of a single issue for a given repository

func (*Client) EditBranchProtection Uses

func (c *Client) EditBranchProtection(owner, repo, name string, opt EditBranchProtectionOption) (*BranchProtection, *Response, error)

EditBranchProtection edits a branch protection for a repo

func (*Client) EditIssue Uses

func (c *Client) EditIssue(owner, repo string, index int64, opt EditIssueOption) (*Issue, *Response, error)

EditIssue modify an existing issue for a given repository

func (*Client) EditIssueComment Uses

func (c *Client) EditIssueComment(owner, repo string, commentID int64, opt EditIssueCommentOption) (*Comment, *Response, error)

EditIssueComment edits an issue comment.

func (*Client) EditLabel Uses

func (c *Client) EditLabel(owner, repo string, id int64, opt EditLabelOption) (*Label, *Response, error)

EditLabel modify one label with options

func (*Client) EditMilestone Uses

func (c *Client) EditMilestone(owner, repo string, id int64, opt EditMilestoneOption) (*Milestone, *Response, error)

EditMilestone modify milestone with options

func (*Client) EditMilestoneByName Uses

func (c *Client) EditMilestoneByName(owner, repo string, name string, opt EditMilestoneOption) (*Milestone, *Response, error)

EditMilestoneByName modify milestone with options

func (*Client) EditOrg Uses

func (c *Client) EditOrg(orgname string, opt EditOrgOption) (*Response, error)

EditOrg modify one organization via options

func (*Client) EditOrgHook Uses

func (c *Client) EditOrgHook(org string, id int64, opt EditHookOption) (*Response, error)

EditOrgHook modify one hook of an organization, with hook id and options

func (*Client) EditPullRequest Uses

func (c *Client) EditPullRequest(owner, repo string, index int64, opt EditPullRequestOption) (*PullRequest, *Response, error)

EditPullRequest modify pull request with PR id and options

func (*Client) EditRelease Uses

func (c *Client) EditRelease(user, repo string, id int64, form EditReleaseOption) (*Release, *Response, error)

EditRelease edit a release

func (*Client) EditReleaseAttachment Uses

func (c *Client) EditReleaseAttachment(user, repo string, release int64, attachment int64, form EditAttachmentOptions) (*Attachment, *Response, error)

EditReleaseAttachment updates the given attachment with the given options

func (*Client) EditRepo Uses

func (c *Client) EditRepo(owner, reponame string, opt EditRepoOption) (*Repository, *Response, error)

EditRepo edit the properties of a repository

func (*Client) EditRepoGitHook Uses

func (c *Client) EditRepoGitHook(user, repo, id string, opt EditGitHookOption) (*Response, error)

EditRepoGitHook modify one Git hook of a repository

func (*Client) EditRepoHook Uses

func (c *Client) EditRepoHook(user, repo string, id int64, opt EditHookOption) (*Response, error)

EditRepoHook modify one hook of a repository, with hook id and options

func (*Client) EditTeam Uses

func (c *Client) EditTeam(id int64, opt EditTeamOption) (*Response, error)

EditTeam edits a team of an organization

func (*Client) Follow Uses

func (c *Client) Follow(target string) (*Response, error)

Follow set current user follow the target

func (*Client) GetArchive Uses

func (c *Client) GetArchive(owner, repo, ref string, ext ArchiveType) ([]byte, *Response, error)

GetArchive get an archive of a repository by git reference e.g.: ref -> master, 70b7c74b33, v1.2.1, ...

func (*Client) GetBlob Uses

func (c *Client) GetBlob(user, repo, sha string) (*GitBlobResponse, *Response, error)

GetBlob get the blob of a repository file

func (*Client) GetBranchProtection Uses

func (c *Client) GetBranchProtection(owner, repo, name string) (*BranchProtection, *Response, error)

GetBranchProtection gets a branch protection

func (*Client) GetCombinedStatus Uses

func (c *Client) GetCombinedStatus(owner, repo, sha string) (*CombinedStatus, *Response, error)

GetCombinedStatus returns the CombinedStatus for a given Commit

func (*Client) GetContents Uses

func (c *Client) GetContents(owner, repo, ref, filepath string) (*ContentsResponse, *Response, error)

GetContents get the metadata and contents (if a file) of an entry in a repository, or a list of entries if a dir ref is optional

func (*Client) GetDeployKey Uses

func (c *Client) GetDeployKey(user, repo string, keyID int64) (*DeployKey, *Response, error)

GetDeployKey get one deploy key with key id

func (*Client) GetFile Uses

func (c *Client) GetFile(user, repo, ref, tree string) ([]byte, *Response, error)

GetFile downloads a file of repository, ref can be branch/tag/commit. e.g.: ref -> master, tree -> macaron.go(no leading slash)

func (*Client) GetGPGKey Uses

func (c *Client) GetGPGKey(keyID int64) (*GPGKey, *Response, error)

GetGPGKey get current user's GPG key by key id

func (*Client) GetGlobalAPISettings Uses

func (c *Client) GetGlobalAPISettings() (*GlobalAPISettings, *Response, error)

GetGlobalAPISettings get global api settings witch are exposed by it

func (*Client) GetGlobalAttachmentSettings Uses

func (c *Client) GetGlobalAttachmentSettings() (*GlobalAttachmentSettings, *Response, error)

GetGlobalAttachmentSettings get global repository settings witch are exposed by API

func (*Client) GetGlobalRepoSettings Uses

func (c *Client) GetGlobalRepoSettings() (*GlobalRepoSettings, *Response, error)

GetGlobalRepoSettings get global repository settings witch are exposed by API

func (*Client) GetGlobalUISettings Uses

func (c *Client) GetGlobalUISettings() (*GlobalUISettings, *Response, error)

GetGlobalUISettings get global ui settings witch are exposed by API

func (*Client) GetIssue Uses

func (c *Client) GetIssue(owner, repo string, index int64) (*Issue, *Response, error)

GetIssue returns a single issue for a given repository

func (*Client) GetIssueComment Uses

func (c *Client) GetIssueComment(owner, repo string, id int64) (*Comment, *Response, error)

GetIssueComment get a comment for a given repo by id.

func (*Client) GetIssueCommentReactions Uses

func (c *Client) GetIssueCommentReactions(owner, repo string, commentID int64) ([]*Reaction, *Response, error)

GetIssueCommentReactions get a list of reactions from a comment of an issue

func (*Client) GetIssueLabels Uses

func (c *Client) GetIssueLabels(owner, repo string, index int64, opts ListLabelsOptions) ([]*Label, *Response, error)

GetIssueLabels get labels of one issue via issue id

func (*Client) GetIssueReactions Uses

func (c *Client) GetIssueReactions(owner, repo string, index int64) ([]*Reaction, *Response, error)

GetIssueReactions get a list reactions of an issue

func (*Client) GetIssueSubscribers Uses

func (c *Client) GetIssueSubscribers(owner, repo string, index int64) ([]*User, *Response, error)

GetIssueSubscribers get list of users who subscribed on an issue

func (*Client) GetMilestone Uses

func (c *Client) GetMilestone(owner, repo string, id int64) (*Milestone, *Response, error)

GetMilestone get one milestone by repo name and milestone id

func (*Client) GetMilestoneByName Uses

func (c *Client) GetMilestoneByName(owner, repo string, name string) (*Milestone, *Response, error)

GetMilestoneByName get one milestone by repo and milestone name

func (*Client) GetMyStopwatches Uses

func (c *Client) GetMyStopwatches() ([]*StopWatch, *Response, error)

GetMyStopwatches list all stopwatches

func (*Client) GetMyTrackedTimes Uses

func (c *Client) GetMyTrackedTimes() ([]*TrackedTime, *Response, error)

GetMyTrackedTimes list tracked times of the current user

func (*Client) GetMyUserInfo Uses

func (c *Client) GetMyUserInfo() (*User, *Response, error)

GetMyUserInfo get user info of current user

func (*Client) GetMyWatchedRepos Uses

func (c *Client) GetMyWatchedRepos() ([]*Repository, *Response, error)

GetMyWatchedRepos list repositories watched by the authenticated user

func (*Client) GetNotification Uses

func (c *Client) GetNotification(id int64) (*NotificationThread, *Response, error)

GetNotification get notification thread by ID

func (*Client) GetOauth2 Uses

func (c *Client) GetOauth2(oauth2id int64) (*Oauth2, *Response, error)

GetOauth2 a specific Oauth2 Application by ID.

func (*Client) GetOrg Uses

func (c *Client) GetOrg(orgname string) (*Organization, *Response, error)

GetOrg get one organization by name

func (*Client) GetOrgHook Uses

func (c *Client) GetOrgHook(org string, id int64) (*Hook, *Response, error)

GetOrgHook get a hook of an organization

func (*Client) GetPublicKey Uses

func (c *Client) GetPublicKey(keyID int64) (*PublicKey, *Response, error)

GetPublicKey get current user's public key by key id

func (*Client) GetPullRequest Uses

func (c *Client) GetPullRequest(owner, repo string, index int64) (*PullRequest, *Response, error)

GetPullRequest get information of one PR

func (*Client) GetPullRequestDiff Uses

func (c *Client) GetPullRequestDiff(owner, repo string, index int64) ([]byte, *Response, error)

GetPullRequestDiff gets the .diff file as bytes for a PR

func (*Client) GetPullRequestPatch Uses

func (c *Client) GetPullRequestPatch(owner, repo string, index int64) ([]byte, *Response, error)

GetPullRequestPatch gets the .patch file as bytes for a PR

func (*Client) GetPullReview Uses

func (c *Client) GetPullReview(owner, repo string, index, id int64) (*PullReview, *Response, error)

GetPullReview gets a specific review of a pull request

func (*Client) GetRelease Uses

func (c *Client) GetRelease(user, repo string, id int64) (*Release, *Response, error)

GetRelease get a release of a repository by id

func (*Client) GetReleaseAttachment Uses

func (c *Client) GetReleaseAttachment(user, repo string, release int64, id int64) (*Attachment, *Response, error)

GetReleaseAttachment returns the requested attachment

func (*Client) GetReleaseByTag Uses

func (c *Client) GetReleaseByTag(user, repo string, tag string) (*Release, *Response, error)

GetReleaseByTag get a release of a repository by tag

func (*Client) GetRepo Uses

func (c *Client) GetRepo(owner, reponame string) (*Repository, *Response, error)

GetRepo returns information of a repository of given owner.

func (*Client) GetRepoBranch Uses

func (c *Client) GetRepoBranch(user, repo, branch string) (*Branch, *Response, error)

GetRepoBranch get one branch's information of one repository

func (*Client) GetRepoGitHook Uses

func (c *Client) GetRepoGitHook(user, repo, id string) (*GitHook, *Response, error)

GetRepoGitHook get a Git hook of a repository

func (*Client) GetRepoHook Uses

func (c *Client) GetRepoHook(user, repo string, id int64) (*Hook, *Response, error)

GetRepoHook get a hook of a repository

func (*Client) GetRepoLabel Uses

func (c *Client) GetRepoLabel(owner, repo string, id int64) (*Label, *Response, error)

GetRepoLabel get one label of repository by repo it

func (*Client) GetRepoLanguages Uses

func (c *Client) GetRepoLanguages(owner, repo string) (map[string]int64, *Response, error)

GetRepoLanguages return language stats of a repo

func (*Client) GetRepoRef Uses

func (c *Client) GetRepoRef(user, repo, ref string) (*Reference, *Response, error)

GetRepoRef get one ref's information of one repository

func (*Client) GetRepoRefs Uses

func (c *Client) GetRepoRefs(user, repo, ref string) ([]*Reference, *Response, error)

GetRepoRefs get list of ref's information of one repository

func (*Client) GetRepoTrackedTimes Uses

func (c *Client) GetRepoTrackedTimes(owner, repo string) ([]*TrackedTime, *Response, error)

GetRepoTrackedTimes list tracked times of a repository

func (*Client) GetSingleCommit Uses

func (c *Client) GetSingleCommit(user, repo, commitID string) (*Commit, *Response, error)

GetSingleCommit returns a single commit

func (*Client) GetTeam Uses

func (c *Client) GetTeam(id int64) (*Team, *Response, error)

GetTeam gets a team by ID

func (*Client) GetTeamMember Uses

func (c *Client) GetTeamMember(id int64, user string) (*User, *Response, error)

GetTeamMember gets a member of a team

func (*Client) GetTrees Uses

func (c *Client) GetTrees(user, repo, ref string, recursive bool) (*GitTreeResponse, *Response, 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 Uses

func (c *Client) GetUserInfo(user string) (*User, *Response, error)

GetUserInfo get user info by user's name

func (*Client) GetUserTrackedTimes Uses

func (c *Client) GetUserTrackedTimes(owner, repo, user string) ([]*TrackedTime, *Response, error)

GetUserTrackedTimes list tracked times of a user

func (*Client) GetWatchedRepos Uses

func (c *Client) GetWatchedRepos(user string) ([]*Repository, *Response, error)

GetWatchedRepos list all the watched repos of user

func (*Client) IsCollaborator Uses

func (c *Client) IsCollaborator(user, repo, collaborator string) (bool, *Response, error)

IsCollaborator check if a user is a collaborator of a repository

func (*Client) IsFollowing Uses

func (c *Client) IsFollowing(target string) (bool, *Response)

IsFollowing if current user followed the target

func (*Client) IsPullRequestMerged Uses

func (c *Client) IsPullRequestMerged(owner, repo string, index int64) (bool, *Response, error)

IsPullRequestMerged test if one PR is merged to one repository

func (*Client) IsUserFollowing Uses

func (c *Client) IsUserFollowing(user, target string) (bool, *Response)

IsUserFollowing if the user followed the target

func (*Client) IssueSubscribe Uses

func (c *Client) IssueSubscribe(owner, repo string, index int64) (*Response, error)

IssueSubscribe subscribe current user to an issue

func (*Client) IssueUnSubscribe Uses

func (c *Client) IssueUnSubscribe(owner, repo string, index int64) (*Response, error)

IssueUnSubscribe unsubscribe current user from an issue

func (*Client) ListAccessTokens Uses

func (c *Client) ListAccessTokens(opts ListAccessTokensOptions) ([]*AccessToken, *Response, error)

ListAccessTokens lists all the access tokens of user

func (*Client) ListBranchProtections Uses

func (c *Client) ListBranchProtections(owner, repo string, opt ListBranchProtectionsOptions) ([]*BranchProtection, *Response, error)

ListBranchProtections list branch protections for a repo

func (*Client) ListCollaborators Uses

func (c *Client) ListCollaborators(user, repo string, opt ListCollaboratorsOptions) ([]*User, *Response, error)

ListCollaborators list a repository's collaborators

func (*Client) ListCronTasks Uses

func (c *Client) ListCronTasks(opt ListCronTaskOptions) ([]*CronTask, *Response, error)

ListCronTasks list available cron tasks

func (*Client) ListDeployKeys Uses

func (c *Client) ListDeployKeys(user, repo string, opt ListDeployKeysOptions) ([]*DeployKey, *Response, error)

ListDeployKeys list all the deploy keys of one repository

func (*Client) ListEmails Uses

func (c *Client) ListEmails(opt ListEmailsOptions) ([]*Email, *Response, error)

ListEmails all the email addresses of user

func (*Client) ListFollowers Uses

func (c *Client) ListFollowers(user string, opt ListFollowersOptions) ([]*User, *Response, error)

ListFollowers list all the followers of one user

func (*Client) ListFollowing Uses

func (c *Client) ListFollowing(user string, opt ListFollowingOptions) ([]*User, *Response, error)

ListFollowing list all the users the user followed

func (*Client) ListForks Uses

func (c *Client) ListForks(user string, repo string, opt ListForksOptions) ([]*Repository, *Response, error)

ListForks list a repository's forks

func (*Client) ListGPGKeys Uses

func (c *Client) ListGPGKeys(user string, opt ListGPGKeysOptions) ([]*GPGKey, *Response, error)

ListGPGKeys list all the GPG keys of the user

func (*Client) ListIssueComments Uses

func (c *Client) ListIssueComments(owner, repo string, index int64, opt ListIssueCommentOptions) ([]*Comment, *Response, error)

ListIssueComments list comments on an issue.

func (*Client) ListIssues Uses

func (c *Client) ListIssues(opt ListIssueOption) ([]*Issue, *Response, error)

ListIssues returns all issues assigned the authenticated user

func (*Client) ListMyFollowers Uses

func (c *Client) ListMyFollowers(opt ListFollowersOptions) ([]*User, *Response, error)

ListMyFollowers list all the followers of current user

func (*Client) ListMyFollowing Uses

func (c *Client) ListMyFollowing(opt ListFollowingOptions) ([]*User, *Response, error)

ListMyFollowing list all the users current user followed

func (*Client) ListMyGPGKeys Uses

func (c *Client) ListMyGPGKeys(opt *ListGPGKeysOptions) ([]*GPGKey, *Response, error)

ListMyGPGKeys list all the GPG keys of current user

func (*Client) ListMyOrgs Uses

func (c *Client) ListMyOrgs(opt ListOrgsOptions) ([]*Organization, *Response, error)

ListMyOrgs list all of current user's organizations

func (*Client) ListMyPublicKeys Uses

func (c *Client) ListMyPublicKeys(opt ListPublicKeysOptions) ([]*PublicKey, *Response, error)

ListMyPublicKeys list all the public keys of current user

func (*Client) ListMyRepos Uses

func (c *Client) ListMyRepos(opt ListReposOptions) ([]*Repository, *Response, error)

ListMyRepos lists all repositories for the authenticated user that has access to.

func (*Client) ListMyTeams Uses

func (c *Client) ListMyTeams(opt *ListTeamsOptions) ([]*Team, *Response, error)

ListMyTeams lists all the teams of the current user

func (*Client) ListNotifications Uses

func (c *Client) ListNotifications(opt ListNotificationOptions) ([]*NotificationThread, *Response, error)

ListNotifications list users's notification threads

func (*Client) ListOauth2 Uses

func (c *Client) ListOauth2(opt ListOauth2Option) ([]*Oauth2, *Response, error)

ListOauth2 all of your Oauth2 Applications.

func (*Client) ListOrgHooks Uses

func (c *Client) ListOrgHooks(org string, opt ListHooksOptions) ([]*Hook, *Response, error)

ListOrgHooks list all the hooks of one organization

func (*Client) ListOrgMembership Uses

func (c *Client) ListOrgMembership(org string, opt ListOrgMembershipOption) ([]*User, *Response, error)

ListOrgMembership list an organization's members

func (*Client) ListOrgRepos Uses

func (c *Client) ListOrgRepos(org string, opt ListOrgReposOptions) ([]*Repository, *Response, error)

ListOrgRepos list all repositories of one organization by organization's name

func (*Client) ListOrgTeams Uses

func (c *Client) ListOrgTeams(org string, opt ListTeamsOptions) ([]*Team, *Response, error)

ListOrgTeams lists all teams of an organization

func (*Client) ListPublicKeys Uses

func (c *Client) ListPublicKeys(user string, opt ListPublicKeysOptions) ([]*PublicKey, *Response, error)

ListPublicKeys list all the public keys of the user

func (*Client) ListPublicOrgMembership Uses

func (c *Client) ListPublicOrgMembership(org string, opt ListOrgMembershipOption) ([]*User, *Response, error)

ListPublicOrgMembership list an organization's members

func (*Client) ListPullReviewComments Uses

func (c *Client) ListPullReviewComments(owner, repo string, index, id int64) ([]*PullReviewComment, *Response, error)

ListPullReviewComments lists all comments of a pull request review

func (*Client) ListPullReviews Uses

func (c *Client) ListPullReviews(owner, repo string, index int64, opt ListPullReviewsOptions) ([]*PullReview, *Response, error)

ListPullReviews lists all reviews of a pull request

func (*Client) ListReleaseAttachments Uses

func (c *Client) ListReleaseAttachments(user, repo string, release int64, opt ListReleaseAttachmentsOptions) ([]*Attachment, *Response, error)

ListReleaseAttachments list release's attachments

func (*Client) ListReleases Uses

func (c *Client) ListReleases(user, repo string, opt ListReleasesOptions) ([]*Release, *Response, error)

ListReleases list releases of a repository

func (*Client) ListRepoBranches Uses

func (c *Client) ListRepoBranches(user, repo string, opt ListRepoBranchesOptions) ([]*Branch, *Response, error)

ListRepoBranches list all the branches of one repository

func (*Client) ListRepoCommits Uses

func (c *Client) ListRepoCommits(user, repo string, opt ListCommitOptions) ([]*Commit, *Response, error)

ListRepoCommits return list of commits from a repo

func (*Client) ListRepoGitHooks Uses

func (c *Client) ListRepoGitHooks(user, repo string, opt ListRepoGitHooksOptions) ([]*GitHook, *Response, error)

ListRepoGitHooks list all the Git hooks of one repository

func (*Client) ListRepoHooks Uses

func (c *Client) ListRepoHooks(user, repo string, opt ListHooksOptions) ([]*Hook, *Response, error)

ListRepoHooks list all the hooks of one repository

func (*Client) ListRepoIssueComments Uses

func (c *Client) ListRepoIssueComments(owner, repo string, opt ListIssueCommentOptions) ([]*Comment, *Response, error)

ListRepoIssueComments list comments for a given repo.

func (*Client) ListRepoIssues Uses

func (c *Client) ListRepoIssues(owner, repo string, opt ListIssueOption) ([]*Issue, *Response, error)

ListRepoIssues returns all issues for a given repository

func (*Client) ListRepoLabels Uses

func (c *Client) ListRepoLabels(owner, repo string, opt ListLabelsOptions) ([]*Label, *Response, error)

ListRepoLabels list labels of one repository

func (*Client) ListRepoMilestones Uses

func (c *Client) ListRepoMilestones(owner, repo string, opt ListMilestoneOption) ([]*Milestone, *Response, error)

ListRepoMilestones list all the milestones of one repository

func (*Client) ListRepoNotifications Uses

func (c *Client) ListRepoNotifications(owner, reponame string, opt ListNotificationOptions) ([]*NotificationThread, *Response, error)

ListRepoNotifications list users's notification threads on a specific repo

func (*Client) ListRepoPullRequests Uses

func (c *Client) ListRepoPullRequests(owner, repo string, opt ListPullRequestsOptions) ([]*PullRequest, *Response, error)

ListRepoPullRequests list PRs of one repository

func (*Client) ListRepoTags Uses

func (c *Client) ListRepoTags(user, repo string, opt ListRepoTagsOptions) ([]*Tag, *Response, error)

ListRepoTags list all the branches of one repository

func (*Client) ListRepoTopics Uses

func (c *Client) ListRepoTopics(user, repo string, opt ListRepoTopicsOptions) ([]string, *Response, error)

ListRepoTopics list all repository's topics

func (*Client) ListStatuses Uses

func (c *Client) ListStatuses(owner, repo, sha string, opt ListStatusesOption) ([]*Status, *Response, error)

ListStatuses returns all statuses for a given Commit

func (*Client) ListTeamMembers Uses

func (c *Client) ListTeamMembers(id int64, opt ListTeamMembersOptions) ([]*User, *Response, error)

ListTeamMembers lists all members of a team

func (*Client) ListTeamRepositories Uses

func (c *Client) ListTeamRepositories(id int64, opt ListTeamRepositoriesOptions) ([]*Repository, *Response, error)

ListTeamRepositories lists all repositories of a team

func (*Client) ListTrackedTimes Uses

func (c *Client) ListTrackedTimes(owner, repo string, index int64, opt ListTrackedTimesOptions) ([]*TrackedTime, *Response, error)

ListTrackedTimes list tracked times of a single issue for a given repository

func (*Client) ListUserOrgs Uses

func (c *Client) ListUserOrgs(user string, opt ListOrgsOptions) ([]*Organization, *Response, error)

ListUserOrgs list all of some user's organizations

func (*Client) ListUserRepos Uses

func (c *Client) ListUserRepos(user string, opt ListReposOptions) ([]*Repository, *Response, error)

ListUserRepos list all repositories of one user by user's name

func (*Client) MergePullRequest Uses

func (c *Client) MergePullRequest(owner, repo string, index int64, opt MergePullRequestOption) (bool, *Response, error)

MergePullRequest merge a PR to repository by PR id

func (*Client) MigrateRepo Uses

func (c *Client) MigrateRepo(opt MigrateRepoOption) (*Repository, *Response, 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 Uses

func (c *Client) MirrorSync(owner, repo string) (*Response, error)

MirrorSync adds a mirrored repository to the mirror sync queue.

func (*Client) PostIssueCommentReaction Uses

func (c *Client) PostIssueCommentReaction(owner, repo string, commentID int64, reaction string) (*Reaction, *Response, error)

PostIssueCommentReaction add a reaction to a comment of an issue

func (*Client) PostIssueReaction Uses

func (c *Client) PostIssueReaction(owner, repo string, index int64, reaction string) (*Reaction, *Response, error)

PostIssueReaction add a reaction to an issue

func (*Client) ReadNotification Uses

func (c *Client) ReadNotification(id int64, status ...NotifyStatus) (*Response, error)

ReadNotification mark notification thread as read by ID It optionally takes a second argument if status has to be set other than 'read'

func (*Client) ReadNotifications Uses

func (c *Client) ReadNotifications(opt MarkNotificationOptions) (*Response, error)

ReadNotifications mark notification threads as read

func (*Client) ReadRepoNotifications Uses

func (c *Client) ReadRepoNotifications(owner, reponame string, opt MarkNotificationOptions) (*Response, error)

ReadRepoNotifications mark notification threads as read on a specific repo

func (*Client) RemoveTeamMember Uses

func (c *Client) RemoveTeamMember(id int64, user string) (*Response, error)

RemoveTeamMember removes a member from a team

func (*Client) RemoveTeamRepository Uses

func (c *Client) RemoveTeamRepository(id int64, org, repo string) (*Response, error)

RemoveTeamRepository removes a repository from a team

func (*Client) ReplaceIssueLabels Uses

func (c *Client) ReplaceIssueLabels(owner, repo string, index int64, opt IssueLabelsOption) ([]*Label, *Response, error)

ReplaceIssueLabels replace old labels of issue with new labels

func (*Client) ResetIssueTime Uses

func (c *Client) ResetIssueTime(owner, repo string, index int64) (*Response, error)

ResetIssueTime reset tracked time of a single issue for a given repository

func (*Client) RunCronTasks Uses

func (c *Client) RunCronTasks(task string) (*Response, error)

RunCronTasks run a cron task

func (*Client) SearchRepos Uses

func (c *Client) SearchRepos(opt SearchRepoOptions) ([]*Repository, *Response, error)

SearchRepos searches for repositories matching the given filters

func (*Client) SearchUsers Uses

func (c *Client) SearchUsers(opt SearchUsersOption) ([]*User, *Response, error)

SearchUsers finds users by query

func (*Client) ServerVersion Uses

func (c *Client) ServerVersion() (string, *Response, error)

ServerVersion returns the version of the server

func (*Client) SetBasicAuth Uses

func (c *Client) SetBasicAuth(username, password string)

SetBasicAuth sets username and password

func (*Client) SetContext Uses

func (c *Client) SetContext(ctx context.Context)

SetContext set context witch is used for http requests

func (*Client) SetHTTPClient Uses

func (c *Client) SetHTTPClient(client *http.Client)

SetHTTPClient replaces default http.Client with user given one.

func (*Client) SetOTP Uses

func (c *Client) SetOTP(otp string)

SetOTP sets OTP for 2FA

func (*Client) SetPublicOrgMembership Uses

func (c *Client) SetPublicOrgMembership(org, user string, visible bool) (*Response, error)

SetPublicOrgMembership publicize/conceal a user's membership

func (*Client) SetRepoTopics Uses

func (c *Client) SetRepoTopics(user, repo string, list []string) (*Response, error)

SetRepoTopics replaces the list of repo's topics

func (*Client) SetSudo Uses

func (c *Client) SetSudo(sudo string)

SetSudo sets username to impersonate.

func (*Client) StartIssueStopWatch Uses

func (c *Client) StartIssueStopWatch(owner, repo string, index int64) (*Response, error)

StartIssueStopWatch starts a stopwatch for an existing issue for a given repository

func (*Client) StopIssueStopWatch Uses

func (c *Client) StopIssueStopWatch(owner, repo string, index int64) (*Response, error)

StopIssueStopWatch stops an existing stopwatch for an issue in a given repository

func (*Client) SubmitPullReview Uses

func (c *Client) SubmitPullReview(owner, repo string, index, id int64, opt SubmitPullReviewOptions) (*PullReview, *Response, error)

SubmitPullReview submit a pending review to an pull request

func (*Client) TransferRepo Uses

func (c *Client) TransferRepo(owner, reponame string, opt TransferRepoOption) (*Repository, *Response, error)

TransferRepo transfers the ownership of a repository

func (*Client) UnWatchRepo Uses

func (c *Client) UnWatchRepo(repoUser, repoName string) (*Response, error)

UnWatchRepo stop to watch a repository

func (*Client) Unfollow Uses

func (c *Client) Unfollow(target string) (*Response, error)

Unfollow set current user unfollow the target

func (*Client) UpdateFile Uses

func (c *Client) UpdateFile(owner, repo, filepath string, opt UpdateFileOptions) (*FileResponse, *Response, error)

UpdateFile update a file in a repository

func (*Client) UpdateOauth2 Uses

func (c *Client) UpdateOauth2(oauth2id int64, opt CreateOauth2Option) (*Oauth2, *Response, error)

UpdateOauth2 a specific Oauth2 Application by ID and return a completed Oauth2 object.

func (*Client) WatchRepo Uses

func (c *Client) WatchRepo(repoUser, repoName string) (*Response, error)

WatchRepo start to watch a repository

type CombinedStatus Uses

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 Uses

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 Uses

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 CommitDateOptions Uses

type CommitDateOptions struct {
    Author    time.Time `json:"author"`
    Committer time.Time `json:"committer"`
}

CommitDateOptions store dates for GIT_AUTHOR_DATE and GIT_COMMITTER_DATE

type CommitMeta Uses

type CommitMeta struct {
    URL     string    `json:"url"`
    SHA     string    `json:"sha"`
    Created time.Time `json:"created"`
}

CommitMeta contains meta information of a commit in terms of API.

type CommitUser Uses

type CommitUser struct {
    Identity
    Date string `json:"date"`
}

CommitUser contains information of a user in the context of a commit.

type ContentsResponse Uses

type ContentsResponse struct {
    Name string `json:"name"`
    Path string `json:"path"`
    SHA  string `json:"sha"`
    // `type` will be `file`, `dir`, `symlink`, or `submodule`
    Type string `json:"type"`
    Size int64  `json:"size"`
    // `encoding` is populated when `type` is `file`, otherwise null
    Encoding *string `json:"encoding"`
    // `content` is populated when `type` is `file`, otherwise null
    Content *string `json:"content"`
    // `target` is populated when `type` is `symlink`, otherwise null
    Target      *string `json:"target"`
    URL         *string `json:"url"`
    HTMLURL     *string `json:"html_url"`
    GitURL      *string `json:"git_url"`
    DownloadURL *string `json:"download_url"`
    // `submodule_git_url` is populated when `type` is `submodule`, otherwise null
    SubmoduleGitURL *string            `json:"submodule_git_url"`
    Links           *FileLinksResponse `json:"_links"`
}

ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content

type CreateAccessTokenOption Uses

type CreateAccessTokenOption struct {
    Name string `json:"name"`
}

CreateAccessTokenOption options when create access token

type CreateBranchOption Uses

type CreateBranchOption struct {
    // Name of the branch to create
    BranchName string `json:"new_branch_name"`
    // Name of the old branch to create from (optional)
    OldBranchName string `json:"old_branch_name"`
}

CreateBranchOption options when creating a branch in a repository

func (CreateBranchOption) Validate Uses

func (opt CreateBranchOption) Validate() error

Validate the CreateBranchOption struct

type CreateBranchProtectionOption Uses

type CreateBranchProtectionOption struct {
    BranchName                  string   `json:"branch_name"`
    EnablePush                  bool     `json:"enable_push"`
    EnablePushWhitelist         bool     `json:"enable_push_whitelist"`
    PushWhitelistUsernames      []string `json:"push_whitelist_usernames"`
    PushWhitelistTeams          []string `json:"push_whitelist_teams"`
    PushWhitelistDeployKeys     bool     `json:"push_whitelist_deploy_keys"`
    EnableMergeWhitelist        bool     `json:"enable_merge_whitelist"`
    MergeWhitelistUsernames     []string `json:"merge_whitelist_usernames"`
    MergeWhitelistTeams         []string `json:"merge_whitelist_teams"`
    EnableStatusCheck           bool     `json:"enable_status_check"`
    StatusCheckContexts         []string `json:"status_check_contexts"`
    RequiredApprovals           int64    `json:"required_approvals"`
    EnableApprovalsWhitelist    bool     `json:"enable_approvals_whitelist"`
    ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
    ApprovalsWhitelistTeams     []string `json:"approvals_whitelist_teams"`
    BlockOnRejectedReviews      bool     `json:"block_on_rejected_reviews"`
    BlockOnOutdatedBranch       bool     `json:"block_on_outdated_branch"`
    DismissStaleApprovals       bool     `json:"dismiss_stale_approvals"`
    RequireSignedCommits        bool     `json:"require_signed_commits"`
    ProtectedFilePatterns       string   `json:"protected_file_patterns"`
}

CreateBranchProtectionOption options for creating a branch protection

type CreateEmailOption Uses

type CreateEmailOption struct {
    // email addresses to add
    Emails []string `json:"emails"`
}

CreateEmailOption options when creating email addresses

type CreateFileOptions Uses

type CreateFileOptions struct {
    FileOptions
    // content must be base64 encoded
    // required: true
    Content string `json:"content"`
}

CreateFileOptions options for creating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)

type CreateForkOption Uses

type CreateForkOption struct {
    // organization name, if forking into an organization
    Organization *string `json:"organization"`
}

CreateForkOption options for creating a fork

type CreateGPGKeyOption Uses

type CreateGPGKeyOption struct {
    // An armored GPG key to add
    //
    ArmoredKey string `json:"armored_public_key"`
}

CreateGPGKeyOption options create user GPG key

type CreateHookOption Uses

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

func (CreateHookOption) Validate Uses

func (opt CreateHookOption) Validate() error

Validate the CreateHookOption struct

type CreateIssueCommentOption Uses

type CreateIssueCommentOption struct {
    Body string `json:"body"`
}

CreateIssueCommentOption options for creating a comment on an issue

func (CreateIssueCommentOption) Validate Uses

func (opt CreateIssueCommentOption) Validate() error

Validate the CreateIssueCommentOption struct

type CreateIssueOption Uses

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

func (CreateIssueOption) Validate Uses

func (opt CreateIssueOption) Validate() error

Validate the CreateIssueOption struct

type CreateKeyOption Uses

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 Uses

type CreateLabelOption struct {
    Name string `json:"name"`
    // example: #00aabb
    Color       string `json:"color"`
    Description string `json:"description"`
}

CreateLabelOption options for creating a label

func (CreateLabelOption) Validate Uses

func (opt CreateLabelOption) Validate() error

Validate the CreateLabelOption struct

type CreateMilestoneOption Uses

type CreateMilestoneOption struct {
    Title       string     `json:"title"`
    Description string     `json:"description"`
    State       StateType  `json:"state"`
    Deadline    *time.Time `json:"due_on"`
}

CreateMilestoneOption options for creating a milestone

func (CreateMilestoneOption) Validate Uses

func (opt CreateMilestoneOption) Validate() error

Validate the CreateMilestoneOption struct

type CreateOauth2Option Uses

type CreateOauth2Option struct {
    Name         string   `json:"name"`
    RedirectURIs []string `json:"redirect_uris"`
}

CreateOauth2Option required options for creating an Application

type CreateOrgOption Uses

type CreateOrgOption struct {
    Name        string      `json:"username"`
    FullName    string      `json:"full_name"`
    Description string      `json:"description"`
    Website     string      `json:"website"`
    Location    string      `json:"location"`
    Visibility  VisibleType `json:"visibility"`
}

CreateOrgOption options for creating an organization

func (CreateOrgOption) Validate Uses

func (opt CreateOrgOption) Validate() error

Validate the CreateOrgOption struct

type CreatePullRequestOption Uses

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 CreatePullReviewComment Uses

type CreatePullReviewComment struct {
    // the tree path
    Path string `json:"path"`
    Body string `json:"body"`
    // if comment to old file line or 0
    OldLineNum int64 `json:"old_position"`
    // if comment to new file line or 0
    NewLineNum int64 `json:"new_position"`
}

CreatePullReviewComment represent a review comment for creation api

func (CreatePullReviewComment) Validate Uses

func (opt CreatePullReviewComment) Validate() error

Validate the CreatePullReviewComment struct

type CreatePullReviewOptions Uses

type CreatePullReviewOptions struct {
    State    ReviewStateType           `json:"event"`
    Body     string                    `json:"body"`
    CommitID string                    `json:"commit_id"`
    Comments []CreatePullReviewComment `json:"comments"`
}

CreatePullReviewOptions are options to create a pull review

func (CreatePullReviewOptions) Validate Uses

func (opt CreatePullReviewOptions) Validate() error

Validate the CreatePullReviewOptions struct

type CreateReleaseOption Uses

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

func (CreateReleaseOption) Validate Uses

func (opt CreateReleaseOption) Validate() error

Validate the CreateReleaseOption struct

type CreateRepoOption Uses

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"`
    // DefaultBranch of the repository (used when initializes and in template)
    DefaultBranch string `json:"default_branch"`
}

CreateRepoOption options when creating repository

func (CreateRepoOption) Validate Uses

func (opt CreateRepoOption) Validate() error

Validate the CreateRepoOption struct

type CreateStatusOption Uses

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 Uses

type CreateTeamOption struct {
    Name                    string     `json:"name"`
    Description             string     `json:"description"`
    Permission              AccessMode `json:"permission"`
    CanCreateOrgRepo        bool       `json:"can_create_org_repo"`
    IncludesAllRepositories bool       `json:"includes_all_repositories"`
    // 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

func (CreateTeamOption) Validate Uses

func (opt CreateTeamOption) Validate() error

Validate the CreateTeamOption struct

type CreateUserOption Uses

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

func (CreateUserOption) Validate Uses

func (opt CreateUserOption) Validate() error

Validate the CreateUserOption struct

type CronTask Uses

type CronTask struct {
    Name      string    `json:"name"`
    Schedule  string    `json:"schedule"`
    Next      time.Time `json:"next"`
    Prev      time.Time `json:"prev"`
    ExecTimes int64     `json:"exec_times"`
}

CronTask represents a Cron task

type DeleteEmailOption Uses

type DeleteEmailOption struct {
    // email addresses to delete
    Emails []string `json:"emails"`
}

DeleteEmailOption options when deleting email addresses

type DeleteFileOptions Uses

type DeleteFileOptions struct {
    FileOptions
    // sha is the SHA for the file that already exists
    // required: true
    SHA string `json:"sha"`
}

DeleteFileOptions options for deleting files (used for other File structs below) Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)

type DeployKey Uses

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 Uses

type EditAttachmentOptions struct {
    Name string `json:"name"`
}

EditAttachmentOptions options for editing attachments

type EditBranchProtectionOption Uses

type EditBranchProtectionOption struct {
    EnablePush                  *bool    `json:"enable_push"`
    EnablePushWhitelist         *bool    `json:"enable_push_whitelist"`
    PushWhitelistUsernames      []string `json:"push_whitelist_usernames"`
    PushWhitelistTeams          []string `json:"push_whitelist_teams"`
    PushWhitelistDeployKeys     *bool    `json:"push_whitelist_deploy_keys"`
    EnableMergeWhitelist        *bool    `json:"enable_merge_whitelist"`
    MergeWhitelistUsernames     []string `json:"merge_whitelist_usernames"`
    MergeWhitelistTeams         []string `json:"merge_whitelist_teams"`
    EnableStatusCheck           *bool    `json:"enable_status_check"`
    StatusCheckContexts         []string `json:"status_check_contexts"`
    RequiredApprovals           *int64   `json:"required_approvals"`
    EnableApprovalsWhitelist    *bool    `json:"enable_approvals_whitelist"`
    ApprovalsWhitelistUsernames []string `json:"approvals_whitelist_username"`
    ApprovalsWhitelistTeams     []string `json:"approvals_whitelist_teams"`
    BlockOnRejectedReviews      *bool    `json:"block_on_rejected_reviews"`
    BlockOnOutdatedBranch       *bool    `json:"block_on_outdated_branch"`
    DismissStaleApprovals       *bool    `json:"dismiss_stale_approvals"`
    RequireSignedCommits        *bool    `json:"require_signed_commits"`
    ProtectedFilePatterns       *string  `json:"protected_file_patterns"`
}

EditBranchProtectionOption options for editing a branch protection

type EditGitHookOption Uses

type EditGitHookOption struct {
    Content string `json:"content"`
}

EditGitHookOption options when modifying one Git hook

type EditHookOption Uses

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 Uses

type EditIssueCommentOption struct {
    Body string `json:"body"`
}

EditIssueCommentOption options for editing a comment

func (EditIssueCommentOption) Validate Uses

func (opt EditIssueCommentOption) Validate() error

Validate the EditIssueCommentOption struct

type EditIssueOption Uses

type EditIssueOption struct {
    Title     string     `json:"title"`
    Body      *string    `json:"body"`
    Assignee  *string    `json:"assignee"`
    Assignees []string   `json:"assignees"`
    Milestone *int64     `json:"milestone"`
    State     *StateType `json:"state"`
    Deadline  *time.Time `json:"due_date"`
}

EditIssueOption options for editing an issue

func (EditIssueOption) Validate Uses

func (opt EditIssueOption) Validate() error

Validate the EditIssueOption struct

type EditLabelOption Uses

type EditLabelOption struct {
    Name        *string `json:"name"`
    Color       *string `json:"color"`
    Description *string `json:"description"`
}

EditLabelOption options for editing a label

func (EditLabelOption) Validate Uses

func (opt EditLabelOption) Validate() error

Validate the EditLabelOption struct

type EditMilestoneOption Uses

type EditMilestoneOption struct {
    Title       string     `json:"title"`
    Description *string    `json:"description"`
    State       *StateType `json:"state"`
    Deadline    *time.Time `json:"due_on"`
}

EditMilestoneOption options for editing a milestone

func (EditMilestoneOption) Validate Uses

func (opt EditMilestoneOption) Validate() error

Validate the EditMilestoneOption struct

type EditOrgOption Uses

type EditOrgOption struct {
    FullName    string      `json:"full_name"`
    Description string      `json:"description"`
    Website     string      `json:"website"`
    Location    string      `json:"location"`
    Visibility  VisibleType `json:"visibility"`
}

EditOrgOption options for editing an organization

func (EditOrgOption) Validate Uses

func (opt EditOrgOption) Validate() error

Validate the EditOrgOption struct

type EditPullRequestOption Uses

type EditPullRequestOption struct {
    Title     string     `json:"title"`
    Body      string     `json:"body"`
    Base      string     `json:"base"`
    Assignee  string     `json:"assignee"`
    Assignees []string   `json:"assignees"`
    Milestone int64      `json:"milestone"`
    Labels    []int64    `json:"labels"`
    State     *StateType `json:"state"`
    Deadline  *time.Time `json:"due_date"`
}

EditPullRequestOption options when modify pull request

func (EditPullRequestOption) Validate Uses

func (opt EditPullRequestOption) Validate(c *Client) error

Validate the EditPullRequestOption struct

type EditReleaseOption Uses

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 Uses

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 Uses

type EditTeamOption struct {
    Name                    string     `json:"name"`
    Description             *string    `json:"description"`
    Permission              AccessMode `json:"permission"`
    CanCreateOrgRepo        *bool      `json:"can_create_org_repo"`
    IncludesAllRepositories *bool      `json:"includes_all_repositories"`
    // 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

func (EditTeamOption) Validate Uses

func (opt EditTeamOption) Validate() error

Validate the EditTeamOption struct

type EditUserOption Uses

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 Uses

type Email struct {
    Email    string `json:"email"`
    Verified bool   `json:"verified"`
    Primary  bool   `json:"primary"`
}

Email an email address belonging to a user

type FileCommitResponse Uses

type FileCommitResponse struct {
    CommitMeta
    HTMLURL   string        `json:"html_url"`
    Author    *CommitUser   `json:"author"`
    Committer *CommitUser   `json:"committer"`
    Parents   []*CommitMeta `json:"parents"`
    Message   string        `json:"message"`
    Tree      *CommitMeta   `json:"tree"`
}

FileCommitResponse contains information generated from a Git commit for a repo's file.

type FileDeleteResponse Uses

type FileDeleteResponse struct {
    Content      interface{}                `json:"content"` // to be set to nil
    Commit       *FileCommitResponse        `json:"commit"`
    Verification *PayloadCommitVerification `json:"verification"`
}

FileDeleteResponse contains information about a repo's file that was deleted

type FileLinksResponse Uses

type FileLinksResponse struct {
    Self    *string `json:"self"`
    GitURL  *string `json:"git"`
    HTMLURL *string `json:"html"`
}

FileLinksResponse contains the links for a repo's file

type FileOptions Uses

type FileOptions struct {
    // message (optional) for the commit of this file. if not supplied, a default message will be used
    Message string `json:"message"`
    // branch (optional) to base this file from. if not given, the default branch is used
    BranchName string `json:"branch"`
    // new_branch (optional) will make a new branch from `branch` before creating the file
    NewBranchName string `json:"new_branch"`
    // `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)
    Author    Identity          `json:"author"`
    Committer Identity          `json:"committer"`
    Dates     CommitDateOptions `json:"dates"`
}

FileOptions options for all file APIs

type FileResponse Uses

type FileResponse struct {
    Content      *ContentsResponse          `json:"content"`
    Commit       *FileCommitResponse        `json:"commit"`
    Verification *PayloadCommitVerification `json:"verification"`
}

FileResponse contains information about a repo's file

type GPGKey Uses

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 Uses

type GPGKeyEmail struct {
    Email    string `json:"email"`
    Verified bool   `json:"verified"`
}

GPGKeyEmail an email attached to a GPGKey

type GitBlobResponse Uses

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 Uses

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 Uses

type GitHook struct {
    Name     string `json:"name"`
    IsActive bool   `json:"is_active"`
    Content  string `json:"content,omitempty"`
}

GitHook represents a Git repository hook

type GitObject Uses

type GitObject struct {
    Type string `json:"type"`
    SHA  string `json:"sha"`
    URL  string `json:"url"`
}

GitObject represents a Git object.

type GitServiceType Uses

type GitServiceType string

GitServiceType represents a git service

const (
    // GitServicePlain represents a plain git service
    GitServicePlain GitServiceType = "git"
    //GitServiceGithub represents github.com
    GitServiceGithub GitServiceType = "github"
    // GitServiceGitlab represents a gitlab service
    GitServiceGitlab GitServiceType = "gitlab"
)

type GitTreeResponse Uses

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 GlobalAPISettings Uses

type GlobalAPISettings struct {
    MaxResponseItems       int   `json:"max_response_items"`
    DefaultPagingNum       int   `json:"default_paging_num"`
    DefaultGitTreesPerPage int   `json:"default_git_trees_per_page"`
    DefaultMaxBlobSize     int64 `json:"default_max_blob_size"`
}

GlobalAPISettings contains global api settings exposed by it

type GlobalAttachmentSettings Uses

type GlobalAttachmentSettings struct {
    Enabled      bool   `json:"enabled"`
    AllowedTypes string `json:"allowed_types"`
    MaxSize      int64  `json:"max_size"`
    MaxFiles     int    `json:"max_files"`
}

GlobalAttachmentSettings contains global Attachment settings exposed by API

type GlobalRepoSettings Uses

type GlobalRepoSettings struct {
    MirrorsDisabled bool `json:"mirrors_disabled"`
    HTTPGitDisabled bool `json:"http_git_disabled"`
}

GlobalRepoSettings represent the global repository settings of a gitea instance witch is exposed by API

type GlobalUISettings Uses

type GlobalUISettings struct {
    AllowedReactions []string `json:"allowed_reactions"`
}

GlobalUISettings represent the global ui settings of a gitea instance witch is exposed by API

type Hook Uses

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 Identity Uses

type Identity struct {
    Name  string `json:"name"`
    Email string `json:"email"`
}

Identity for a person's identity like an author or committer

type Issue Uses

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"`
    IsLocked    bool             `json:"is_locked"`
    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"`
    Repository  *RepositoryMeta  `json:"repository"`
}

Issue represents an issue in a repository

type IssueLabelsOption Uses

type IssueLabelsOption struct {
    // list of label IDs
    Labels []int64 `json:"labels"`
}

IssueLabelsOption a collection of labels

type IssueType Uses

type IssueType string

IssueType is issue a pull or only an issue

const (
    // IssueTypeAll pr and issue
    IssueTypeAll IssueType = ""
    // IssueTypeIssue only issues
    IssueTypeIssue IssueType = "issues"
    // IssueTypePull only pulls
    IssueTypePull IssueType = "pulls"
)

type Label Uses

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 ListAccessTokensOptions Uses

type ListAccessTokensOptions struct {
    ListOptions
}

ListAccessTokensOptions options for listing a users's access tokens

type ListBranchProtectionsOptions Uses

type ListBranchProtectionsOptions struct {
    ListOptions
}

ListBranchProtectionsOptions list branch protection options

type ListCollaboratorsOptions Uses

type ListCollaboratorsOptions struct {
    ListOptions
}

ListCollaboratorsOptions options for listing a repository's collaborators

type ListCommitOptions Uses

type ListCommitOptions struct {
    ListOptions
    //SHA or branch to start listing commits from (usually 'master')
    SHA string
}

ListCommitOptions list commit options

func (*ListCommitOptions) QueryEncode Uses

func (opt *ListCommitOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListCronTaskOptions Uses

type ListCronTaskOptions struct {
    ListOptions
}

ListCronTaskOptions list options for ListCronTasks

type ListDeployKeysOptions Uses

type ListDeployKeysOptions struct {
    ListOptions
    KeyID       int64
    Fingerprint string
}

ListDeployKeysOptions options for listing a repository's deploy keys

func (*ListDeployKeysOptions) QueryEncode Uses

func (opt *ListDeployKeysOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListEmailsOptions Uses

type ListEmailsOptions struct {
    ListOptions
}

ListEmailsOptions options for listing current's user emails

type ListFollowersOptions Uses

type ListFollowersOptions struct {
    ListOptions
}

ListFollowersOptions options for listing followers

type ListFollowingOptions Uses

type ListFollowingOptions struct {
    ListOptions
}

ListFollowingOptions options for listing a user's users being followed

type ListForksOptions Uses

type ListForksOptions struct {
    ListOptions
}

ListForksOptions options for listing repository's forks

type ListGPGKeysOptions Uses

type ListGPGKeysOptions struct {
    ListOptions
}

ListGPGKeysOptions options for listing a user's GPGKeys

type ListHooksOptions Uses

type ListHooksOptions struct {
    ListOptions
}

ListHooksOptions options for listing hooks

type ListIssueCommentOptions Uses

type ListIssueCommentOptions struct {
    ListOptions
    Since  time.Time
    Before time.Time
}

ListIssueCommentOptions list comment options

func (*ListIssueCommentOptions) QueryEncode Uses

func (opt *ListIssueCommentOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListIssueOption Uses

type ListIssueOption struct {
    ListOptions
    State      StateType
    Type       IssueType
    Labels     []string
    Milestones []string
    KeyWord    string
}

ListIssueOption list issue options

func (*ListIssueOption) QueryEncode Uses

func (opt *ListIssueOption) QueryEncode() string

QueryEncode turns options into querystring argument

type ListLabelsOptions Uses

type ListLabelsOptions struct {
    ListOptions
}

ListLabelsOptions options for listing repository's labels

type ListMilestoneOption Uses

type ListMilestoneOption struct {
    ListOptions
    // open, closed, all
    State StateType
    Name  string
}

ListMilestoneOption list milestone options

func (*ListMilestoneOption) QueryEncode Uses

func (opt *ListMilestoneOption) QueryEncode() string

QueryEncode turns options into querystring argument

type ListNotificationOptions Uses

type ListNotificationOptions struct {
    ListOptions
    Since  time.Time
    Before time.Time
    Status []NotifyStatus
}

ListNotificationOptions represents the filter options

func (*ListNotificationOptions) QueryEncode Uses

func (opt *ListNotificationOptions) QueryEncode() string

QueryEncode encode options to url query

func (ListNotificationOptions) Validate Uses

func (opt ListNotificationOptions) Validate(c *Client) error

Validate the CreateUserOption struct

type ListOauth2Option Uses

type ListOauth2Option struct {
    ListOptions
}

ListOauth2Option for listing Oauth2 Applications

type ListOptions Uses

type ListOptions struct {
    Page     int
    PageSize int
}

ListOptions options for using Gitea's API pagination

type ListOrgMembershipOption Uses

type ListOrgMembershipOption struct {
    ListOptions
}

ListOrgMembershipOption list OrgMembership options

type ListOrgReposOptions Uses

type ListOrgReposOptions struct {
    ListOptions
}

ListOrgReposOptions options for a organization's repositories

type ListOrgsOptions Uses

type ListOrgsOptions struct {
    ListOptions
}

ListOrgsOptions options for listing organizations

type ListPublicKeysOptions Uses

type ListPublicKeysOptions struct {
    ListOptions
}

ListPublicKeysOptions options for listing a user's PublicKeys

type ListPullRequestsOptions Uses

type ListPullRequestsOptions struct {
    ListOptions
    State StateType `json:"state"`
    // oldest, recentupdate, leastupdate, mostcomment, leastcomment, priority
    Sort      string
    Milestone int64
}

ListPullRequestsOptions options for listing pull requests

func (*ListPullRequestsOptions) QueryEncode Uses

func (opt *ListPullRequestsOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListPullReviewsOptions Uses

type ListPullReviewsOptions struct {
    ListOptions
}

ListPullReviewsOptions options for listing PullReviews

type ListReleaseAttachmentsOptions Uses

type ListReleaseAttachmentsOptions struct {
    ListOptions
}

ListReleaseAttachmentsOptions options for listing release's attachments

type ListReleasesOptions Uses

type ListReleasesOptions struct {
    ListOptions
}

ListReleasesOptions options for listing repository's releases

type ListRepoBranchesOptions Uses

type ListRepoBranchesOptions struct {
    ListOptions
}

ListRepoBranchesOptions options for listing a repository's branches

type ListRepoGitHooksOptions Uses

type ListRepoGitHooksOptions struct {
    ListOptions
}

ListRepoGitHooksOptions options for listing repository's githooks

type ListRepoTagsOptions Uses

type ListRepoTagsOptions struct {
    ListOptions
}

ListRepoTagsOptions options for listing a repository's tags

type ListRepoTopicsOptions Uses

type ListRepoTopicsOptions struct {
    ListOptions
}

ListRepoTopicsOptions options for listing repo's topics

type ListReposOptions Uses

type ListReposOptions struct {
    ListOptions
}

ListReposOptions options for listing repositories

type ListStatusesOption Uses

type ListStatusesOption struct {
    ListOptions
}

ListStatusesOption options for listing a repository's commit's statuses

type ListTeamMembersOptions Uses

type ListTeamMembersOptions struct {
    ListOptions
}

ListTeamMembersOptions options for listing team's members

type ListTeamRepositoriesOptions Uses

type ListTeamRepositoriesOptions struct {
    ListOptions
}

ListTeamRepositoriesOptions options for listing team's repositories

type ListTeamsOptions Uses

type ListTeamsOptions struct {
    ListOptions
}

ListTeamsOptions options for listing teams

type ListTrackedTimesOptions Uses

type ListTrackedTimesOptions struct {
    ListOptions
}

ListTrackedTimesOptions options for listing repository's tracked times

type MarkNotificationOptions Uses

type MarkNotificationOptions struct {
    LastReadAt time.Time
    Status     []NotifyStatus
    ToStatus   NotifyStatus
}

MarkNotificationOptions represents the filter & modify options

func (*MarkNotificationOptions) QueryEncode Uses

func (opt *MarkNotificationOptions) QueryEncode() string

QueryEncode encode options to url query

func (MarkNotificationOptions) Validate Uses

func (opt MarkNotificationOptions) Validate(c *Client) error

Validate the CreateUserOption struct

type MergePullRequestOption Uses

type MergePullRequestOption struct {
    Style   MergeStyle `json:"Do"`
    Title   string     `json:"MergeTitleField"`
    Message string     `json:"MergeMessageField"`
}

MergePullRequestOption options when merging a pull request

func (MergePullRequestOption) Validate Uses

func (opt MergePullRequestOption) Validate(c *Client) error

Validate the MergePullRequestOption struct

type MergeStyle Uses

type MergeStyle string

MergeStyle is used specify how a pull is merged

const (
    // MergeStyleMerge merge pull as usual
    MergeStyleMerge MergeStyle = "merge"
    // MergeStyleRebase rebase pull
    MergeStyleRebase MergeStyle = "rebase"
    // MergeStyleRebaseMerge rebase and merge pull
    MergeStyleRebaseMerge MergeStyle = "rebase-merge"
    // MergeStyleSquash squash and merge pull
    MergeStyleSquash MergeStyle = "squash"
)

type MigrateRepoOption Uses

type MigrateRepoOption struct {
    RepoName  string `json:"repo_name"`
    RepoOwner string `json:"repo_owner"`
    // deprecated use RepoOwner
    RepoOwnerID  int64          `json:"uid"`
    CloneAddr    string         `json:"clone_addr"`
    Service      GitServiceType `json:"service"`
    AuthUsername string         `json:"auth_username"`
    AuthPassword string         `json:"auth_password"`
    AuthToken    string         `json:"auth_token"`
    Mirror       bool           `json:"mirror"`
    Private      bool           `json:"private"`
    Description  string         `json:"description"`
    Wiki         bool           `json:"wiki"`
    Milestones   bool           `json:"milestones"`
    Labels       bool           `json:"labels"`
    Issues       bool           `json:"issues"`
    PullRequests bool           `json:"pull_requests"`
    Releases     bool           `json:"releases"`
}

MigrateRepoOption options for migrating a repository from an external service

func (*MigrateRepoOption) Validate Uses

func (opt *MigrateRepoOption) Validate() error

Validate the MigrateRepoOption struct

type Milestone Uses

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"`
    Created      time.Time  `json:"created_at"`
    Updated      *time.Time `json:"updated_at"`
    Closed       *time.Time `json:"closed_at"`
    Deadline     *time.Time `json:"due_on"`
}

Milestone milestone is a collection of issues on one repository

type NotificationSubject Uses

type NotificationSubject struct {
    Title            string    `json:"title"`
    URL              string    `json:"url"`
    LatestCommentURL string    `json:"latest_comment_url"`
    Type             string    `json:"type"`
    State            StateType `json:"state"`
}

NotificationSubject contains the notification subject (Issue/Pull/Commit)

type NotificationThread Uses

type NotificationThread struct {
    ID         int64                `json:"id"`
    Repository *Repository          `json:"repository"`
    Subject    *NotificationSubject `json:"subject"`
    Unread     bool                 `json:"unread"`
    Pinned     bool                 `json:"pinned"`
    UpdatedAt  time.Time            `json:"updated_at"`
    URL        string               `json:"url"`
}

NotificationThread expose Notification on API

type NotifyStatus Uses

type NotifyStatus string

NotifyStatus notification status type

const (
    // NotifyStatusUnread was not read
    NotifyStatusUnread NotifyStatus = "unread"
    // NotifyStatusRead was already read by user
    NotifyStatusRead NotifyStatus = "read"
    // NotifyStatusPinned notification is pinned by user
    NotifyStatusPinned NotifyStatus = "pinned"
)

type Oauth2 Uses

type Oauth2 struct {
    ID           int64     `json:"id"`
    Name         string    `json:"name"`
    ClientID     string    `json:"client_id"`
    ClientSecret string    `json:"client_secret"`
    RedirectURIs []string  `json:"redirect_uris"`
    Created      time.Time `json:"created"`
}

Oauth2 represents an Oauth2 Application

type Organization Uses

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 Uses

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 Uses

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 Uses

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 Uses

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 Uses

type Permission struct {
    Admin bool `json:"admin"`
    Push  bool `json:"push"`
    Pull  bool `json:"pull"`
}

Permission represents a set of permissions

type PublicKey Uses

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 Uses

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"`
    IsLocked  bool       `json:"is_locked"`
    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 Uses

type PullRequestMeta struct {
    HasMerged bool       `json:"merged"`
    Merged    *time.Time `json:"merged_at"`
}

PullRequestMeta PR info if an issue is a PR

type PullReview Uses

type PullReview struct {
    ID                int64           `json:"id"`
    Reviewer          *User           `json:"user"`
    State             ReviewStateType `json:"state"`
    Body              string          `json:"body"`
    CommitID          string          `json:"commit_id"`
    Stale             bool            `json:"stale"`
    Official          bool            `json:"official"`
    CodeCommentsCount int             `json:"comments_count"`
    Submitted         time.Time       `json:"submitted_at"`

    HTMLURL     string `json:"html_url"`
    HTMLPullURL string `json:"pull_request_url"`
}

PullReview represents a pull request review

type PullReviewComment Uses

type PullReviewComment struct {
    ID       int64  `json:"id"`
    Body     string `json:"body"`
    Reviewer *User  `json:"user"`
    ReviewID int64  `json:"pull_request_review_id"`

    Created time.Time `json:"created_at"`
    Updated time.Time `json:"updated_at"`

    Path         string `json:"path"`
    CommitID     string `json:"commit_id"`
    OrigCommitID string `json:"original_commit_id"`
    DiffHunk     string `json:"diff_hunk"`
    LineNum      uint64 `json:"position"`
    OldLineNum   uint64 `json:"original_position"`

    HTMLURL     string `json:"html_url"`
    HTMLPullURL string `json:"pull_request_url"`
}

PullReviewComment represents a comment on a pull request review

type Reaction Uses

type Reaction struct {
    User     *User     `json:"user"`
    Reaction string    `json:"content"`
    Created  time.Time `json:"created_at"`
}

Reaction contain one reaction

type Reference Uses

type Reference struct {
    Ref    string     `json:"ref"`
    URL    string     `json:"url"`
    Object *GitObject `json:"object"`
}

Reference represents a Git reference.

type Release Uses

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 Uses

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 RepoType Uses

type RepoType string

RepoType represent repo type

const (
    // RepoTypeNone dont specify a type
    RepoTypeNone RepoType = ""
    // RepoTypeSource is the default repo type
    RepoTypeSource RepoType = "source"
    // RepoTypeFork is a repo witch was forked from an other one
    RepoTypeFork RepoType = "fork"
    // RepoTypeMirror represents an mirror repo
    RepoTypeMirror RepoType = "mirror"
)

type Repository Uses

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 RepositoryMeta Uses

type RepositoryMeta struct {
    ID       int64  `json:"id"`
    Name     string `json:"name"`
    Owner    string `json:"owner"`
    FullName string `json:"full_name"`
}

RepositoryMeta basic repository information

type Response Uses

type Response struct {
    *http.Response
}

Response represents the gitea response

type ReviewStateType Uses

type ReviewStateType string

ReviewStateType review state type

const (
    // ReviewStateApproved pr is approved
    ReviewStateApproved ReviewStateType = "APPROVED"
    // ReviewStatePending pr state is pending
    ReviewStatePending ReviewStateType = "PENDING"
    // ReviewStateComment is a comment review
    ReviewStateComment ReviewStateType = "COMMENT"
    // ReviewStateRequestChanges changes for pr are requested
    ReviewStateRequestChanges ReviewStateType = "REQUEST_CHANGES"
    // ReviewStateRequestReview review is requested from user
    ReviewStateRequestReview ReviewStateType = "REQUEST_REVIEW"
    // ReviewStateUnknown state of pr is unknown
    ReviewStateUnknown ReviewStateType = ""
)

type SearchRepoOptions Uses

type SearchRepoOptions struct {
    ListOptions

    // The keyword to query
    Keyword string
    // Limit search to repositories with keyword as topic
    KeywordIsTopic bool
    // Include search of keyword within repository description
    KeywordInDescription bool

    // Repo Owner
    OwnerID int64
    // Stared By UserID
    StarredByUserID int64

    // pubic, private or all repositories (defaults to all)
    IsPrivate *bool
    // archived, non-archived or all repositories (defaults to all)
    IsArchived *bool
    // Exclude template repos from search
    ExcludeTemplate bool
    // Filter by "fork", "source", "mirror"
    Type RepoType

    // sort repos by attribute. Supported values are "alpha", "created", "updated", "size", and "id". Default is "alpha"
    Sort string
    // sort order, either "asc" (ascending) or "desc" (descending). Default is "asc", ignored if "sort" is not specified.
    Order string
    // Repo owner to prioritize in the results
    PrioritizedByOwnerID int64

    /*
    	Cover EdgeCases
    */
    // if set all other options are ignored and this string is used as query
    RawQuery string
}

SearchRepoOptions options for searching repositories

func (*SearchRepoOptions) QueryEncode Uses

func (opt *SearchRepoOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type SearchUsersOption Uses

type SearchUsersOption struct {
    ListOptions
    KeyWord string
}

SearchUsersOption options for SearchUsers

func (*SearchUsersOption) QueryEncode Uses

func (opt *SearchUsersOption) QueryEncode() string

QueryEncode turns options into querystring argument

type StateType Uses

type StateType string

StateType issue state type

const (
    // StateOpen pr/issue is opend
    StateOpen StateType = "open"
    // StateClosed pr/issue is closed
    StateClosed StateType = "closed"
    // StateAll is all
    StateAll StateType = "all"
)

type Status Uses

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 Uses

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 StopWatch Uses

type StopWatch struct {
    Created    time.Time `json:"created"`
    IssueIndex int64     `json:"issue_index"`
}

StopWatch represents a running stopwatch of an issue / pr

type SubmitPullReviewOptions Uses

type SubmitPullReviewOptions struct {
    State ReviewStateType `json:"event"`
    Body  string          `json:"body"`
}

SubmitPullReviewOptions are options to submit a pending pull review

func (SubmitPullReviewOptions) Validate Uses

func (opt SubmitPullReviewOptions) Validate() error

Validate the SubmitPullReviewOptions struct

type Tag Uses

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 Uses

type Team struct {
    ID                      int64         `json:"id"`
    Name                    string        `json:"name"`
    Description             string        `json:"description"`
    Organization            *Organization `json:"organization"`
    Permission              AccessMode    `json:"permission"`
    CanCreateOrgRepo        bool          `json:"can_create_org_repo"`
    IncludesAllRepositories bool          `json:"includes_all_repositories"`
    // 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 TrackedTime Uses

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 TransferRepoOption Uses

type TransferRepoOption struct {
    // required: true
    NewOwner string `json:"new_owner"`
    // ID of the team or teams to add to the repository. Teams can only be added to organization-owned repositories.
    TeamIDs *[]int64 `json:"team_ids"`
}

TransferRepoOption options when transfer a repository's ownership

type UpdateFileOptions Uses

type UpdateFileOptions struct {
    FileOptions
    // sha is the SHA for the file that already exists
    // required: true
    SHA string `json:"sha"`
    // content must be base64 encoded
    // required: true
    Content string `json:"content"`
    // from_path (optional) is the path of the original file which will be moved/renamed to the path in the URL
    FromPath string `json:"from_path"`
}

UpdateFileOptions options for updating files Note: `author` and `committer` are optional (if only one is given, it will be used for the other, otherwise the authenticated user will be used)

type User Uses

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 Uses

type VisibleType string

VisibleType defines the visibility

const (
    // VisibleTypePublic Visible for everyone
    VisibleTypePublic VisibleType = "public"

    // VisibleTypeLimited Visible for every connected user
    VisibleTypeLimited VisibleType = "limited"

    // VisibleTypePrivate Visible only for organization's members
    VisibleTypePrivate VisibleType = "private"
)

type WatchInfo Uses

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

Package gitea imports 16 packages (graph) and is imported by 100 packages. Updated 2020-10-19. Refresh now. Tools for package owners.