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

package gitea

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

Index

Package Files

admin_org.go admin_repo.go admin_user.go attachment.go doc.go fork.go gitea.go hook.go issue.go issue_comment.go issue_label.go issue_milestone.go issue_tracked_time.go lfs_lock.go miscellaneous.go org.go org_member.go org_team.go pull.go release.go repo.go repo_branch.go repo_collaborator.go repo_file.go repo_key.go repo_watch.go status.go user.go user_app.go user_email.go user_follow.go user_gpgkey.go user_key.go user_search.go utils.go

Variables

var (
    // ErrInvalidReceiveHook FIXME
    ErrInvalidReceiveHook = errors.New("Invalid JSON payload received over webhook")
)

func BasicAuthEncode Uses

func BasicAuthEncode(user, pass string) string

BasicAuthEncode generate base64 of basic auth head

func Bool Uses

func Bool(v bool) *bool

Bool return address of bool value

func Int64 Uses

func Int64(v int64) *int64

Int64 return address of int64 value

func String Uses

func String(v string) *string

String return address of string value

func Version Uses

func Version() string

Version return the library version

type AccessToken Uses

type AccessToken struct {
    Name string `json:"name"`
    Sha1 string `json:"sha1"`
}

AccessToken represents a API access token. swagger:response AccessToken

type AccessTokenList Uses

type AccessTokenList []*AccessToken

AccessTokenList represents a list of API access token. swagger:response AccessTokenList

type AddCollaboratorOption Uses

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

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

type AddOrgMembershipOption Uses

type AddOrgMembershipOption struct {
    Role string `json:"role" binding:"Required"`
}

AddOrgMembershipOption add user to organization options

type AddTimeOption Uses

type AddTimeOption struct {
    // time in seconds
    // required: true
    Time int64 `json:"time" binding:"Required"`
}

AddTimeOption options for adding time to an issue

type Attachment Uses

type Attachment struct {
    ID            int64  `json:"id"`
    Name          string `json:"name"`
    Size          int64  `json:"size"`
    DownloadCount int64  `json:"download_count"`
    // swagger:strfmt date-time
    Created     time.Time `json:"created_at"`
    UUID        string    `json:"uuid"`
    DownloadURL string    `json:"browser_download_url"`
}

Attachment a generic attachment swagger:model

type Branch Uses

type Branch struct {
    Name   string         `json:"name"`
    Commit *PayloadCommit `json:"commit"`
}

Branch represents a repository branch

type ChangesFromPayload Uses

type ChangesFromPayload struct {
    From string `json:"from"`
}

ChangesFromPayload FIXME

type ChangesPayload Uses

type ChangesPayload struct {
    Title *ChangesFromPayload `json:"title,omitempty"`
    Body  *ChangesFromPayload `json:"body,omitempty"`
}

ChangesPayload FIXME

type Client Uses

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

Client represents a Gogs API client.

func NewClient Uses

func NewClient(url, token string) *Client

NewClient initializes and returns a API client.

func (*Client) AddCollaborator Uses

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

AddCollaborator add some user as a collaborator of a repository

func (*Client) AddEmail Uses

func (c *Client) AddEmail(opt CreateEmailOption) ([]*Email, 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, error)

AddIssueLabels add one or more labels to one issue

func (*Client) AddOrgMembership Uses

func (c *Client) AddOrgMembership(org, user string, opt AddOrgMembershipOption) error

AddOrgMembership add some one to an organization's member

func (*Client) AddTime Uses

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

AddTime adds time to issue with the given index

func (*Client) AdminCreateOrg Uses

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

AdminCreateOrg create an organization

func (*Client) AdminCreateRepo Uses

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

AdminCreateRepo create a repo

func (*Client) AdminCreateUser Uses

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

AdminCreateUser create a user

func (*Client) AdminCreateUserPublicKey Uses

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

AdminCreateUserPublicKey create one user with options

func (*Client) AdminDeleteUser Uses

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

AdminDeleteUser delete one user according name

func (*Client) AdminEditUser Uses

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

AdminEditUser modify user informations

func (*Client) ClearIssueLabels Uses

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

ClearIssueLabels delete all the labels of one issue.

func (*Client) CreateAccessToken Uses

func (c *Client) CreateAccessToken(user, pass string, opt CreateAccessTokenOption) (*AccessToken, error)

CreateAccessToken create one access token with options

func (*Client) CreateDeployKey Uses

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

CreateDeployKey options when create one deploy key

func (*Client) CreateFork Uses

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

CreateFork create a fork of a repository

func (*Client) CreateGPGKey Uses

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

CreateGPGKey create GPG key with options

func (*Client) CreateIssue Uses

func (c *Client) CreateIssue(owner, repo string, opt CreateIssueOption) (*Issue, 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, error)

CreateIssueComment create comment on an issue.

func (*Client) CreateLabel Uses

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

CreateLabel create one label of repository

func (*Client) CreateMilestone Uses

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

CreateMilestone create one milestone with options

func (*Client) CreateOrgHook Uses

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

CreateOrgHook create one hook for an organization, with options

func (*Client) CreateOrgRepo Uses

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

CreateOrgRepo creates an organization repository for authenticated user.

func (*Client) CreatePublicKey Uses

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

CreatePublicKey create public key with options

func (*Client) CreatePullRequest Uses

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

CreatePullRequest create pull request with options

func (*Client) CreateRelease Uses

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

CreateRelease create a release

func (*Client) CreateReleaseAttachment Uses

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

CreateReleaseAttachment creates an attachment for the given release

func (*Client) CreateRepo Uses

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

CreateRepo creates a repository for authenticated user.

func (*Client) CreateRepoHook Uses

func (c *Client) CreateRepoHook(user, repo string, opt CreateHookOption) (*Hook, 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, error)

CreateStatus creates a new Status for a given Commit

POST /repos/:owner/:repo/statuses/:sha

func (*Client) DeleteCollaborator Uses

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

DeleteCollaborator remove a collaborator from a repository

func (*Client) DeleteDeployKey Uses

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

DeleteDeployKey delete deploy key with key id

func (*Client) DeleteEmail Uses

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

DeleteEmail delete one email of current users'

func (*Client) DeleteGPGKey Uses

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

DeleteGPGKey delete GPG key with key id

func (*Client) DeleteIssueComment Uses

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

DeleteIssueComment deletes an issue comment.

func (*Client) DeleteIssueLabel Uses

func (c *Client) DeleteIssueLabel(owner, repo string, index, label int64) 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) DeleteLabel Uses

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

DeleteLabel delete one label of repository by id TODO: maybe we need delete by name

func (*Client) DeleteMilestone Uses

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

DeleteMilestone delete one milestone by milestone id

func (*Client) DeleteOrgHook Uses

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

DeleteOrgHook delete one hook from an organization, with hook id

func (*Client) DeletePublicKey Uses

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

DeletePublicKey delete public key with key id

func (*Client) DeleteRelease Uses

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

DeleteRelease delete a release from a repository

func (*Client) DeleteReleaseAttachment Uses

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

DeleteReleaseAttachment deletes the given attachment including the uploaded file

func (*Client) DeleteRepo Uses

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

DeleteRepo deletes a repository of user or organization.

func (*Client) DeleteRepoHook Uses

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

DeleteRepoHook delete one hook from a repository, with hook id

func (*Client) EditIssue Uses

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

EditIssue modify an existing issue for a given repository

func (*Client) EditIssueComment Uses

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

EditIssueComment edits an issue comment.

func (*Client) EditLabel Uses

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

EditLabel modify one label with options

func (*Client) EditMilestone Uses

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

EditMilestone modify milestone with options

func (*Client) EditOrg Uses

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

EditOrg modify one organization via options

func (*Client) EditOrgHook Uses

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

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

func (*Client) EditPullRequest Uses

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

EditPullRequest modify pull request with PR id and options

func (*Client) EditRelease Uses

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

EditRelease edit a release

func (*Client) EditReleaseAttachment Uses

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

EditReleaseAttachment updates the given attachment with the given options

func (*Client) EditRepoHook Uses

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

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

func (*Client) Follow Uses

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

Follow set current user follow the target

func (*Client) GetCombinedStatus Uses

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

GetCombinedStatus returns the CombinedStatus for a given Commit

GET /repos/:owner/:repo/commits/:ref/status

func (*Client) GetDeployKey Uses

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

GetDeployKey get one deploy key with key id

func (*Client) GetFile Uses

func (c *Client) GetFile(user, repo, ref, tree string) ([]byte, 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, error)

GetGPGKey get current user's GPG key by key id

func (*Client) GetIssue Uses

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

GetIssue returns a single issue for a given repository

func (*Client) GetIssueLabels Uses

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

GetIssueLabels get labels of one issue via issue id

func (*Client) GetMilestone Uses

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

GetMilestone get one milestone by repo name and milestone id

func (*Client) GetMyTrackedTimes Uses

func (c *Client) GetMyTrackedTimes() (TrackedTimes, error)

GetMyTrackedTimes list tracked times of the current user

func (*Client) GetOrg Uses

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

GetOrg get one organization by name

func (*Client) GetOrgHook Uses

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

GetOrgHook get a hook of an organization

func (*Client) GetPublicKey Uses

func (c *Client) GetPublicKey(keyID int64) (*PublicKey, 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, error)

GetPullRequest get information of one PR

func (*Client) GetRelease Uses

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

GetRelease get a release of a repository

func (*Client) GetReleaseAttachment Uses

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

GetReleaseAttachment returns the requested attachment

func (*Client) GetRepo Uses

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

GetRepo returns information of a repository of given owner.

func (*Client) GetRepoBranch Uses

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

GetRepoBranch get one branch's information of one repository

func (*Client) GetRepoHook Uses

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

GetRepoHook get a hook of a repository

func (*Client) GetRepoLabel Uses

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

GetRepoLabel get one label of repository by repo it TODO: maybe we need get a label by name

func (*Client) GetRepoTrackedTimes Uses

func (c *Client) GetRepoTrackedTimes(owner, repo string) (TrackedTimes, error)

GetRepoTrackedTimes list tracked times of a repository

func (*Client) GetUserInfo Uses

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

GetUserInfo get user info by user's name

func (*Client) GetUserTrackedTimes Uses

func (c *Client) GetUserTrackedTimes(owner, repo, user string) (TrackedTimes, error)

GetUserTrackedTimes list tracked times of a user

func (*Client) GetWatchedRepos Uses

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

GetWatchedRepos list all the watched repos of user

func (*Client) IsCollaborator Uses

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

IsCollaborator check if a user is a collaborator of a repository

func (*Client) IsFollowing Uses

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

IsFollowing if current user followed the target

func (*Client) IsPullRequestMerged Uses

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

IsPullRequestMerged test if one PR is merged to one repository

func (*Client) IsUserFollowing Uses

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

IsUserFollowing if the user followed the target

func (*Client) ListAccessTokens Uses

func (c *Client) ListAccessTokens(user, pass string) ([]*AccessToken, error)

ListAccessTokens lista all the access tokens of user

func (*Client) ListCollaborators Uses

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

ListCollaborators list a repository's collaborators

func (*Client) ListDeployKeys Uses

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

ListDeployKeys list all the deploy keys of one repository

func (*Client) ListEmails Uses

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

ListEmails all the email addresses of user

func (*Client) ListFollowers Uses

func (c *Client) ListFollowers(user string, page int) ([]*User, error)

ListFollowers list all the followers of one user

func (*Client) ListFollowing Uses

func (c *Client) ListFollowing(user string, page int) ([]*User, error)

ListFollowing list all the users the user followed

func (*Client) ListForks Uses

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

ListForks list a repository's forks

func (*Client) ListGPGKeys Uses

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

ListGPGKeys list all the GPG keys of the user

func (*Client) ListIssueComments Uses

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

ListIssueComments list comments on an issue.

func (*Client) ListIssues Uses

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

ListIssues returns all issues assigned the authenticated user

func (*Client) ListMyFollowers Uses

func (c *Client) ListMyFollowers(page int) ([]*User, error)

ListMyFollowers list all the followers of current user

func (*Client) ListMyFollowing Uses

func (c *Client) ListMyFollowing(page int) ([]*User, error)

ListMyFollowing list all the users current user followed

func (*Client) ListMyGPGKeys Uses

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

ListMyGPGKeys list all the GPG keys of current user

func (*Client) ListMyOrgs Uses

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

ListMyOrgs list all of current user's organizations

func (*Client) ListMyPublicKeys Uses

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

ListMyPublicKeys list all the public keys of current user

func (*Client) ListMyRepos Uses

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

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

func (*Client) ListOrgHooks Uses

func (c *Client) ListOrgHooks(org string) (HookList, error)

ListOrgHooks list all the hooks of one organization

func (*Client) ListOrgRepos Uses

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

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

func (*Client) ListPublicKeys Uses

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

ListPublicKeys list all the public keys of the user

func (*Client) ListReleaseAttachments Uses

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

ListReleaseAttachments list release's attachments

func (*Client) ListReleases Uses

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

ListReleases list releases of a repository

func (*Client) ListRepoBranches Uses

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

ListRepoBranches list all the branches of one repository

func (*Client) ListRepoHooks Uses

func (c *Client) ListRepoHooks(user, repo string) (HookList, error)

ListRepoHooks list all the hooks of one repository

func (*Client) ListRepoIssueComments Uses

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

ListRepoIssueComments list comments for a given repo.

func (*Client) ListRepoIssues Uses

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

ListRepoIssues returns all issues for a given repository

func (*Client) ListRepoLabels Uses

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

ListRepoLabels list labels of one repository

func (*Client) ListRepoMilestones Uses

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

ListRepoMilestones list all the milestones of one repository

func (*Client) ListRepoPullRequests Uses

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

ListRepoPullRequests list PRs of one repository

func (*Client) ListStatuses Uses

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

ListStatuses returns all statuses for a given Commit

GET /repos/:owner/:repo/commits/:ref/statuses

func (*Client) ListTrackedTimes Uses

func (c *Client) ListTrackedTimes(owner, repo string, index int64) (TrackedTimes, error)

ListTrackedTimes get tracked times of one issue via issue id

func (*Client) ListUserIssues Uses

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

ListUserIssues returns all issues assigned to the authenticated user

func (*Client) ListUserOrgs Uses

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

ListUserOrgs list all of some user's organizations

func (*Client) ListUserRepos Uses

func (c *Client) ListUserRepos(user string) ([]*Repository, 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) error

MergePullRequest merge a PR to repository by PR id

func (*Client) MigrateRepo Uses

func (c *Client) MigrateRepo(opt MigrateRepoOption) (*Repository, error)

MigrateRepo migrates a repository from other Git hosting sources for the authenticated user.

To migrate a repository for a organization, the authenticated user must be a owner of the specified organization.

func (*Client) MirrorSync Uses

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

MirrorSync adds a mirrored repository to the mirror sync queue.

func (*Client) ReplaceIssueLabels Uses

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

ReplaceIssueLabels replace old labels of issue with new labels

func (*Client) SearchUsers Uses

func (c *Client) SearchUsers(query string, limit int) ([]*User, error)

SearchUsers finds users by query

func (*Client) ServerVersion Uses

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

ServerVersion returns the version of the server

func (*Client) SetHTTPClient Uses

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

SetHTTPClient replaces default http.Client with user given one.

func (*Client) UnWatchRepo Uses

func (c *Client) UnWatchRepo(user, pass, repoUser, repoName string) (int, error)

UnWatchRepo start to watch a repository

func (*Client) Unfollow Uses

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

Unfollow set current user unfollow the target

func (*Client) WatchRepo Uses

func (c *Client) WatchRepo(user, pass, repoUser, repoName string) (*WatchInfo, 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"`
    Body     string `json:"body"`
    // swagger:strfmt date-time
    Created time.Time `json:"created_at"`
    // swagger:strfmt date-time
    Updated time.Time `json:"updated_at"`
}

Comment represents a comment on a commit or issue

type CreateAccessTokenOption Uses

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

CreateAccessTokenOption options when create access token swagger:parameters userCreateToken

type CreateEmailOption Uses

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

CreateEmailOption options when creating email addresses

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
    //
    // required: true
    // unique: true
    ArmoredKey string `json:"armored_public_key" binding:"Required"`
}

CreateGPGKeyOption options create user GPG key

type CreateHookOption Uses

type CreateHookOption struct {
    // required: true
    // enum: gitea,gogs,slack,discord
    Type string `json:"type" binding:"Required"`
    // required: true
    Config map[string]string `json:"config" binding:"Required"`
    Events []string          `json:"events"`
    // default: false
    Active bool `json:"active"`
}

CreateHookOption options when create a hook

type CreateIssueCommentOption Uses

type CreateIssueCommentOption struct {
    // required:true
    Body string `json:"body" binding:"Required"`
}

CreateIssueCommentOption options for creating a comment on an issue

type CreateIssueOption Uses

type CreateIssueOption struct {
    // required:true
    Title string `json:"title" binding:"Required"`
    Body  string `json:"body"`
    // username of assignee
    Assignee  string   `json:"assignee"`
    Assignees []string `json:"assignees"`
    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_date"`
    // milestone id
    Milestone int64 `json:"milestone"`
    // list of label ids
    Labels []int64 `json:"labels"`
    Closed bool    `json:"closed"`
}

CreateIssueOption options to create one issue

type CreateKeyOption Uses

type CreateKeyOption struct {
    // Title of the key to add
    //
    // required: true
    // unique: true
    Title string `json:"title" binding:"Required"`
    // An armored SSH key to add
    //
    // required: true
    // unique: true
    Key string `json:"key" binding:"Required"`
    // Describe if the key has only read access or read/write
    //
    // required: false
    ReadOnly bool `json:"read_only"`
}

CreateKeyOption options when creating a key

type CreateLabelOption Uses

type CreateLabelOption struct {
    // required:true
    Name string `json:"name" binding:"Required"`
    // required:true
    // example: #00aabb
    Color string `json:"color" binding:"Required;Size(7)"`
}

CreateLabelOption options for creating a label

type CreateMilestoneOption Uses

type CreateMilestoneOption struct {
    Title       string `json:"title"`
    Description string `json:"description"`
    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_on"`
}

CreateMilestoneOption options for creating a milestone

type CreateOrgOption Uses

type CreateOrgOption struct {
    // required: true
    UserName    string `json:"username" binding:"Required"`
    FullName    string `json:"full_name"`
    Description string `json:"description"`
    Website     string `json:"website"`
    Location    string `json:"location"`
}

CreateOrgOption options for creating an organization

type CreatePayload Uses

type CreatePayload struct {
    Secret  string      `json:"secret"`
    Sha     string      `json:"sha"`
    Ref     string      `json:"ref"`
    RefType string      `json:"ref_type"`
    Repo    *Repository `json:"repository"`
    Sender  *User       `json:"sender"`
}

CreatePayload FIXME

func ParseCreateHook Uses

func ParseCreateHook(raw []byte) (*CreatePayload, error)

ParseCreateHook parses create event hook content.

func (*CreatePayload) JSONPayload Uses

func (p *CreatePayload) JSONPayload() ([]byte, error)

JSONPayload return payload information

func (*CreatePayload) SetSecret Uses

func (p *CreatePayload) SetSecret(secret string)

SetSecret FIXME

type CreatePullRequestOption Uses

type CreatePullRequestOption struct {
    Head      string   `json:"head" binding:"Required"`
    Base      string   `json:"base" binding:"Required"`
    Title     string   `json:"title" binding:"Required"`
    Body      string   `json:"body"`
    Assignee  string   `json:"assignee"`
    Assignees []string `json:"assignees"`
    Milestone int64    `json:"milestone"`
    Labels    []int64  `json:"labels"`
    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_date"`
}

CreatePullRequestOption options when creating a pull request

type CreateReleaseOption Uses

type CreateReleaseOption struct {
    // required: true
    TagName      string `json:"tag_name" binding:"Required"`
    Target       string `json:"target_commitish"`
    Title        string `json:"name"`
    Note         string `json:"body"`
    IsDraft      bool   `json:"draft"`
    IsPrerelease bool   `json:"prerelease"`
}

CreateReleaseOption options when creating a release

type CreateRepoOption Uses

type CreateRepoOption struct {
    // Name of the repository to create
    //
    // required: true
    // unique: true
    Name string `json:"name" binding:"Required;AlphaDashDot;MaxSize(100)"`
    // Description of the repository to create
    Description string `json:"description" binding:"MaxSize(255)"`
    // Whether the repository is private
    Private bool `json:"private"`
    // Whether the repository should be auto-intialized?
    AutoInit bool `json:"auto_init"`
    // Gitignores to use
    Gitignores string `json:"gitignores"`
    // License to use
    License string `json:"license"`
    // Readme of the repository to create
    Readme string `json:"readme"`
}

CreateRepoOption options when creating repository swagger:model

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 {
    // required: true
    Name        string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"`
    Description string `json:"description" binding:"MaxSize(255)"`
    // enum: read,write,admin
    Permission string `json:"permission"`
}

CreateTeamOption options for creating a team

type CreateUserOption Uses

type CreateUserOption struct {
    SourceID  int64  `json:"source_id"`
    LoginName string `json:"login_name"`
    // required: true
    Username string `json:"username" binding:"Required;AlphaDashDot;MaxSize(35)"`
    FullName string `json:"full_name" binding:"MaxSize(100)"`
    // required: true
    // swagger:strfmt email
    Email string `json:"email" binding:"Required;Email;MaxSize(254)"`
    // required: true
    Password   string `json:"password" binding:"Required;MaxSize(255)"`
    SendNotify bool   `json:"send_notify"`
}

CreateUserOption create user options

type DeleteEmailOption Uses

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

DeleteEmailOption options when deleting email addresses

type DeletePayload Uses

type DeletePayload struct {
    Ref        string      `json:"ref"`
    RefType    string      `json:"ref_type"`
    PusherType PusherType  `json:"pusher_type"`
    Repo       *Repository `json:"repository"`
    Sender     *User       `json:"sender"`
}

DeletePayload represents delete payload

func (*DeletePayload) JSONPayload Uses

func (p *DeletePayload) JSONPayload() ([]byte, error)

JSONPayload implements Payload

func (*DeletePayload) SetSecret Uses

func (p *DeletePayload) SetSecret(secret string)

SetSecret implements Payload

type DeployKey Uses

type DeployKey struct {
    ID    int64  `json:"id"`
    Key   string `json:"key"`
    URL   string `json:"url"`
    Title string `json:"title"`
    // swagger:strfmt date-time
    Created  time.Time `json:"created_at"`
    ReadOnly bool      `json:"read_only"`
}

DeployKey a deploy key

type EditAttachmentOptions Uses

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

EditAttachmentOptions options for editing attachments swagger:model

type EditDeadlineOption Uses

type EditDeadlineOption struct {
    // required:true
    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_date"`
}

EditDeadlineOption options for creating a deadline

type EditHookOption Uses

type EditHookOption struct {
    Config map[string]string `json:"config"`
    Events []string          `json:"events"`
    Active *bool             `json:"active"`
}

EditHookOption options when modify one hook

type EditIssueCommentOption Uses

type EditIssueCommentOption struct {
    // required: true
    Body string `json:"body" binding:"Required"`
}

EditIssueCommentOption options for editing a comment

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     *string  `json:"state"`
    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_date"`
}

EditIssueOption options for editing an issue

type EditLabelOption Uses

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

EditLabelOption options for editing a label

type EditMilestoneOption Uses

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

EditMilestoneOption options for editing a milestone

type EditOrgOption Uses

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

EditOrgOption options for editing an organization

type EditPullRequestOption Uses

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

EditPullRequestOption options when modify pull request

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

type EditTeamOption struct {
    // required: true
    Name        string `json:"name" binding:"Required;AlphaDashDot;MaxSize(30)"`
    Description string `json:"description" binding:"MaxSize(255)"`
    // enum: read,write,admin
    Permission string `json:"permission"`
}

EditTeamOption options for editing a team

type EditUserOption Uses

type EditUserOption struct {
    SourceID  int64  `json:"source_id"`
    LoginName string `json:"login_name"`
    FullName  string `json:"full_name" binding:"MaxSize(100)"`
    // required: true
    // swagger:strfmt email
    Email            string `json:"email" binding:"Required;Email;MaxSize(254)"`
    Password         string `json:"password" binding:"MaxSize(255)"`
    Website          string `json:"website" binding:"MaxSize(50)"`
    Location         string `json:"location" binding:"MaxSize(50)"`
    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"`
}

EditUserOption edit user options

type Email Uses

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

Email an email address belonging to a user

type ForkPayload Uses

type ForkPayload struct {
    Forkee *Repository `json:"forkee"`
    Repo   *Repository `json:"repository"`
    Sender *User       `json:"sender"`
}

ForkPayload represents fork payload

func (*ForkPayload) JSONPayload Uses

func (p *ForkPayload) JSONPayload() ([]byte, error)

JSONPayload implements Payload

func (*ForkPayload) SetSecret Uses

func (p *ForkPayload) SetSecret(secret string)

SetSecret implements Payload

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"`
    // swagger:strfmt date-time
    Created time.Time `json:"created_at,omitempty"`
    // swagger:strfmt date-time
    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 swagger:model GPGKeyEmail

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"`
    // swagger:strfmt date-time
    Updated time.Time `json:"updated_at"`
    // swagger:strfmt date-time
    Created time.Time `json:"created_at"`
}

Hook a hook is a web hook when one repository changed

type HookIssueAction Uses

type HookIssueAction string

HookIssueAction FIXME

const (
    // HookIssueOpened opened
    HookIssueOpened HookIssueAction = "opened"
    // HookIssueClosed closed
    HookIssueClosed HookIssueAction = "closed"
    // HookIssueReOpened reopened
    HookIssueReOpened HookIssueAction = "reopened"
    // HookIssueEdited edited
    HookIssueEdited HookIssueAction = "edited"
    // HookIssueAssigned assigned
    HookIssueAssigned HookIssueAction = "assigned"
    // HookIssueUnassigned unassigned
    HookIssueUnassigned HookIssueAction = "unassigned"
    // HookIssueLabelUpdated label_updated
    HookIssueLabelUpdated HookIssueAction = "label_updated"
    // HookIssueLabelCleared label_cleared
    HookIssueLabelCleared HookIssueAction = "label_cleared"
    // HookIssueSynchronized synchronized
    HookIssueSynchronized HookIssueAction = "synchronized"
    // HookIssueMilestoned is an issue action for when a milestone is set on an issue.
    HookIssueMilestoned HookIssueAction = "milestoned"
    // HookIssueDemilestoned is an issue action for when a milestone is cleared on an issue.
    HookIssueDemilestoned HookIssueAction = "demilestoned"
)

type HookIssueCommentAction Uses

type HookIssueCommentAction string

HookIssueCommentAction defines hook issue comment action

const (
    HookIssueCommentCreated HookIssueCommentAction = "created"
    HookIssueCommentEdited  HookIssueCommentAction = "edited"
    HookIssueCommentDeleted HookIssueCommentAction = "deleted"
)

all issue comment actions

type HookList Uses

type HookList []*Hook

HookList represents a list of API hook.

type HookReleaseAction Uses

type HookReleaseAction string

HookReleaseAction defines hook release action type

const (
    HookReleasePublished HookReleaseAction = "published"
    HookReleaseUpdated   HookReleaseAction = "updated"
    HookReleaseDeleted   HookReleaseAction = "deleted"
)

all release actions

type HookRepoAction Uses

type HookRepoAction string

HookRepoAction an action that happens to a repo

const (
    // HookRepoCreated created
    HookRepoCreated HookRepoAction = "created"
    // HookRepoDeleted deleted
    HookRepoDeleted HookRepoAction = "deleted"
)

type Issue Uses

type Issue 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"`
    // Whether the issue is open or closed
    //
    // type: string
    // enum: open,closed
    State    StateType `json:"state"`
    Comments int       `json:"comments"`
    // swagger:strfmt date-time
    Created time.Time `json:"created_at"`
    // swagger:strfmt date-time
    Updated time.Time `json:"updated_at"`
    // swagger:strfmt date-time
    Closed *time.Time `json:"closed_at"`
    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_date"`

    PullRequest *PullRequestMeta `json:"pull_request"`
}

Issue represents an issue in a repository swagger:model

type IssueCommentPayload Uses

type IssueCommentPayload struct {
    Action     HookIssueCommentAction `json:"action"`
    Issue      *Issue                 `json:"issue"`
    Comment    *Comment               `json:"comment"`
    Changes    *ChangesPayload        `json:"changes,omitempty"`
    Repository *Repository            `json:"repository"`
    Sender     *User                  `json:"sender"`
}

IssueCommentPayload represents a payload information of issue comment event.

func (*IssueCommentPayload) JSONPayload Uses

func (p *IssueCommentPayload) JSONPayload() ([]byte, error)

JSONPayload implements Payload

func (*IssueCommentPayload) SetSecret Uses

func (p *IssueCommentPayload) SetSecret(secret string)

SetSecret implements Payload

type IssueDeadline Uses

type IssueDeadline struct {
    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_date"`
}

IssueDeadline represents an issue deadline swagger:model

type IssueLabelsOption Uses

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

IssueLabelsOption a collection of labels

type IssuePayload Uses

type IssuePayload struct {
    Secret     string          `json:"secret"`
    Action     HookIssueAction `json:"action"`
    Index      int64           `json:"number"`
    Changes    *ChangesPayload `json:"changes,omitempty"`
    Issue      *Issue          `json:"issue"`
    Repository *Repository     `json:"repository"`
    Sender     *User           `json:"sender"`
}

IssuePayload represents the payload information that is sent along with an issue event.

func (*IssuePayload) JSONPayload Uses

func (p *IssuePayload) JSONPayload() ([]byte, error)

JSONPayload encodes the IssuePayload to JSON, with an indentation of two spaces.

func (*IssuePayload) SetSecret Uses

func (p *IssuePayload) SetSecret(secret string)

SetSecret modifies the secret of the IssuePayload.

type LFSLock Uses

type LFSLock struct {
    ID       string        `json:"id"`
    Path     string        `json:"path"`
    LockedAt time.Time     `json:"locked_at"`
    Owner    *LFSLockOwner `json:"owner"`
}

LFSLock represent a lock for use with the locks API.

type LFSLockDeleteRequest Uses

type LFSLockDeleteRequest struct {
    Force bool `json:"force"`
}

LFSLockDeleteRequest contains params of a delete request https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#delete-lock

type LFSLockError Uses

type LFSLockError struct {
    Message       string   `json:"message"`
    Lock          *LFSLock `json:"lock,omitempty"`
    Documentation string   `json:"documentation_url,omitempty"`
    RequestID     string   `json:"request_id,omitempty"`
}

LFSLockError contains information on the error that occurs

type LFSLockList Uses

type LFSLockList struct {
    Locks []*LFSLock `json:"locks"`
    Next  string     `json:"next_cursor,omitempty"`
}

LFSLockList represent a list of lock requested https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks

type LFSLockListVerify Uses

type LFSLockListVerify struct {
    Ours   []*LFSLock `json:"ours"`
    Theirs []*LFSLock `json:"theirs"`
    Next   string     `json:"next_cursor,omitempty"`
}

LFSLockListVerify represent a list of lock verification requested https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#list-locks-for-verification

type LFSLockOwner Uses

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

LFSLockOwner represent a lock owner for use with the locks API.

type LFSLockRequest Uses

type LFSLockRequest struct {
    Path string `json:"path"`
}

LFSLockRequest contains the path of the lock to create https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock

type LFSLockResponse Uses

type LFSLockResponse struct {
    Lock *LFSLock `json:"lock"`
}

LFSLockResponse represent a lock created https://github.com/git-lfs/git-lfs/blob/master/docs/api/locking.md#create-lock

type Label Uses

type Label struct {
    ID   int64  `json:"id"`
    Name string `json:"name"`
    // example: 00aabb
    Color string `json:"color"`
    URL   string `json:"url"`
}

Label a label to an issue or a pr swagger:model

type ListIssueOption Uses

type ListIssueOption struct {
    Page  int
    State string
}

ListIssueOption list issue options

type ListPullRequestsOptions Uses

type ListPullRequestsOptions struct {
    Page  int    `json:"page"`
    State string `json:"state"`
}

ListPullRequestsOptions options for listing pull requests

type ListStatusesOption Uses

type ListStatusesOption struct {
    Page int
}

ListStatusesOption holds pagination information

type MarkdownOption Uses

type MarkdownOption struct {
    // Text markdown to render
    //
    // in: body
    Text string
    // Mode to render
    //
    // in: body
    Mode string
    // Context to render
    //
    // in: body
    Context string
    // Is it a wiki page ?
    //
    // in: body
    Wiki bool
}

MarkdownOption markdown options

type MarkdownRender Uses

type MarkdownRender string

MarkdownRender is a rendered markdown document swagger:response MarkdownRender

type MigrateRepoOption Uses

type MigrateRepoOption struct {
    // required: true
    CloneAddr    string `json:"clone_addr" binding:"Required"`
    AuthUsername string `json:"auth_username"`
    AuthPassword string `json:"auth_password"`
    // required: true
    UID int `json:"uid" binding:"Required"`
    // required: true
    RepoName    string `json:"repo_name" binding:"Required"`
    Mirror      bool   `json:"mirror"`
    Private     bool   `json:"private"`
    Description string `json:"description"`
}

MigrateRepoOption options for migrating a repository from an external service

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"`
    // swagger:strfmt date-time
    Closed *time.Time `json:"closed_at"`
    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_on"`
}

Milestone milestone is a collection of issues on one repository

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"`
}

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"`
    // swagger:strfmt date-time
    Timestamp time.Time `json:"timestamp"`
}

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"`
    // swagger:strfmt email
    Email    string `json:"email"`
    UserName string `json:"username"`
}

PayloadUser represents the author or committer of a commit

type Payloader Uses

type Payloader interface {
    SetSecret(string)
    JSONPayload() ([]byte, error)
}

Payloader payload is some part of one hook

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"`
    // swagger:strfmt date-time
    Created time.Time `json:"created_at,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"`
    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"`
    // swagger:strfmt date-time
    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"`

    // swagger:strfmt date-time
    Deadline *time.Time `json:"due_date"`

    // swagger:strfmt date-time
    Created *time.Time `json:"created_at"`
    // swagger:strfmt date-time
    Updated *time.Time `json:"updated_at"`
    // swagger:strfmt date-time
    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 PullRequestPayload Uses

type PullRequestPayload struct {
    Secret      string          `json:"secret"`
    Action      HookIssueAction `json:"action"`
    Index       int64           `json:"number"`
    Changes     *ChangesPayload `json:"changes,omitempty"`
    PullRequest *PullRequest    `json:"pull_request"`
    Repository  *Repository     `json:"repository"`
    Sender      *User           `json:"sender"`
}

PullRequestPayload represents a payload information of pull request event.

func (*PullRequestPayload) JSONPayload Uses

func (p *PullRequestPayload) JSONPayload() ([]byte, error)

JSONPayload FIXME

func (*PullRequestPayload) SetSecret Uses

func (p *PullRequestPayload) SetSecret(secret string)

SetSecret modifies the secret of the PullRequestPayload.

type PushPayload Uses

type PushPayload struct {
    Secret     string           `json:"secret"`
    Ref        string           `json:"ref"`
    Before     string           `json:"before"`
    After      string           `json:"after"`
    CompareURL string           `json:"compare_url"`
    Commits    []*PayloadCommit `json:"commits"`
    Repo       *Repository      `json:"repository"`
    Pusher     *User            `json:"pusher"`
    Sender     *User            `json:"sender"`
}

PushPayload represents a payload information of push event.

func ParsePushHook Uses

func ParsePushHook(raw []byte) (*PushPayload, error)

ParsePushHook parses push event hook content.

func (*PushPayload) Branch Uses

func (p *PushPayload) Branch() string

Branch returns branch name from a payload

func (*PushPayload) JSONPayload Uses

func (p *PushPayload) JSONPayload() ([]byte, error)

JSONPayload FIXME

func (*PushPayload) SetSecret Uses

func (p *PushPayload) SetSecret(secret string)

SetSecret FIXME

type PusherType Uses

type PusherType string

PusherType define the type to push

const (
    PusherTypeUser PusherType = "user"
)

describe all the PusherTypes

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"`
    // swagger:strfmt date-time
    CreatedAt time.Time `json:"created_at"`
    // swagger:strfmt date-time
    PublishedAt time.Time     `json:"published_at"`
    Publisher   *User         `json:"author"`
    Attachments []*Attachment `json:"assets"`
}

Release represents a repository release

type ReleasePayload Uses

type ReleasePayload struct {
    Action     HookReleaseAction `json:"action"`
    Release    *Release          `json:"release"`
    Repository *Repository       `json:"repository"`
    Sender     *User             `json:"sender"`
}

ReleasePayload represents a payload information of release event.

func (*ReleasePayload) JSONPayload Uses

func (p *ReleasePayload) JSONPayload() ([]byte, error)

JSONPayload implements Payload

func (*ReleasePayload) SetSecret Uses

func (p *ReleasePayload) SetSecret(secret string)

SetSecret implements Payload

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"`
    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"`
    // swagger:strfmt date-time
    Created time.Time `json:"created_at"`
    // swagger:strfmt date-time
    Updated     time.Time   `json:"updated_at"`
    Permissions *Permission `json:"permissions,omitempty"`
}

Repository represents a repository

type RepositoryPayload Uses

type RepositoryPayload struct {
    Secret       string         `json:"secret"`
    Action       HookRepoAction `json:"action"`
    Repository   *Repository    `json:"repository"`
    Organization *User          `json:"organization"`
    Sender       *User          `json:"sender"`
}

RepositoryPayload payload for repository webhooks

func (*RepositoryPayload) JSONPayload Uses

func (p *RepositoryPayload) JSONPayload() ([]byte, error)

JSONPayload JSON representation of the payload

func (*RepositoryPayload) SetSecret Uses

func (p *RepositoryPayload) SetSecret(secret string)

SetSecret set the payload's secret

type SearchError Uses

type SearchError struct {
    OK    bool   `json:"ok"`
    Error string `json:"error"`
}

SearchError error of a failed search

type SearchResults Uses

type SearchResults struct {
    OK   bool          `json:"ok"`
    Data []*Repository `json:"data"`
}

SearchResults results of a successful search

type ServerVersion Uses

type ServerVersion struct {
    Version string `json:"version"`
}

ServerVersion wraps the version of the server

type StateType Uses

type StateType string

StateType issue state type

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

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"`
    // swagger:strfmt date-time
    Created time.Time `json:"created_at"`
    // swagger:strfmt date-time
    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 Team Uses

type Team struct {
    ID          int64  `json:"id"`
    Name        string `json:"name"`
    Description string `json:"description"`
    // enum: none,read,write,admin,owner
    Permission string `json:"permission"`
}

Team represents a team in an organization

type TrackedTime Uses

type TrackedTime struct {
    ID  int64 `json:"id"`
    // swagger:strfmt date-time
    Created time.Time `json:"created"`
    // Time in seconds
    Time    int64 `json:"time"`
    UserID  int64 `json:"user_id"`
    IssueID int64 `json:"issue_id"`
}

TrackedTime worked time for an issue / pr

type TrackedTimes Uses

type TrackedTimes []*TrackedTime

TrackedTimes represent a list of tracked times

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"`
    // swagger:strfmt email
    Email string `json:"email"`
    // URL to the user's avatar
    AvatarURL string `json:"avatar_url"`
    // User locale
    Language string `json:"language"`
}

User represents a user swagger:model

func (User) MarshalJSON Uses

func (u User) MarshalJSON() ([]byte, error)

MarshalJSON implements the json.Marshaler interface for User, adding field(s) for backward compatibility

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 11 packages (graph) and is imported by 32 packages. Updated 2018-05-18. Refresh now. Tools for package owners.