gitea

package module
v0.24.1 Latest Latest
Warning

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

Go to latest
Published: Mar 24, 2026 License: MIT Imports: 27 Imported by: 1,049

Documentation

Overview

Package gitea implements a client for the Gitea API. The version corresponds to the highest supported version of the gitea API, but backwards-compatibility is mostly given.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAgent added in v0.16.0

func GetAgent() (agent.Agent, error)

GetAgent returns a ssh agent

func OptionalBool added in v0.14.0

func OptionalBool(v bool) *bool

OptionalBool convert a bool to a bool reference

func OptionalInt64 added in v0.14.0

func OptionalInt64(v int64) *int64

OptionalInt64 convert a int64 to a int64 reference

func OptionalString added in v0.14.0

func OptionalString(v string) *string

OptionalString convert a string to a string reference

func VerifyWebhookSignature added in v0.16.0

func VerifyWebhookSignature(secret, expected string, payload []byte) (bool, error)

VerifyWebhookSignature verifies that a payload matches the X-Gitea-Signature based on a secret

func VerifyWebhookSignatureMiddleware added in v0.16.0

func VerifyWebhookSignatureMiddleware(secret string) func(http.Handler) http.Handler

VerifyWebhookSignatureMiddleware is a http.Handler for verifying X-Gitea-Signature on incoming webhooks

func Version

func Version() string

Version return the library version

Types

type AccessMode added in v0.13.0

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

type AccessToken struct {
	ID             int64              `json:"id"`
	Name           string             `json:"name"`
	Token          string             `json:"sha1"`
	TokenLastEight string             `json:"token_last_eight"`
	Scopes         []AccessTokenScope `json:"scopes"`
	Created        time.Time          `json:"created_at,omitempty"`
	Updated        time.Time          `json:"last_used_at,omitempty"`
}

AccessToken represents an API access token.

type AccessTokenScope added in v0.16.0

type AccessTokenScope string

AccessTokenScope represents the scope for an access token.

const (
	AccessTokenScopeAll AccessTokenScope = "all"

	AccessTokenScopeRepo       AccessTokenScope = "repo"
	AccessTokenScopeRepoStatus AccessTokenScope = "repo:status"
	AccessTokenScopePublicRepo AccessTokenScope = "public_repo"

	AccessTokenScopeAdminOrg AccessTokenScope = "admin:org"
	AccessTokenScopeWriteOrg AccessTokenScope = "write:org"
	AccessTokenScopeReadOrg  AccessTokenScope = "read:org"

	AccessTokenScopeAdminPublicKey AccessTokenScope = "admin:public_key"
	AccessTokenScopeWritePublicKey AccessTokenScope = "write:public_key"
	AccessTokenScopeReadPublicKey  AccessTokenScope = "read:public_key"

	AccessTokenScopeAdminRepoHook AccessTokenScope = "admin:repo_hook"
	AccessTokenScopeWriteRepoHook AccessTokenScope = "write:repo_hook"
	AccessTokenScopeReadRepoHook  AccessTokenScope = "read:repo_hook"

	AccessTokenScopeAdminOrgHook AccessTokenScope = "admin:org_hook"

	AccessTokenScopeAdminUserHook AccessTokenScope = "admin:user_hook"

	AccessTokenScopeNotification AccessTokenScope = "notification"

	AccessTokenScopeUser       AccessTokenScope = "user"
	AccessTokenScopeReadUser   AccessTokenScope = "read:user"
	AccessTokenScopeUserEmail  AccessTokenScope = "user:email"
	AccessTokenScopeUserFollow AccessTokenScope = "user:follow"

	AccessTokenScopeDeleteRepo AccessTokenScope = "delete_repo"

	AccessTokenScopePackage       AccessTokenScope = "package"
	AccessTokenScopeWritePackage  AccessTokenScope = "write:package"
	AccessTokenScopeReadPackage   AccessTokenScope = "read:package"
	AccessTokenScopeDeletePackage AccessTokenScope = "delete:package"

	AccessTokenScopeAdminGPGKey AccessTokenScope = "admin:gpg_key"
	AccessTokenScopeWriteGPGKey AccessTokenScope = "write:gpg_key"
	AccessTokenScopeReadGPGKey  AccessTokenScope = "read:gpg_key"

	AccessTokenScopeAdminApplication AccessTokenScope = "admin:application"
	AccessTokenScopeWriteApplication AccessTokenScope = "write:application"
	AccessTokenScopeReadApplication  AccessTokenScope = "read:application"

	AccessTokenScopeSudo AccessTokenScope = "sudo"
)

type ActionArtifact added in v0.24.0

type ActionArtifact struct {
	ID                 int64              `json:"id"`
	Name               string             `json:"name"`
	SizeInBytes        int64              `json:"size_in_bytes"`
	URL                string             `json:"url"`
	ArchiveDownloadURL string             `json:"archive_download_url"`
	Expired            bool               `json:"expired"`
	WorkflowRun        *ActionWorkflowRun `json:"workflow_run"`
	CreatedAt          time.Time          `json:"created_at"`
	UpdatedAt          time.Time          `json:"updated_at"`
	ExpiresAt          time.Time          `json:"expires_at"`
}

ActionArtifact represents an Actions artifact.

type ActionArtifactsResponse added in v0.24.0

type ActionArtifactsResponse struct {
	Artifacts  []*ActionArtifact `json:"artifacts"`
	TotalCount int64             `json:"total_count"`
}

ActionArtifactsResponse contains a page of artifacts.

type ActionRunner added in v0.24.0

type ActionRunner struct {
	ID        int64                `json:"id"`
	Name      string               `json:"name"`
	Status    string               `json:"status"`
	Busy      bool                 `json:"busy"`
	Disabled  bool                 `json:"disabled"`
	Ephemeral bool                 `json:"ephemeral"`
	Labels    []*ActionRunnerLabel `json:"labels"`
}

ActionRunner represents an Actions runner.

type ActionRunnerLabel added in v0.24.0

type ActionRunnerLabel struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	Type string `json:"type"`
}

ActionRunnerLabel represents a runner label.

type ActionRunnersResponse added in v0.24.0

type ActionRunnersResponse struct {
	Runners    []*ActionRunner `json:"runners"`
	TotalCount int64           `json:"total_count"`
}

ActionRunnersResponse contains a page of runners.

type ActionTask added in v0.23.0

type ActionTask struct {
	ID           int64     `json:"id"`
	Name         string    `json:"name"` // Workflow name
	HeadBranch   string    `json:"head_branch"`
	HeadSHA      string    `json:"head_sha"`
	RunNumber    int64     `json:"run_number"`
	Event        string    `json:"event"`
	DisplayTitle string    `json:"display_title"` // PR title or commit message
	Status       string    `json:"status"`
	WorkflowID   string    `json:"workflow_id"` // e.g. "ci.yml"
	URL          string    `json:"url"`
	CreatedAt    time.Time `json:"created_at"`
	UpdatedAt    time.Time `json:"updated_at"`
	RunStartedAt time.Time `json:"run_started_at"`
}

ActionTask represents a workflow run task (from /actions/tasks endpoint) This is the format returned by older Gitea versions

type ActionTaskResponse added in v0.23.0

type ActionTaskResponse struct {
	TotalCount   int64         `json:"total_count"`
	WorkflowRuns []*ActionTask `json:"workflow_runs"`
}

ActionTaskResponse holds the response for listing action tasks

type ActionVariable added in v0.24.0

type ActionVariable struct {
	OwnerID     int64  `json:"owner_id"`
	RepoID      int64  `json:"repo_id"`
	Name        string `json:"name"`
	Data        string `json:"data"`
	Description string `json:"description"`
}

ActionVariable represents an Actions variable.

type ActionWorkflow added in v0.24.0

type ActionWorkflow struct {
	ID        string    `json:"id"`
	Name      string    `json:"name"`
	Path      string    `json:"path"`
	State     string    `json:"state"`
	CreatedAt time.Time `json:"created_at"`
	UpdatedAt time.Time `json:"updated_at"`
	URL       string    `json:"url"`
	HTMLURL   string    `json:"html_url"`
	BadgeURL  string    `json:"badge_url"`
	DeletedAt time.Time `json:"deleted_at"`
}

ActionWorkflow represents a repository workflow definition.

type ActionWorkflowJob added in v0.23.0

type ActionWorkflowJob struct {
	ID          int64                 `json:"id"`
	RunID       int64                 `json:"run_id"`
	RunURL      string                `json:"run_url"`
	RunAttempt  int64                 `json:"run_attempt"`
	Name        string                `json:"name"`
	HeadBranch  string                `json:"head_branch,omitempty"`
	HeadSha     string                `json:"head_sha"`
	Status      string                `json:"status"`
	Conclusion  string                `json:"conclusion,omitempty"`
	URL         string                `json:"url"`
	HTMLURL     string                `json:"html_url"`
	CreatedAt   time.Time             `json:"created_at"`
	StartedAt   time.Time             `json:"started_at"`
	CompletedAt time.Time             `json:"completed_at"`
	RunnerID    int64                 `json:"runner_id,omitempty"`
	RunnerName  string                `json:"runner_name,omitempty"`
	Labels      []string              `json:"labels"`
	Steps       []*ActionWorkflowStep `json:"steps"`
}

ActionWorkflowJob represents a job within a workflow run

type ActionWorkflowJobsResponse added in v0.23.0

type ActionWorkflowJobsResponse struct {
	TotalCount int64                `json:"total_count"`
	Jobs       []*ActionWorkflowJob `json:"jobs"`
}

ActionWorkflowJobsResponse holds the response for listing workflow jobs

type ActionWorkflowResponse added in v0.24.0

type ActionWorkflowResponse struct {
	Workflows  []*ActionWorkflow `json:"workflows"`
	TotalCount int64             `json:"total_count"`
}

ActionWorkflowResponse contains a workflow list response.

type ActionWorkflowRun added in v0.23.0

type ActionWorkflowRun struct {
	ID             int64       `json:"id"`
	DisplayTitle   string      `json:"display_title"`
	Event          string      `json:"event"`
	HeadBranch     string      `json:"head_branch,omitempty"`
	HeadSha        string      `json:"head_sha"`
	Path           string      `json:"path"`
	RunAttempt     int64       `json:"run_attempt"`
	RunNumber      int64       `json:"run_number"`
	Status         string      `json:"status"`
	Conclusion     string      `json:"conclusion,omitempty"`
	URL            string      `json:"url"`
	HTMLURL        string      `json:"html_url"`
	StartedAt      time.Time   `json:"started_at"`
	CompletedAt    time.Time   `json:"completed_at"`
	Actor          *User       `json:"actor,omitempty"`
	TriggerActor   *User       `json:"trigger_actor,omitempty"`
	Repository     *Repository `json:"repository,omitempty"`
	HeadRepository *Repository `json:"head_repository,omitempty"`
	RepositoryID   int64       `json:"repository_id,omitempty"`
}

ActionWorkflowRun represents a workflow run (from /actions/runs endpoint) This is the format returned by newer Gitea versions

type ActionWorkflowRunsResponse added in v0.23.0

type ActionWorkflowRunsResponse struct {
	TotalCount   int64                `json:"total_count"`
	WorkflowRuns []*ActionWorkflowRun `json:"workflow_runs"`
}

ActionWorkflowRunsResponse holds the response for listing workflow runs

type ActionWorkflowStep added in v0.23.0

type ActionWorkflowStep struct {
	Name        string    `json:"name"`
	Number      int64     `json:"number"`
	Status      string    `json:"status"`
	Conclusion  string    `json:"conclusion,omitempty"`
	StartedAt   time.Time `json:"started_at"`
	CompletedAt time.Time `json:"completed_at"`
}

ActionWorkflowStep represents a step within a job

type Activity added in v0.23.0

type Activity struct {
	ID        int64       `json:"id"`
	ActUserID int64       `json:"act_user_id"`
	ActUser   *User       `json:"act_user"`
	OpType    string      `json:"op_type"`
	Content   string      `json:"content"`
	RepoID    int64       `json:"repo_id"`
	Repo      *Repository `json:"repo"`
	CommentID int64       `json:"comment_id"`
	Comment   *Comment    `json:"comment"`
	RefName   string      `json:"ref_name"`
	IsPrivate bool        `json:"is_private"`
	UserID    int64       `json:"user_id"`
	Created   time.Time   `json:"created"`
}

Activity represents a user or organization activity

type ActivityPub added in v0.23.0

type ActivityPub map[string]interface{}

ActivityPub represents an ActivityPub object

type AddCollaboratorOption

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

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

func (*AddCollaboratorOption) Validate added in v0.13.0

func (opt *AddCollaboratorOption) Validate() error

Validate the AddCollaboratorOption struct

type AddTimeOption

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 added in v0.13.0

func (opt AddTimeOption) Validate() error

Validate the AddTimeOption struct

type AdminListOrgsOptions added in v0.11.1

type AdminListOrgsOptions struct {
	ListOptions
}

AdminListOrgsOptions options for listing admin's organizations

type AdminListUsersOptions added in v0.11.1

type AdminListUsersOptions struct {
	ListOptions
	SourceID        int64
	LoginName       string
	Query           string
	Sort            string // "name", "created", "updated", "id"
	Order           string // "asc", "desc"
	Visibility      string
	IsActive        *bool
	IsAdmin         *bool
	IsRestricted    *bool
	Is2FAEnabled    *bool
	IsProhibitLogin *bool
}

AdminListUsersOptions options for listing admin users

func (*AdminListUsersOptions) QueryEncode added in v0.23.0

func (opt *AdminListUsersOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type AnnotatedTag added in v0.15.0

type AnnotatedTag struct {
	Tag          string                     `json:"tag"`
	SHA          string                     `json:"sha"`
	URL          string                     `json:"url"`
	Message      string                     `json:"message"`
	Tagger       *CommitUser                `json:"tagger"`
	Object       *AnnotatedTagObject        `json:"object"`
	Verification *PayloadCommitVerification `json:"verification"`
}

AnnotatedTag represents an annotated tag

type AnnotatedTagObject added in v0.15.0

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

AnnotatedTagObject contains meta information of the tag object

type ApplyDiffPatchFileOptions added in v0.24.0

type ApplyDiffPatchFileOptions struct {
	FileOptions
	Content string `json:"content"`
}

ApplyDiffPatchFileOptions applies a patch against repository contents.

func (ApplyDiffPatchFileOptions) Validate added in v0.24.0

func (opt ApplyDiffPatchFileOptions) Validate() error

Validate checks whether the patch payload is valid.

type ArchiveType added in v0.13.0

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

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 Badge added in v0.23.0

type Badge struct {
	ID          int64  `json:"id"`
	Slug        string `json:"slug"`
	Description string `json:"description"`
	ImageURL    string `json:"image_url"`
}

Badge represents a user badge

type Branch

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 added in v0.12.0

type BranchProtection struct {
	BranchName                    string    `json:"branch_name"`
	RuleName                      string    `json:"rule_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"`
	BlockOnOfficialReviewRequests bool      `json:"block_on_official_review_requests"`
	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"`
	UnprotectedFilePatterns       string    `json:"unprotected_file_patterns"`
	Created                       time.Time `json:"created_at"`
	Updated                       time.Time `json:"updated_at"`
}

BranchProtection represents a branch protection for a repository

type ChangeFileOperation added in v0.24.0

type ChangeFileOperation struct {
	Operation string `json:"operation"` // create, update, upload, rename, delete
	Path      string `json:"path"`
	Content   string `json:"content"`             // base64 encoded for create/update
	SHA       string `json:"sha,omitempty"`       // required for update/delete
	FromPath  string `json:"from_path,omitempty"` // for rename
}

ChangeFileOperation represents a file operation in batch

type ChangeFilesOptions added in v0.24.0

type ChangeFilesOptions struct {
	Files     []*ChangeFileOperation `json:"files"`
	Message   string                 `json:"message"`
	Branch    string                 `json:"branch,omitempty"`
	NewBranch string                 `json:"new_branch,omitempty"`
	ForcePush bool                   `json:"force_push,omitempty"`
	Author    Identity               `json:"author"`
	Committer Identity               `json:"committer"`
	Dates     CommitDateOptions      `json:"dates"`
	Signoff   bool                   `json:"signoff,omitempty"`
}

ChangeFilesOptions options for batch file operations

type ChangedFile added in v0.16.0

type ChangedFile struct {
	Filename         string `json:"filename"`
	PreviousFilename string `json:"previous_filename"`
	Status           string `json:"status"`
	Additions        int    `json:"additions"`
	Deletions        int    `json:"deletions"`
	Changes          int    `json:"changes"`
	HTMLURL          string `json:"html_url"`
	ContentsURL      string `json:"contents_url"`
	RawURL           string `json:"raw_url"`
}

ChangedFile is a changed file in a diff

type Client

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

Client represents a thread-safe Gitea API client.

func NewClient

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

NewClient initializes and returns a API client. Usage of all gitea.Client methods is concurrency-safe.

func NewClientWithHTTP

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

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

func (*Client) AcceptRepoTransfer added in v0.16.0

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

AcceptRepoTransfer accepts a repo transfer.

func (*Client) AddCollaborator

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

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

AddEmail add one email to current user with options

func (*Client) AddIssueLabels

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

AddIssueLabels add one or more labels to one issue

func (*Client) AddIssueSubscription

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

AddIssueSubscription Subscribe user to issue

func (*Client) AddRepoTeam added in v0.15.0

func (c *Client) AddRepoTeam(user, repo, team string) (*Response, error)

AddRepoTeam add a team to a repository

func (*Client) AddRepoTopic

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

AddRepoTopic adds a topic to a repo's topics list

func (*Client) AddTeamMember

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

AddTeamMember adds a member to a team

func (*Client) AddTeamRepository

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

AddTeamRepository adds a repository to a team

func (*Client) AddTime

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) AddUserBadges added in v0.23.0

func (c *Client) AddUserBadges(username string, opt UserBadgeOption) (*Response, error)

AddUserBadges adds badges to a user by their slugs

func (*Client) AdminCreateOrg

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

AdminCreateOrg create an organization

func (*Client) AdminCreateRepo

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

AdminCreateRepo create a repo

func (*Client) AdminCreateUser

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

AdminCreateUser create a user

func (*Client) AdminCreateUserPublicKey

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

AdminCreateUserPublicKey adds a public key for the user

func (*Client) AdminDeleteUser

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

AdminDeleteUser delete one user according name

func (*Client) AdminDeleteUserPublicKey

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

AdminDeleteUserPublicKey deletes a user's public key

func (*Client) AdminEditUser

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

AdminEditUser modify user informations

func (*Client) AdminListOrgs

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

AdminListOrgs lists all orgs

func (*Client) AdminListUsers

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

AdminListUsers lists all users

func (*Client) AdminRenameUser added in v0.23.0

func (c *Client) AdminRenameUser(username string, opt RenameUserOption) (*Response, error)

AdminRenameUser renames a user

func (*Client) AdoptUnadoptedRepo added in v0.23.0

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

AdoptUnadoptedRepo adopts an unadopted repository

func (*Client) ApplyRepoDiffPatch added in v0.24.0

func (c *Client) ApplyRepoDiffPatch(owner, repo string, opt ApplyDiffPatchFileOptions) (*FileResponse, *Response, error)

ApplyRepoDiffPatch applies a patch to repository contents.

func (*Client) BlockOrgUser added in v0.23.0

func (c *Client) BlockOrgUser(org, username string) (*Response, error)

BlockOrgUser blocks a user from the organization

func (*Client) BlockUser added in v0.23.0

func (c *Client) BlockUser(username string) (*Response, error)

BlockUser blocks a user

func (*Client) CancelScheduledAutoMerge added in v0.24.0

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

CancelScheduledAutoMerge cancels a scheduled automatic merge for a pull request.

func (*Client) ChangeFiles added in v0.24.0

func (c *Client) ChangeFiles(owner, repo string, opt ChangeFilesOptions) (*FileResponse, *Response, error)

ChangeFiles creates, updates, or deletes multiple files

func (*Client) CheckIssueSubscription added in v0.12.0

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 added in v0.11.1

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

CheckNotifications list users's notification threads

func (*Client) CheckOrgBlock added in v0.23.0

func (c *Client) CheckOrgBlock(org, username string) (bool, *Response, error)

CheckOrgBlock checks if a user is blocked by the organization

func (*Client) CheckOrgMembership added in v0.11.1

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

CheckOrgMembership Check if a user is a member of an organization

func (*Client) CheckPinAllowed added in v0.24.0

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

CheckPinAllowed checks if the current user can pin issues or PRs

func (*Client) CheckPublicOrgMembership added in v0.11.1

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

CheckPublicOrgMembership Check if a user is a member of an organization

func (*Client) CheckRepoTeam added in v0.15.0

func (c *Client) CheckRepoTeam(user, repo, team string) (*Team, *Response, error)

CheckRepoTeam check if team is assigned to repo by name and return it. If not assigned, it will return nil.

func (*Client) CheckRepoWatch added in v0.11.1

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

CheckRepoWatch check if the current user is watching a repo

func (*Client) CheckServerVersionConstraint

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) CheckUserBlock added in v0.23.0

func (c *Client) CheckUserBlock(username string) (bool, *Response, error)

CheckUserBlock checks if a user is blocked by the authenticated user

func (*Client) ClearIssueLabels

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

ClearIssueLabels delete all the labels of one issue.

func (*Client) CollaboratorPermission added in v0.16.0

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

CollaboratorPermission gets collaborator permission of a repository

func (*Client) CompareCommits added in v0.18.0

func (c *Client) CompareCommits(user, repo, prev, current string) (*Compare, *Response, error)

CompareCommits compares two commits in a repository.

func (*Client) CreateAccessToken

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

CreateAccessToken create one access token with options

func (*Client) CreateAdminActionRunnerRegistrationToken added in v0.24.0

func (c *Client) CreateAdminActionRunnerRegistrationToken() (*RegistrationToken, *Response, error)

CreateAdminActionRunnerRegistrationToken creates an admin-scope runner registration token.

func (*Client) CreateAdminHook added in v0.23.0

func (c *Client) CreateAdminHook(opt CreateHookOption) (*Hook, *Response, error)

CreateAdminHook creates a system webhook

func (*Client) CreateBranch added in v0.13.0

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

CreateBranch creates a branch for a user's repository

func (*Client) CreateBranchProtection added in v0.12.0

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

CreateBranchProtection creates a branch protection for a repo

func (*Client) CreateDeployKey

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

CreateDeployKey options when create one deploy key

func (*Client) CreateFile added in v0.12.0

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

CreateFile create a file in a repository

func (*Client) CreateFork

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

CreateFork create a fork of a repository

func (*Client) CreateGPGKey

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

CreateGPGKey create GPG key with options

func (*Client) CreateIssue

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

CreateIssue create a new issue for a given repository

func (*Client) CreateIssueAttachment added in v0.24.0

func (c *Client) CreateIssueAttachment(owner, repo string, index int64, file io.Reader, filename string) (*Attachment, *Response, error)

CreateIssueAttachment uploads an attachment for an issue.

func (*Client) CreateIssueBlocking added in v0.23.0

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

CreateIssueBlocking blocks an issue with another issue

func (*Client) CreateIssueComment

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

CreateIssueComment create comment on an issue.

func (*Client) CreateIssueCommentAttachment added in v0.24.0

func (c *Client) CreateIssueCommentAttachment(owner, repo string, commentID int64, file io.Reader, filename string) (*Attachment, *Response, error)

CreateIssueCommentAttachment uploads an attachment for a comment.

func (*Client) CreateIssueDependency added in v0.23.0

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

CreateIssueDependency creates a new issue dependency

func (*Client) CreateLabel

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

CreateLabel create one label of repository

func (*Client) CreateMilestone

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

CreateMilestone create one milestone with options

func (*Client) CreateMyHook added in v0.18.0

func (c *Client) CreateMyHook(opt CreateHookOption) (*Hook, *Response, error)

CreateMyHook create one hook for the authenticated user, with options

func (*Client) CreateOauth2 added in v0.12.0

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

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

func (*Client) CreateOrg

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

CreateOrg creates an organization

func (*Client) CreateOrgActionRunnerRegistrationToken added in v0.24.0

func (c *Client) CreateOrgActionRunnerRegistrationToken(org string) (*RegistrationToken, *Response, error)

CreateOrgActionRunnerRegistrationToken creates an organization runner registration token.

func (*Client) CreateOrgActionSecret added in v0.19.0

func (c *Client) CreateOrgActionSecret(org, secretName string, opt CreateOrUpdateSecretOption) (*Response, error)

CreateOrgActionSecret creates a secret for the specified organization in the Gitea Actions.

func (*Client) CreateOrgActionVariable added in v0.22.0

func (c *Client) CreateOrgActionVariable(org, name string, opt CreateActionVariableOption) (*Response, error)

CreateOrgActionVariable creates a variable for the specified organization in the Gitea Actions.

func (*Client) CreateOrgHook

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

CreateOrgHook create one hook for an organization, with options

func (*Client) CreateOrgLabel added in v0.22.1

func (c *Client) CreateOrgLabel(orgName string, opt CreateOrgLabelOption) (*Label, *Response, error)

CreateOrgLabel creates a new label under an organization

func (*Client) CreateOrgRepo

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

CreateOrgRepo creates an organization repository for authenticated user.

func (*Client) CreatePublicKey

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

CreatePublicKey create public key with options

func (*Client) CreatePullRequest

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

CreatePullRequest create pull request with options

func (*Client) CreatePullReview added in v0.12.0

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

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

CreateRelease create a release

func (*Client) CreateReleaseAttachment

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

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

CreateRepo creates a repository for authenticated user.

func (*Client) CreateRepoActionRunnerRegistrationToken added in v0.24.0

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

CreateRepoActionRunnerRegistrationToken creates a repository-scope runner registration token.

func (*Client) CreateRepoActionSecret added in v0.19.0

func (c *Client) CreateRepoActionSecret(user, repo, secretName string, opt CreateOrUpdateSecretOption) (*Response, error)

CreateRepoActionSecret creates a secret for the specified repository in the Gitea Actions.

func (*Client) CreateRepoActionVariable added in v0.20.0

func (c *Client) CreateRepoActionVariable(user, repo, variableName, value string) (*Response, error)

CreateRepoActionVariable creates a repository variable in the Gitea Actions. It takes the repository owner, name, variable name and the variable value as parameters. The function returns the HTTP response and an error, if any.

func (*Client) CreateRepoFromTemplate added in v0.15.0

func (c *Client) CreateRepoFromTemplate(templateOwner, templateRepo string, opt CreateRepoFromTemplateOption) (*Repository, *Response, error)

CreateRepoFromTemplate create a repository using a template

func (*Client) CreateRepoHook

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

CreateRepoHook create one hook for a repository, with options

func (*Client) CreateReviewRequests added in v0.14.0

func (c *Client) CreateReviewRequests(owner, repo string, index int64, opt PullReviewRequestOptions) (*Response, error)

CreateReviewRequests create review requests to an pull request

func (*Client) CreateStatus

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

CreateStatus creates a new Status for a given Commit

func (*Client) CreateTag added in v0.15.0

func (c *Client) CreateTag(user, repo string, opt CreateTagOption) (*Tag, *Response, error)

CreateTag create a new git tag in a repository

func (*Client) CreateTagProtection added in v0.21.0

func (c *Client) CreateTagProtection(owner, repo string, opt CreateTagProtectionOption) (*TagProtection, *Response, error)

CreateTagProtection creates a tag protection for a repo

func (*Client) CreateTeam

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

CreateTeam creates a team for an organization

func (*Client) CreateUserActionRunnerRegistrationToken added in v0.24.0

func (c *Client) CreateUserActionRunnerRegistrationToken() (*RegistrationToken, *Response, error)

CreateUserActionRunnerRegistrationToken creates a user-scope runner registration token.

func (*Client) CreateUserActionSecret added in v0.24.0

func (c *Client) CreateUserActionSecret(secretName string, opt CreateOrUpdateSecretOption) (*Response, error)

CreateUserActionSecret creates or updates a user-scope Actions secret.

func (*Client) CreateUserActionVariable added in v0.24.0

func (c *Client) CreateUserActionVariable(variableName string, opt CreateActionVariableOption) (*Response, error)

CreateUserActionVariable creates one user-scope Actions variable.

func (*Client) CreateWikiPage added in v0.23.0

func (c *Client) CreateWikiPage(owner, repo string, opt CreateWikiPageOptions) (*WikiPage, *Response, error)

CreateWikiPage creates a new wiki page

func (*Client) DeleteAccessToken

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

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

func (*Client) DeleteAdminActionRunner added in v0.24.0

func (c *Client) DeleteAdminActionRunner(runnerID int64) (*Response, error)

DeleteAdminActionRunner deletes one admin-scope Actions runner.

func (*Client) DeleteAdminHook added in v0.23.0

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

DeleteAdminHook deletes a system webhook

func (*Client) DeleteBranchProtection added in v0.12.0

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

DeleteBranchProtection deletes a branch protection for a repo

func (*Client) DeleteCollaborator

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

DeleteCollaborator remove a collaborator from a repository

func (*Client) DeleteDeployKey

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

DeleteDeployKey delete deploy key with key id

func (*Client) DeleteEmail

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

DeleteEmail delete one email of current users'

func (*Client) DeleteFile added in v0.12.0

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

DeleteFile delete a file from repository

func (*Client) DeleteGPGKey

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

DeleteGPGKey delete GPG key with key id

func (*Client) DeleteIssue added in v0.16.0

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

DeleteIssue delete a issue from a repository

func (*Client) DeleteIssueAttachment added in v0.24.0

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

DeleteIssueAttachment deletes an issue attachment.

func (*Client) DeleteIssueComment

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

DeleteIssueComment deletes an issue comment.

func (*Client) DeleteIssueCommentAttachment added in v0.23.0

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

DeleteIssueCommentAttachment deletes a comment attachment

func (*Client) DeleteIssueCommentReaction

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

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

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

DeleteIssueReaction remove a reaction from an issue

func (*Client) DeleteIssueStopwatch

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

DeleteIssueStopwatch delete / cancel a specific stopwatch

func (*Client) DeleteIssueSubscription

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

DeleteIssueSubscription unsubscribe user from issue

func (*Client) DeleteLabel

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

DeleteLabel delete one label of repository by id

func (*Client) DeleteMilestone

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

DeleteMilestone delete one milestone by id

func (*Client) DeleteMilestoneByName added in v0.13.0

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

DeleteMilestoneByName delete one milestone by name

func (*Client) DeleteMyHook added in v0.18.0

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

DeleteMyHook delete one hook from the authenticated user, with hook id

func (*Client) DeleteOauth2 added in v0.12.0

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

DeleteOauth2 delete an Oauth2 application by ID

func (*Client) DeleteOrg

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

DeleteOrg deletes an organization

func (*Client) DeleteOrgActionRunner added in v0.24.0

func (c *Client) DeleteOrgActionRunner(org string, runnerID int64) (*Response, error)

DeleteOrgActionRunner deletes one organization-scoped Actions runner.

func (*Client) DeleteOrgActionSecret added in v0.24.0

func (c *Client) DeleteOrgActionSecret(org, secretName string) (*Response, error)

DeleteOrgActionSecret deletes an organization's Actions secret.

func (*Client) DeleteOrgActionVariable added in v0.24.0

func (c *Client) DeleteOrgActionVariable(org, name string) (*Response, error)

DeleteOrgActionVariable deletes an organization's Actions variable.

func (*Client) DeleteOrgAvatar added in v0.23.0

func (c *Client) DeleteOrgAvatar(org string) (*Response, error)

DeleteOrgAvatar deletes the organization's avatar

func (*Client) DeleteOrgHook

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

DeleteOrgHook delete one hook from an organization, with hook id

func (*Client) DeleteOrgLabel added in v0.22.1

func (c *Client) DeleteOrgLabel(orgName string, labelID int64) (*Response, error)

DeleteOrgLabel deletes a org label by ID

func (*Client) DeleteOrgMembership added in v0.11.1

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

DeleteOrgMembership remove a member from an organization

func (*Client) DeletePackage added in v0.16.0

func (c *Client) DeletePackage(owner, packageType, name, version string) (*Response, error)

DeletePackage deletes a specific package version

func (*Client) DeletePublicKey

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

DeletePublicKey delete public key with key id

func (*Client) DeletePullReview added in v0.12.0

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

DeletePullReview delete a specific review from a pull request

func (*Client) DeletePushMirror added in v0.22.0

func (c *Client) DeletePushMirror(user, repo, remoteName string) (*Response, error)

DeletePushMirror deletes a push mirror from a repository by remote name

func (*Client) DeleteRelease

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

DeleteRelease delete a release from a repository, keeping its tag

func (*Client) DeleteReleaseAttachment

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

DeleteReleaseAttachment deletes the given attachment including the uploaded file

func (*Client) DeleteReleaseByTag added in v0.14.0

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

DeleteReleaseByTag deletes a release frm a repository by tag

func (*Client) DeleteRepo

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

DeleteRepo deletes a repository of user or organization.

func (*Client) DeleteRepoActionArtifact added in v0.24.0

func (c *Client) DeleteRepoActionArtifact(owner, repo string, artifactID int64) (*Response, error)

DeleteRepoActionArtifact deletes one repository artifact.

func (*Client) DeleteRepoActionRun added in v0.23.0

func (c *Client) DeleteRepoActionRun(owner, repo string, runID int64) (*Response, error)

DeleteRepoActionRun deletes a workflow run. Requires Gitea 1.26.0 or later.

func (*Client) DeleteRepoActionRunner added in v0.24.0

func (c *Client) DeleteRepoActionRunner(owner, repo string, runnerID int64) (*Response, error)

DeleteRepoActionRunner deletes one repository-scope Actions runner.

func (*Client) DeleteRepoActionSecret added in v0.20.0

func (c *Client) DeleteRepoActionSecret(user, repo, secretName string) (*Response, error)

DeleteRepoActionSecret deletes a secret from the Gitea Actions. It takes the repository owner, name and the secret name as parameters. The function returns the HTTP response and an error, if any.

func (*Client) DeleteRepoActionVariable added in v0.20.0

func (c *Client) DeleteRepoActionVariable(user, reponame, variableName string) (*Response, error)

DeleteRepoActionVariable deletes a repository variable in the Gitea Actions. It takes the repository owner, name and the variable name as parameters. The function returns the HTTP response and an error, if any.

func (*Client) DeleteRepoAvatar added in v0.23.0

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

DeleteRepoAvatar deletes a repository's avatar

func (*Client) DeleteRepoBranch added in v0.12.0

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

DeleteRepoBranch delete a branch in a repository

func (*Client) DeleteRepoGitHook

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

DeleteRepoGitHook delete one Git hook from a repository

func (*Client) DeleteRepoHook

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

DeleteRepoHook delete one hook from a repository, with hook id

func (*Client) DeleteRepoTopic

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

DeleteRepoTopic deletes a topic from repo's topics list

func (*Client) DeleteReviewRequests added in v0.14.0

func (c *Client) DeleteReviewRequests(owner, repo string, index int64, opt PullReviewRequestOptions) (*Response, error)

DeleteReviewRequests delete review requests to an pull request

func (*Client) DeleteTag added in v0.14.0

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

DeleteTag deletes a tag from a repository, if no release refers to it

func (*Client) DeleteTagProtection added in v0.21.0

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

DeleteTagProtection deletes a tag protection for a repo

func (*Client) DeleteTeam

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

DeleteTeam deletes a team of an organization

func (*Client) DeleteTime

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) DeleteUnadoptedRepo added in v0.23.0

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

DeleteUnadoptedRepo deletes an unadopted repository

func (*Client) DeleteUserActionRunner added in v0.24.0

func (c *Client) DeleteUserActionRunner(runnerID int64) (*Response, error)

DeleteUserActionRunner deletes one user-scope Actions runner.

func (*Client) DeleteUserActionSecret added in v0.24.0

func (c *Client) DeleteUserActionSecret(secretName string) (*Response, error)

DeleteUserActionSecret deletes a user-scope Actions secret.

func (*Client) DeleteUserActionVariable added in v0.24.0

func (c *Client) DeleteUserActionVariable(variableName string) (*Response, error)

DeleteUserActionVariable deletes one user-scope Actions variable.

func (*Client) DeleteUserAvatar added in v0.23.0

func (c *Client) DeleteUserAvatar() (*Response, error)

DeleteUserAvatar deletes the authenticated user's avatar

func (*Client) DeleteUserBadge added in v0.23.0

func (c *Client) DeleteUserBadge(username string, opt UserBadgeOption) (*Response, error)

DeleteUserBadge deletes a user's badge

func (*Client) DeleteWikiPage added in v0.23.0

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

DeleteWikiPage deletes a wiki page

func (*Client) DisableRepoActionWorkflow added in v0.24.0

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

DisableRepoActionWorkflow disables one repository workflow.

func (*Client) DismissPullReview added in v0.14.0

func (c *Client) DismissPullReview(owner, repo string, index, id int64, opt DismissPullReviewOptions) (*Response, error)

DismissPullReview dismiss a review for a pull request

func (*Client) DispatchRepoActionWorkflow added in v0.24.0

func (c *Client) DispatchRepoActionWorkflow(owner, repo, workflowID string, opt CreateActionWorkflowDispatchOption, returnRunDetails bool) (*RunDetails, *Response, error)

DispatchRepoActionWorkflow dispatches one repository workflow.

func (*Client) EditAdminHook added in v0.23.0

func (c *Client) EditAdminHook(id int64, opt EditHookOption) (*Hook, *Response, error)

EditAdminHook edits a system webhook

func (*Client) EditBranchProtection added in v0.12.0

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

EditBranchProtection edits a branch protection for a repo

func (*Client) EditIssue

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) EditIssueAttachment added in v0.24.0

func (c *Client) EditIssueAttachment(owner, repo string, index, attachmentID int64, form EditAttachmentOptions) (*Attachment, *Response, error)

EditIssueAttachment updates an issue attachment.

func (*Client) EditIssueComment

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

EditIssueComment edits an issue comment.

func (*Client) EditIssueCommentAttachment added in v0.23.0

func (c *Client) EditIssueCommentAttachment(owner, repo string, commentID, attachmentID int64, form EditAttachmentOptions) (*Attachment, *Response, error)

EditIssueCommentAttachment updates a comment attachment

func (*Client) EditLabel

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

EditLabel modify one label with options

func (*Client) EditMilestone

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

EditMilestone modify milestone with options

func (*Client) EditMilestoneByName added in v0.13.0

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

EditMilestoneByName modify milestone with options

func (*Client) EditMyHook added in v0.18.0

func (c *Client) EditMyHook(id int64, opt EditHookOption) (*Response, error)

EditMyHook modify one hook of the authenticated user, with hook id and options

func (*Client) EditOrg

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

EditOrg modify one organization via options

func (*Client) EditOrgHook

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) EditOrgLabel added in v0.22.1

func (c *Client) EditOrgLabel(orgName string, labelID int64, opt EditOrgLabelOption) (*Label, *Response, error)

EditOrgLabel edits an existing org-level label by ID

func (*Client) EditPullRequest

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

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

EditRelease edit a release

func (*Client) EditReleaseAttachment

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

EditReleaseAttachment updates the given attachment with the given options

func (*Client) EditRepo

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

EditRepo edit the properties of a repository

func (*Client) EditRepoGitHook

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

EditRepoGitHook modify one Git hook of a repository

func (*Client) EditRepoHook

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) EditTagProtection added in v0.21.0

func (c *Client) EditTagProtection(owner, repo string, id int64, opt EditTagProtectionOption) (*TagProtection, *Response, error)

EditTagProtection edits a tag protection for a repo

func (*Client) EditTeam

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

EditTeam edits a team of an organization

func (*Client) EditWikiPage added in v0.23.0

func (c *Client) EditWikiPage(owner, repo, pageName string, opt CreateWikiPageOptions) (*WikiPage, *Response, error)

EditWikiPage edits an existing wiki page

func (*Client) EnableRepoActionWorkflow added in v0.24.0

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

EnableRepoActionWorkflow enables one repository workflow.

func (*Client) Follow

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

Follow set current user follow the target

func (*Client) GetActivityPubPerson added in v0.23.0

func (c *Client) GetActivityPubPerson(userID int64) (ActivityPub, *Response, error)

GetActivityPubPerson returns the Person actor for a user

func (*Client) GetActivityPubPersonResponse added in v0.23.0

func (c *Client) GetActivityPubPersonResponse(userID int64) ([]byte, *Response, error)

GetActivityPubPersonResponse returns the raw ActivityPub Person response

func (*Client) GetAdminActionRunner added in v0.24.0

func (c *Client) GetAdminActionRunner(runnerID int64) (*ActionRunner, *Response, error)

GetAdminActionRunner gets one admin-scope Actions runner.

func (*Client) GetAdminHook added in v0.23.0

func (c *Client) GetAdminHook(id int64) (*Hook, *Response, error)

GetAdminHook gets a system webhook by ID

func (*Client) GetAnnotatedTag added in v0.15.0

func (c *Client) GetAnnotatedTag(user, repo, sha string) (*AnnotatedTag, *Response, error)

GetAnnotatedTag get the tag object of an annotated tag (not lightweight tags) of a repository

func (*Client) GetArchive added in v0.13.0

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) GetArchiveReader added in v0.14.0

func (c *Client) GetArchiveReader(owner, repo, ref string, ext ArchiveType) (io.ReadCloser, *Response, error)

GetArchiveReader gets a `git archive` for a particular tree-ish git reference such as a branch name (`master`), a commit hash (`70b7c74b33`), a tag (`v1.2.1`). The archive is returned as a byte stream in a ReadCloser. It is the responsibility of the client to close the reader.

func (*Client) GetAssignees added in v0.15.0

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

GetAssignees return all users that have write access and can be assigned to issues

func (*Client) GetBlob

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

GetBlob get the blob of a repository file

func (*Client) GetBranchProtection added in v0.12.0

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

GetBranchProtection gets a branch protection

func (*Client) GetCombinedStatus

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

GetCombinedStatus returns the CombinedStatus for a given Commit

func (*Client) GetCommitDiff added in v0.16.0

func (c *Client) GetCommitDiff(user, repo, commitID string) ([]byte, *Response, error)

GetCommitDiff returns the commit's raw diff.

func (*Client) GetCommitPatch added in v0.16.0

func (c *Client) GetCommitPatch(user, repo, commitID string) ([]byte, *Response, error)

GetCommitPatch returns the commit's raw patch.

func (*Client) GetCommitPullRequest added in v0.24.0

func (c *Client) GetCommitPullRequest(owner, repo, sha string) (*PullRequest, *Response, error)

GetCommitPullRequest gets the pull request associated with a commit SHA

func (*Client) GetContents added in v0.12.0

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

GetContents get the metadata and contents of a file in a repository ref is optional

func (*Client) GetContentsExt added in v0.23.0

func (c *Client) GetContentsExt(owner, repo, filepath string, opt GetContentsExtOptions) (*ContentsExtResponse, *Response, error)

GetContentsExt gets extended file metadata and/or content from a repository The extended "contents" API, to get file metadata and/or content, or list a directory

func (*Client) GetDeployKey

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

GetDeployKey get one deploy key with key id

func (*Client) GetEditorConfig added in v0.23.0

func (c *Client) GetEditorConfig(owner, repo, filepath string, ref ...string) ([]byte, *Response, error)

GetEditorConfig gets the EditorConfig definitions of a file in a repository

func (*Client) GetFile

func (c *Client) GetFile(owner, repo, ref, filepath string, resolveLFS ...bool) ([]byte, *Response, error)

GetFile downloads a file of repository, ref can be branch/tag/commit. it optional can resolve lfs pointers and server the file instead e.g.: ref -> master, filepath -> README.md (no leading slash)

func (*Client) GetFileReader added in v0.16.0

func (c *Client) GetFileReader(owner, repo, ref, filepath string, resolveLFS ...bool) (io.ReadCloser, *Response, error)

GetFileReader return reader for download a file of repository, ref can be branch/tag/commit. it optional can resolve lfs pointers and server the file instead e.g.: ref -> master, filepath -> README.md (no leading slash)

func (*Client) GetGPGKey

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

GetGPGKey get current user's GPG key by key id

func (*Client) GetGPGKeyVerificationToken added in v0.23.0

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

GetGPGKeyVerificationToken gets a verification token for adding a GPG key. Returns the token as a plain string (API returns text/plain, not JSON). The user should sign this token with their GPG key and submit via VerifyGPGKey.

func (*Client) GetGitignoreTemplateInfo added in v0.23.0

func (c *Client) GetGitignoreTemplateInfo(name string) (*GitignoreTemplateInfo, *Response, error)

GetGitignoreTemplateInfo gets information about a gitignore template

func (*Client) GetGlobalAPISettings added in v0.13.0

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

GetGlobalAPISettings get global api settings witch are exposed by it

func (*Client) GetGlobalAttachmentSettings added in v0.13.0

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

GetGlobalAttachmentSettings get global repository settings witch are exposed by API

func (*Client) GetGlobalRepoSettings added in v0.13.0

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

GetGlobalRepoSettings get global repository settings witch are exposed by API

func (*Client) GetGlobalUISettings added in v0.13.0

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

GetGlobalUISettings get global ui settings witch are exposed by API

func (*Client) GetIssue

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

GetIssue returns a single issue for a given repository

func (*Client) GetIssueAttachment added in v0.24.0

func (c *Client) GetIssueAttachment(owner, repo string, index, attachmentID int64) (*Attachment, *Response, error)

GetIssueAttachment gets an issue attachment.

func (*Client) GetIssueComment added in v0.11.1

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

GetIssueComment get a comment for a given repo by id.

func (*Client) GetIssueCommentAttachment added in v0.23.0

func (c *Client) GetIssueCommentAttachment(owner, repo string, commentID, attachmentID int64) (*Attachment, *Response, error)

GetIssueCommentAttachment gets a comment attachment

func (*Client) GetIssueCommentReactions

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) GetIssueConfig added in v0.24.0

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

GetIssueConfig gets the issue config for a repository.

func (*Client) GetIssueLabels

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 deprecated

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

GetIssueReactions get a list reactions of an issue

Deprecated: Use ListIssueReactions instead, which supports pagination.

func (*Client) GetIssueSubscribers deprecated

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

GetIssueSubscribers get list of users who subscribed on an issue

Deprecated: Use ListIssueSubscribers instead, which supports pagination.

func (*Client) GetIssueTemplates added in v0.16.0

func (c *Client) GetIssueTemplates(owner, repo string) ([]*IssueTemplate, *Response, error)

GetIssueTemplates lists all issue templates of the repository

func (*Client) GetLabelTemplate added in v0.23.0

func (c *Client) GetLabelTemplate(name string) ([]*LabelTemplate, *Response, error)

GetLabelTemplate gets all labels in a template

func (*Client) GetLatestPackage added in v0.23.0

func (c *Client) GetLatestPackage(owner, packageType, name string) (*Package, *Response, error)

GetLatestPackage gets the details of the latest version of a package

func (*Client) GetLatestRelease added in v0.18.0

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

GetLatestRelease get the latest release of a repository

func (*Client) GetLicenseTemplateInfo added in v0.23.0

func (c *Client) GetLicenseTemplateInfo(name string) (*LicenseTemplateInfo, *Response, error)

GetLicenseTemplateInfo gets information about a license template

func (*Client) GetMilestone

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 added in v0.13.0

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

GetMilestoneByName get one milestone by repo and milestone name

func (*Client) GetMyHook added in v0.18.0

func (c *Client) GetMyHook(id int64) (*Hook, *Response, error)

GetMyHook get a hook of the authenticated user

func (*Client) GetMyStarredRepos added in v0.14.0

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

GetMyStarredRepos returns the repos that the authenticated user has starred

func (*Client) GetMyStopwatches deprecated

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

GetMyStopwatches list all stopwatches

Deprecated: Use ListMyStopwatches instead, which supports pagination.

func (*Client) GetMyTrackedTimes deprecated

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

GetMyTrackedTimes list tracked times of the current user

Deprecated: Use ListMyTrackedTimes instead, which supports pagination and filtering.

func (*Client) GetMyUserInfo

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

GetMyUserInfo get user info of current user

func (*Client) GetMyWatchedRepos added in v0.11.1

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

GetMyWatchedRepos list repositories watched by the authenticated user

func (*Client) GetNodeInfo added in v0.23.0

func (c *Client) GetNodeInfo() (*NodeInfo, *Response, error)

GetNodeInfo gets the nodeinfo of the Gitea application

func (*Client) GetNotification added in v0.11.1

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

GetNotification get notification thread by ID

func (*Client) GetOauth2 added in v0.12.0

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

GetOauth2 a specific Oauth2 Application by ID.

func (*Client) GetOrg

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

GetOrg get one organization by name

func (*Client) GetOrgActionRunner added in v0.24.0

func (c *Client) GetOrgActionRunner(org string, runnerID int64) (*ActionRunner, *Response, error)

GetOrgActionRunner gets one organization-scoped Actions runner.

func (*Client) GetOrgActionVariable added in v0.22.0

func (c *Client) GetOrgActionVariable(org, name string) (*ActionVariable, *Response, error)

GetOrgActionVariable gets a single organization's action variable by name

func (*Client) GetOrgHook

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

GetOrgHook get a hook of an organization

func (*Client) GetOrgLabel added in v0.22.1

func (c *Client) GetOrgLabel(orgName string, labelID int64) (*Label, *Response, error)

GetOrgLabel get one label of organization by org it

func (*Client) GetOrgPermissions added in v0.16.0

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

GetOrgPermissions returns user permissions for specific organization.

func (*Client) GetPackage added in v0.16.0

func (c *Client) GetPackage(owner, packageType, name, version string) (*Package, *Response, error)

GetPackage gets the details of a specific package version

func (*Client) GetPublicKey

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

GetPublicKey get current user's public key by key id

func (*Client) GetPullRequest

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

GetPullRequest get information of one PR

func (*Client) GetPullRequestByBaseHead added in v0.24.0

func (c *Client) GetPullRequestByBaseHead(owner, repo, base, head string) (*PullRequest, *Response, error)

GetPullRequestByBaseHead gets a pull request by its base and head branches.

func (*Client) GetPullRequestDiff added in v0.13.0

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

GetPullRequestDiff gets the diff of a PR. For Gitea >= 1.16, you must set includeBinary to get an applicable diff

func (*Client) GetPullRequestPatch added in v0.13.0

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

GetPullRequestPatch gets the git patchset of a PR

func (*Client) GetPullReview added in v0.12.0

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

GetPullReview gets a specific review of a pull request

func (*Client) GetPushMirrorByRemoteName added in v0.22.0

func (c *Client) GetPushMirrorByRemoteName(user, repo, remoteName string) (*PushMirrorResponse, *Response, error)

GetPushMirrorByRemoteName get a push mirror of the repository by remote name

func (*Client) GetRawFile added in v0.23.0

func (c *Client) GetRawFile(owner, repo, filepath string, ref ...string) ([]byte, *Response, error)

GetRawFile gets a file from a repository Unlike GetRawFileOrLFS, this does NOT resolve LFS pointers

func (*Client) GetRawFileOrLFS added in v0.23.0

func (c *Client) GetRawFileOrLFS(owner, repo, filepath string, ref ...string) ([]byte, *Response, error)

GetRawFileOrLFS gets a file or its LFS object from a repository This endpoint resolves LFS pointers and returns actual LFS objects

func (*Client) GetRelease

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

GetRelease get a release of a repository by id

func (*Client) GetReleaseAttachment

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

GetReleaseAttachment returns the requested attachment

func (*Client) GetReleaseByTag added in v0.13.1

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

GetReleaseByTag get a release of a repository by tag

func (*Client) GetRepo

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

GetRepo returns information of a repository of given owner.

func (*Client) GetRepoActionArtifact added in v0.24.0

func (c *Client) GetRepoActionArtifact(owner, repo string, artifactID int64) (*ActionArtifact, *Response, error)

GetRepoActionArtifact gets one repository artifact.

func (*Client) GetRepoActionArtifactArchive added in v0.24.0

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

GetRepoActionArtifactArchive downloads one repository artifact zip archive.

func (*Client) GetRepoActionArtifactArchiveReader added in v0.24.0

func (c *Client) GetRepoActionArtifactArchiveReader(owner, repo string, artifactID int64) (io.ReadCloser, *Response, error)

GetRepoActionArtifactArchiveReader returns a reader for one repository artifact zip archive.

func (*Client) GetRepoActionJob added in v0.23.0

func (c *Client) GetRepoActionJob(owner, repo string, jobID int64) (*ActionWorkflowJob, *Response, error)

GetRepoActionJob gets a single job. Requires Gitea 1.26.0 or later.

func (*Client) GetRepoActionJobLogs added in v0.23.0

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

GetRepoActionJobLogs gets the logs for a specific job. Requires Gitea 1.26.0 or later.

func (*Client) GetRepoActionRun added in v0.23.0

func (c *Client) GetRepoActionRun(owner, repo string, runID int64) (*ActionWorkflowRun, *Response, error)

GetRepoActionRun gets a single workflow run. Requires Gitea 1.26.0 or later.

func (*Client) GetRepoActionRunner added in v0.24.0

func (c *Client) GetRepoActionRunner(owner, repo string, runnerID int64) (*ActionRunner, *Response, error)

GetRepoActionRunner gets one repository-scope Actions runner.

func (*Client) GetRepoActionVariable added in v0.20.0

func (c *Client) GetRepoActionVariable(user, repo, variableName string) (*RepoActionVariable, *Response, error)

GetRepoActionVariable returns a repository variable in the Gitea Actions. It takes the repository owner, name and the variable name as parameters. The function returns the HTTP response and an error, if any.

func (*Client) GetRepoActionWorkflow added in v0.24.0

func (c *Client) GetRepoActionWorkflow(owner, repo, workflowID string) (*ActionWorkflow, *Response, error)

GetRepoActionWorkflow gets one repository workflow.

func (*Client) GetRepoBranch

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

GetRepoBranch get one branch's information of one repository

func (*Client) GetRepoByID added in v0.15.0

func (c *Client) GetRepoByID(id int64) (*Repository, *Response, error)

GetRepoByID returns information of a repository by a giver repository ID.

func (*Client) GetRepoFileContents added in v0.24.0

func (c *Client) GetRepoFileContents(owner, repo, ref string, opt GetFilesOptions) ([]*ContentsResponse, *Response, error)

GetRepoFileContents fetches metadata and contents for multiple files through the GET endpoint. The file list is JSON-encoded in the "body" query parameter; for large file lists prefer PostRepoFileContents to avoid URL length limitations.

func (*Client) GetRepoGitHook

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

GetRepoGitHook get a Git hook of a repository

func (*Client) GetRepoHook

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

GetRepoHook get a hook of a repository

func (*Client) GetRepoLabel

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

GetRepoLabel get one label of repository by repo it

func (*Client) GetRepoLanguages added in v0.13.0

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

GetRepoLanguages return language stats of a repo

func (*Client) GetRepoLicenses added in v0.24.0

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

GetRepoLicenses gets detected licenses for a repository.

func (*Client) GetRepoNote added in v0.23.0

func (c *Client) GetRepoNote(owner, repo, sha string, opt GetRepoNoteOptions) (*Note, *Response, error)

GetRepoNote gets a note corresponding to a single commit from a repository

func (*Client) GetRepoRef

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

GetRepoRef get one ref's information of one repository

func (*Client) GetRepoRefs

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

GetRepoRefs get list of ref's information of one repository

func (*Client) GetRepoSigningKeyGPG added in v0.24.0

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

GetRepoSigningKeyGPG gets the repository signing GPG public key.

func (*Client) GetRepoSigningKeySSH added in v0.24.0

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

GetRepoSigningKeySSH gets the repository signing SSH public key.

func (*Client) GetRepoTeams added in v0.15.0

func (c *Client) GetRepoTeams(user, repo string) ([]*Team, *Response, error)

GetRepoTeams return teams from a repository

func (*Client) GetReviewers added in v0.15.0

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

GetReviewers return all users that can be requested to review in this repo

func (*Client) GetSigningKeyGPG added in v0.23.0

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

GetSigningKeyGPG gets the default GPG signing key

func (*Client) GetSigningKeySSH added in v0.23.0

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

GetSigningKeySSH gets the default SSH signing key

func (*Client) GetSingleCommit

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

GetSingleCommit returns a single commit

func (*Client) GetStarredRepos added in v0.14.0

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

GetStarredRepos returns the repos that the given user has starred

func (*Client) GetTag added in v0.15.0

func (c *Client) GetTag(user, repo, tag string) (*Tag, *Response, error)

GetTag get the tag of a repository

func (*Client) GetTagProtection added in v0.21.0

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

GetTagProtection gets a tag protection

func (*Client) GetTeam

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

GetTeam gets a team by ID

func (*Client) GetTeamMember

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

GetTeamMember gets a member of a team

func (*Client) GetTeamRepository added in v0.24.0

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

GetTeamRepository gets a repository that belongs to a team.

func (*Client) GetTrees

func (c *Client) GetTrees(user, repo string, opt ListTreeOptions) (*GitTreeResponse, *Response, error)

GetTrees get trees of repository,

func (*Client) GetUserActionRunner added in v0.24.0

func (c *Client) GetUserActionRunner(runnerID int64) (*ActionRunner, *Response, error)

GetUserActionRunner gets one user-scope Actions runner.

func (*Client) GetUserActionVariable added in v0.24.0

func (c *Client) GetUserActionVariable(variableName string) (*ActionVariable, *Response, error)

GetUserActionVariable gets one user-scope Actions variable.

func (*Client) GetUserByID added in v0.15.0

func (c *Client) GetUserByID(id int64) (*User, *Response, error)

GetUserByID returns user by a given user ID

func (*Client) GetUserHeatmap added in v0.23.0

func (c *Client) GetUserHeatmap(username string) ([]*UserHeatmapData, *Response, error)

GetUserHeatmap gets a user's heatmap data

func (*Client) GetUserInfo

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

GetUserInfo get user info by user's name

func (*Client) GetUserSettings added in v0.15.0

func (c *Client) GetUserSettings() (*UserSettings, *Response, error)

GetUserSettings returns user settings

func (*Client) GetUserTrackedTimes

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

GetUserTrackedTimes gets all tracked times for a user in a repository

func (*Client) GetWatchedRepos

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

GetWatchedRepos list all the watched repos of user

func (*Client) GetWikiPage added in v0.23.0

func (c *Client) GetWikiPage(owner, repo, pageName string) (*WikiPage, *Response, error)

GetWikiPage gets a wiki page by name

func (*Client) GetWikiPageRevisions added in v0.23.0

func (c *Client) GetWikiPageRevisions(owner, repo, pageName string, opt ListWikiPageRevisionsOptions) (*WikiCommitList, *Response, error)

GetWikiPageRevisions gets all revisions of a wiki page

func (*Client) IsCollaborator

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

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

IsFollowing if current user followed the target

func (*Client) IsPullRequestMerged

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

IsPullRequestMerged test if one PR is merged to one repository

func (*Client) IsRepoStarring added in v0.14.0

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

IsRepoStarring returns whether the authenticated user has starred the repo or not

func (*Client) IsUserFollowing

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

IsUserFollowing if the user followed the target

func (*Client) IssueSubscribe

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

IssueSubscribe subscribe current user to an issue

func (*Client) IssueUnSubscribe

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

IssueUnSubscribe unsubscribe current user from an issue

func (*Client) LinkPackage added in v0.23.0

func (c *Client) LinkPackage(owner, packageType, name, repoName string) (*Response, error)

LinkPackage links a package to a repository

func (*Client) ListAccessTokens

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

ListAccessTokens lists all the access tokens of user

func (*Client) ListAdminActionJobs added in v0.24.0

func (c *Client) ListAdminActionJobs(opt ListRepoActionJobsOptions) (*ActionWorkflowJobsResponse, *Response, error)

ListAdminActionJobs lists all admin-scope Actions jobs.

func (*Client) ListAdminActionRunners added in v0.24.0

func (c *Client) ListAdminActionRunners(opt ListActionRunnersOptions) (*ActionRunnersResponse, *Response, error)

ListAdminActionRunners lists all admin-scope Actions runners.

func (*Client) ListAdminActionRuns added in v0.24.0

func (c *Client) ListAdminActionRuns(opt ListRepoActionRunsOptions) (*ActionWorkflowRunsResponse, *Response, error)

ListAdminActionRuns lists all admin-scope Actions workflow runs.

func (*Client) ListAdminEmails added in v0.23.0

func (c *Client) ListAdminEmails(opt ListAdminEmailsOptions) ([]*Email, *Response, error)

ListAdminEmails lists all email addresses

func (*Client) ListAdminHooks added in v0.23.0

func (c *Client) ListAdminHooks(opt ListAdminHooksOptions) ([]*Hook, *Response, error)

ListAdminHooks lists all system webhooks

func (*Client) ListAllGitRefs added in v0.23.0

func (c *Client) ListAllGitRefs(owner, repo string) ([]*Reference, *Response, error)

ListAllGitRefs gets all refs from a repository without filtering

func (*Client) ListBranchProtections added in v0.12.0

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

ListBranchProtections list branch protections for a repo

func (*Client) ListCollaborators

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

ListCollaborators list a repository's collaborators

func (*Client) ListContents added in v0.14.0

func (c *Client) ListContents(owner, repo, ref, filepath string) ([]*ContentsResponse, *Response, error)

ListContents gets a list of entries in a dir ref is optional

func (*Client) ListCronTasks added in v0.13.0

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

ListCronTasks list available cron tasks

func (*Client) ListDeployKeys

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

ListDeployKeys list all the deploy keys of one repository

func (*Client) ListEmails

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

ListEmails all the email addresses of user

func (*Client) ListFollowers

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

ListFollowers list all the followers of one user

func (*Client) ListFollowing

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

ListFollowing list all the users the user followed

func (*Client) ListForks

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

ListForks list a repository's forks

func (*Client) ListGPGKeys

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

ListGPGKeys list all the GPG keys of the user

func (*Client) ListGitignoresTemplates added in v0.23.0

func (c *Client) ListGitignoresTemplates() ([]string, *Response, error)

ListGitignoresTemplates lists all gitignore templates

func (*Client) ListIssueAttachments added in v0.24.0

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

ListIssueAttachments lists all attachments for an issue.

func (*Client) ListIssueBlocks added in v0.23.0

func (c *Client) ListIssueBlocks(owner, repo string, index int64, opt ListIssueBlocksOptions) ([]*Issue, *Response, error)

ListIssueBlocks lists issues that are blocked by the specified issue with pagination

func (*Client) ListIssueCommentAttachments added in v0.23.2

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

ListIssueCommentAttachments lists all attachments for a comment

func (*Client) ListIssueComments

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

ListIssueComments list comments on an issue.

func (*Client) ListIssueDependencies added in v0.23.1

func (c *Client) ListIssueDependencies(owner, repo string, index int64, opt ListIssueDependenciesOptions) ([]*Issue, *Response, error)

ListIssueDependencies lists issues that block the specified issue (its dependencies) with pagination

func (*Client) ListIssueReactions added in v0.23.1

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

ListIssueReactions get a list of reactions for an issue with pagination

func (*Client) ListIssueSubscribers added in v0.23.1

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

ListIssueSubscribers get list of users who subscribed on an issue with pagination

func (*Client) ListIssueTimeline added in v0.21.0

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

ListIssueTimeline list timeline on an issue.

func (*Client) ListIssueTrackedTimes added in v0.14.0

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

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

func (*Client) ListIssues

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

ListIssues returns all issues assigned the authenticated user

func (*Client) ListLabelTemplates added in v0.23.0

func (c *Client) ListLabelTemplates() ([]string, *Response, error)

ListLabelTemplates lists all label templates

func (*Client) ListLicenseTemplates added in v0.23.0

func (c *Client) ListLicenseTemplates() ([]*LicensesTemplateListEntry, *Response, error)

ListLicenseTemplates lists all license templates

func (*Client) ListMyBlocks added in v0.23.0

func (c *Client) ListMyBlocks(opt ListUserBlocksOptions) ([]*User, *Response, error)

ListMyBlocks lists users blocked by the authenticated user

func (*Client) ListMyFollowers

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

ListMyFollowers list all the followers of current user

func (*Client) ListMyFollowing

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

ListMyFollowing list all the users current user followed

func (*Client) ListMyGPGKeys

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

ListMyGPGKeys list all the GPG keys of current user

func (*Client) ListMyHooks added in v0.18.0

func (c *Client) ListMyHooks(opt ListHooksOptions) ([]*Hook, *Response, error)

ListMyHooks list all the hooks of the authenticated user

func (*Client) ListMyOrgs

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

ListMyOrgs list all of current user's organizations

func (*Client) ListMyPublicKeys

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

ListMyPublicKeys list all the public keys of current user

func (*Client) ListMyRepos

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

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

func (*Client) ListMyStopwatches added in v0.23.1

func (c *Client) ListMyStopwatches(opt ListStopwatchesOptions) ([]*StopWatch, *Response, error)

ListMyStopwatches list all stopwatches with pagination

func (*Client) ListMyTeams

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

ListMyTeams lists all the teams of the current user

func (*Client) ListMyTrackedTimes added in v0.23.1

func (c *Client) ListMyTrackedTimes(opt ListTrackedTimesOptions) ([]*TrackedTime, *Response, error)

ListMyTrackedTimes list tracked times of the current user with pagination and filtering

func (*Client) ListNotifications added in v0.11.1

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

ListNotifications list users's notification threads

func (*Client) ListOauth2 added in v0.12.0

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

ListOauth2 all of your Oauth2 Applications.

func (*Client) ListOrgActionJobs added in v0.24.0

func (c *Client) ListOrgActionJobs(org string, opt ListRepoActionJobsOptions) (*ActionWorkflowJobsResponse, *Response, error)

ListOrgActionJobs lists organization-scoped Actions jobs.

func (*Client) ListOrgActionRunners added in v0.24.0

func (c *Client) ListOrgActionRunners(org string, opt ListActionRunnersOptions) (*ActionRunnersResponse, *Response, error)

ListOrgActionRunners lists organization-scoped Actions runners.

func (*Client) ListOrgActionRuns added in v0.24.0

func (c *Client) ListOrgActionRuns(org string, opt ListRepoActionRunsOptions) (*ActionWorkflowRunsResponse, *Response, error)

ListOrgActionRuns lists organization-scoped Actions workflow runs.

func (*Client) ListOrgActionSecret added in v0.16.0

func (c *Client) ListOrgActionSecret(org string, opt ListOrgActionSecretOption) ([]*Secret, *Response, error)

ListOrgActionSecret list an organization's secrets

func (*Client) ListOrgActionVariable added in v0.22.0

func (c *Client) ListOrgActionVariable(org string, opt ListOrgActionVariableOption) ([]*ActionVariable, *Response, error)

ListOrgActionVariable lists an organization's action variables

func (*Client) ListOrgActivityFeeds added in v0.23.0

func (c *Client) ListOrgActivityFeeds(org string, opt ListOrgActivityFeedsOptions) ([]*Activity, *Response, error)

ListOrgActivityFeeds lists the organization's activity feeds

func (*Client) ListOrgBlocks added in v0.23.0

func (c *Client) ListOrgBlocks(org string, opt ListOrgBlocksOptions) ([]*User, *Response, error)

ListOrgBlocks lists users blocked by the organization

func (*Client) ListOrgHooks

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

ListOrgHooks list all the hooks of one organization

func (*Client) ListOrgLabels added in v0.22.1

func (c *Client) ListOrgLabels(orgName string, opt ListOrgLabelsOptions) ([]*Label, *Response, error)

ListOrgLabels returns the labels defined at the org level

func (*Client) ListOrgMembership added in v0.11.1

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

ListOrgMembership list an organization's members

func (*Client) ListOrgRepos

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

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

ListOrgTeams lists all teams of an organization

func (*Client) ListOrgs added in v0.23.2

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

ListOrgs lists all public organizations

func (*Client) ListPackageFiles added in v0.16.0

func (c *Client) ListPackageFiles(owner, packageType, name, version string) ([]*PackageFile, *Response, error)

ListPackageFiles lists the files within a package

func (*Client) ListPackageVersions added in v0.24.0

func (c *Client) ListPackageVersions(owner, packageType, name string, opt ListPackagesOptions) ([]*Package, *Response, error)

ListPackageVersions lists all versions of a package.

func (*Client) ListPackages added in v0.16.0

func (c *Client) ListPackages(owner string, opt ListPackagesOptions) ([]*Package, *Response, error)

ListPackages lists all the packages owned by a given owner (user, organisation)

func (*Client) ListPublicKeys

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

ListPublicKeys list all the public keys of the user

func (*Client) ListPublicOrgMembership added in v0.11.1

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

ListPublicOrgMembership list an organization's members

func (*Client) ListPullRequestCommits added in v0.15.0

func (c *Client) ListPullRequestCommits(owner, repo string, index int64, opt ListPullRequestCommitsOptions) ([]*Commit, *Response, error)

ListPullRequestCommits list commits for a pull request

func (*Client) ListPullRequestFiles added in v0.16.0

func (c *Client) ListPullRequestFiles(owner, repo string, index int64, opt ListPullRequestFilesOptions) ([]*ChangedFile, *Response, error)

ListPullRequestFiles list changed files for a pull request

func (*Client) ListPullReviewComments added in v0.12.0

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 added in v0.12.0

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

ListPullReviews lists all reviews of a pull request

func (*Client) ListPushMirrors added in v0.22.0

func (c *Client) ListPushMirrors(user, repo string, opt ListOptions) ([]*PushMirrorResponse, *Response, error)

ListPushMirrors gets all push mirrors of a repository

func (*Client) ListReleaseAttachments

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

ListReleaseAttachments list release's attachments

func (*Client) ListReleases

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

ListReleases list releases of a repository

func (*Client) ListRepoActionArtifacts added in v0.24.0

func (c *Client) ListRepoActionArtifacts(owner, repo string, opt ListActionArtifactsOptions) (*ActionArtifactsResponse, *Response, error)

ListRepoActionArtifacts lists repository artifacts.

func (*Client) ListRepoActionJobs added in v0.23.0

func (c *Client) ListRepoActionJobs(owner, repo string, opt ListRepoActionJobsOptions) (*ActionWorkflowJobsResponse, *Response, error)

ListRepoActionJobs lists all jobs for a repository. Requires Gitea 1.26.0 or later.

func (*Client) ListRepoActionRunArtifacts added in v0.24.0

func (c *Client) ListRepoActionRunArtifacts(owner, repo string, runID int64, opt ListActionArtifactsOptions) (*ActionArtifactsResponse, *Response, error)

ListRepoActionRunArtifacts lists artifacts for one workflow run.

func (*Client) ListRepoActionRunJobs added in v0.23.0

func (c *Client) ListRepoActionRunJobs(owner, repo string, runID int64, opt ListRepoActionJobsOptions) (*ActionWorkflowJobsResponse, *Response, error)

ListRepoActionRunJobs lists jobs for a workflow run. Requires Gitea 1.26.0 or later.

func (*Client) ListRepoActionRunners added in v0.24.0

func (c *Client) ListRepoActionRunners(owner, repo string, opt ListActionRunnersOptions) (*ActionRunnersResponse, *Response, error)

ListRepoActionRunners lists repository-scope Actions runners.

func (*Client) ListRepoActionRuns added in v0.23.0

func (c *Client) ListRepoActionRuns(owner, repo string, opt ListRepoActionRunsOptions) (*ActionWorkflowRunsResponse, *Response, error)

ListRepoActionRuns lists workflow runs for a repository. Requires Gitea 1.26.0 or later. For older versions, use ListRepoActionTasks.

func (*Client) ListRepoActionSecret added in v0.19.0

func (c *Client) ListRepoActionSecret(user, repo string, opt ListRepoActionSecretOption) ([]*Secret, *Response, error)

ListRepoActionSecret list a repository's secrets

func (*Client) ListRepoActionTasks added in v0.23.0

func (c *Client) ListRepoActionTasks(owner, repo string, opt ListOptions) (*ActionTaskResponse, *Response, error)

ListRepoActionTasks lists workflow tasks for a repository (Gitea 1.24.x and earlier) Use this for older Gitea versions that don't have /actions/runs endpoint

func (*Client) ListRepoActionVariable added in v0.23.0

func (c *Client) ListRepoActionVariable(user, repo string, opt ListRepoActionVariableOption) ([]*RepoActionVariable, *Response, error)

ListRepoActionVariable lists a repository's action variables

func (*Client) ListRepoActionWorkflows added in v0.24.0

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

ListRepoActionWorkflows lists repository workflows.

func (*Client) ListRepoActivityFeeds added in v0.24.0

func (c *Client) ListRepoActivityFeeds(owner, repo string, opt ListRepoActivityFeedsOptions) ([]*Activity, *Response, error)

ListRepoActivityFeeds lists activity feeds for a repository

func (*Client) ListRepoBranches

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

ListRepoBranches list all the branches of one repository

func (*Client) ListRepoCommits added in v0.11.1

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

ListRepoCommits return list of commits from a repo

func (*Client) ListRepoGitHooks

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

ListRepoGitHooks list all the Git hooks of one repository

func (*Client) ListRepoHooks

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

ListRepoHooks list all the hooks of one repository

func (*Client) ListRepoIssueComments

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

ListRepoIssueComments list comments for a given repo.

func (*Client) ListRepoIssues

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

ListRepoIssues returns all issues for a given repository

func (*Client) ListRepoLabels

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

ListRepoLabels list labels of one repository

func (*Client) ListRepoMilestones

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

ListRepoMilestones list all the milestones of one repository

func (*Client) ListRepoNotifications added in v0.11.1

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

ListRepoNotifications list users's notification threads on a specific repo

func (*Client) ListRepoPinnedIssues added in v0.23.0

func (c *Client) ListRepoPinnedIssues(owner, repo string) ([]*Issue, *Response, error)

ListRepoPinnedIssues lists a repo's pinned issues

func (*Client) ListRepoPinnedPullRequests added in v0.24.0

func (c *Client) ListRepoPinnedPullRequests(owner, repo string) ([]*PullRequest, *Response, error)

ListRepoPinnedPullRequests lists a repo's pinned pull requests

func (*Client) ListRepoPullRequests

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

ListRepoPullRequests list PRs of one repository

func (*Client) ListRepoStargazers added in v0.14.0

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

ListRepoStargazers list a repository's stargazers

func (*Client) ListRepoSubscribers added in v0.24.0

func (c *Client) ListRepoSubscribers(owner, repo string, opt ListOptions) ([]*User, *Response, error)

ListRepoSubscribers lists repository watchers.

func (*Client) ListRepoTags

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

ListRepoTags list all the branches of one repository

func (*Client) ListRepoTopics

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

ListRepoTopics list all repository's topics

func (*Client) ListRepoTrackedTimes added in v0.14.0

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

ListRepoTrackedTimes list tracked times of a repository

func (*Client) ListStatuses

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

ListStatuses returns all statuses for a given Commit by ref

func (*Client) ListTagProtection added in v0.21.0

func (c *Client) ListTagProtection(owner, repo string, opt ListRepoTagProtectionsOptions) ([]*TagProtection, *Response, error)

ListTagProtection list tag protections for a repository

func (*Client) ListTeamActivityFeeds added in v0.23.0

func (c *Client) ListTeamActivityFeeds(teamID int64, opt ListTeamActivityFeedsOptions) ([]*Activity, *Response, error)

ListTeamActivityFeeds lists the team's activity feeds

func (*Client) ListTeamMembers

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

ListTeamMembers lists all members of a team

func (*Client) ListTeamRepositories

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

ListTeamRepositories lists all repositories of a team

func (*Client) ListUnadoptedRepos added in v0.23.0

func (c *Client) ListUnadoptedRepos(opt ListUnadoptedReposOptions) ([]string, *Response, error)

ListUnadoptedRepos lists unadopted repositories

func (*Client) ListUserActionJobs added in v0.24.0

ListUserActionJobs lists user-scope Actions jobs.

func (*Client) ListUserActionRunners added in v0.24.0

func (c *Client) ListUserActionRunners(opt ListActionRunnersOptions) (*ActionRunnersResponse, *Response, error)

ListUserActionRunners lists user-scope Actions runners.

func (*Client) ListUserActionRuns added in v0.24.0

ListUserActionRuns lists user-scope Actions workflow runs.

func (*Client) ListUserActionVariable added in v0.24.0

func (c *Client) ListUserActionVariable(opt ListOptions) ([]*ActionVariable, *Response, error)

ListUserActionVariable lists user-scope Actions variables.

func (*Client) ListUserActivityFeeds added in v0.23.0

func (c *Client) ListUserActivityFeeds(username string, opt ListUserActivityFeedsOptions) ([]*Activity, *Response, error)

ListUserActivityFeeds lists a user's activity feeds

func (*Client) ListUserBadges added in v0.23.0

func (c *Client) ListUserBadges(username string) ([]*Badge, *Response, error)

ListUserBadges lists badges of a user

func (*Client) ListUserOrgs

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

ListUserOrgs list all of some user's organizations

func (*Client) ListUserRepos

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

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

func (*Client) ListWikiPages added in v0.23.0

func (c *Client) ListWikiPages(owner, repo string, opt ListWikiPagesOptions) ([]*WikiPageMetaData, *Response, error)

ListWikiPages lists all wiki pages in a repository

func (*Client) LockIssue added in v0.23.0

func (c *Client) LockIssue(owner, repo string, index int64, opt LockIssueOption) (*Response, error)

LockIssue locks an issue

func (*Client) MergePullRequest

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) MergeUpstream added in v0.24.0

func (c *Client) MergeUpstream(owner, repo string, opt MergeUpstreamRequest) (*MergeUpstreamResponse, *Response, error)

MergeUpstream merges upstream into a forked repository

func (*Client) MigrateRepo

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

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

MirrorSync adds a mirrored repository to the mirror sync queue.

func (*Client) MoveIssuePin added in v0.23.0

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

MoveIssuePin moves a pinned issue to the given position

func (*Client) PinIssue added in v0.23.0

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

PinIssue pins an issue

func (*Client) PostIssueCommentReaction

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

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

PostIssueReaction add a reaction to an issue

func (*Client) PostRepoFileContents added in v0.24.0

func (c *Client) PostRepoFileContents(owner, repo, ref string, opt GetFilesOptions) ([]*ContentsResponse, *Response, error)

PostRepoFileContents fetches metadata and contents for multiple files through the POST endpoint.

func (*Client) PushMirrors added in v0.17.1

func (c *Client) PushMirrors(user, repo string, opt CreatePushMirrorOption) (*PushMirrorResponse, *Response, error)

PushMirrors add a push mirror to the repository

func (*Client) ReadNotification added in v0.11.1

func (c *Client) ReadNotification(id int64, status ...NotifyStatus) (*NotificationThread, *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' The relevant notification will be returned as the first parameter when the Gitea server is 1.16.0 or higher.

func (*Client) ReadNotifications added in v0.11.1

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

ReadNotifications mark notification threads as read The relevant notifications will only be returned as the first parameter when the Gitea server is 1.16.0 or higher.

func (*Client) ReadRepoNotifications added in v0.11.1

func (c *Client) ReadRepoNotifications(owner, repo string, opt MarkNotificationOptions) ([]*NotificationThread, *Response, error)

ReadRepoNotifications mark notification threads as read on a specific repo The relevant notifications will only be returned as the first parameter when the Gitea server is 1.16.0 or higher.

func (*Client) RejectRepoTransfer added in v0.16.0

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

RejectRepoTransfer rejects a repo transfer.

func (*Client) RemoveIssueBlocking added in v0.23.0

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

RemoveIssueBlocking removes an issue block

func (*Client) RemoveIssueDependency added in v0.23.0

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

RemoveIssueDependency removes an issue dependency

func (*Client) RemoveRepoTeam added in v0.15.0

func (c *Client) RemoveRepoTeam(user, repo, team string) (*Response, error)

RemoveRepoTeam delete a team from a repository

func (*Client) RemoveTeamMember

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

RemoveTeamMember removes a member from a team

func (*Client) RemoveTeamRepository

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

RemoveTeamRepository removes a repository from a team

func (*Client) RenameOrg added in v0.23.0

func (c *Client) RenameOrg(org string, opt RenameOrgOption) (*Response, error)

RenameOrg renames an organization

func (*Client) RenameRepoBranch added in v0.24.0

func (c *Client) RenameRepoBranch(user, repo, branch string, opt RenameRepoBranchOption) (successful bool, resp *Response, err error)

RenameRepoBranch renames a branch in a repository.

func (*Client) RenderMarkdown added in v0.23.0

func (c *Client) RenderMarkdown(opt MarkdownOption) (string, *Response, error)

RenderMarkdown renders a markdown document as HTML

func (*Client) RenderMarkdownRaw added in v0.23.0

func (c *Client) RenderMarkdownRaw(markdown string) (string, *Response, error)

RenderMarkdownRaw renders raw markdown as HTML

func (*Client) RenderMarkup added in v0.23.0

func (c *Client) RenderMarkup(opt MarkupOption) (string, *Response, error)

RenderMarkup renders a markup document as HTML

func (*Client) ReplaceIssueLabels

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) RerunRepoActionJob added in v0.24.0

func (c *Client) RerunRepoActionJob(owner, repo string, runID, jobID int64) (*ActionWorkflowJob, *Response, error)

RerunRepoActionJob reruns a specific workflow job in a run. Requires Gitea 1.26.0 or later.

func (*Client) RerunRepoActionRun added in v0.24.0

func (c *Client) RerunRepoActionRun(owner, repo string, runID int64) (*ActionWorkflowRun, *Response, error)

RerunRepoActionRun reruns an entire workflow run. Requires Gitea 1.26.0 or later.

func (*Client) RerunRepoActionRunFailedJobs added in v0.24.0

func (c *Client) RerunRepoActionRunFailedJobs(owner, repo string, runID int64) (*Response, error)

RerunRepoActionRunFailedJobs reruns all failed jobs in a workflow run. Requires Gitea 1.26.0 or later.

func (*Client) ResetIssueTime

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) ResolvePullReviewComment added in v0.24.0

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

ResolvePullReviewComment resolves a pull-request review comment conversation. This endpoint is not yet available in any released Gitea version.

func (*Client) RunCronTasks added in v0.13.0

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

RunCronTasks run a cron task

func (*Client) SearchAdminEmails added in v0.23.0

func (c *Client) SearchAdminEmails(opt SearchAdminEmailsOptions) ([]*Email, *Response, error)

SearchAdminEmails searches email addresses

func (*Client) SearchOrgTeams added in v0.16.0

func (c *Client) SearchOrgTeams(org string, opt *SearchTeamsOptions) ([]*Team, *Response, error)

SearchOrgTeams search for teams in a org.

func (*Client) SearchRepos added in v0.11.1

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

SearchRepos searches for repositories matching the given filters

func (*Client) SearchTopics added in v0.24.0

func (c *Client) SearchTopics(opt TopicSearchOptions) (*TopicSearchResult, *Response, error)

SearchTopics searches for topics

func (*Client) SearchUsers

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

SearchUsers finds users by query

func (*Client) SendActivityPubInbox added in v0.23.0

func (c *Client) SendActivityPubInbox(userID int64, activity ActivityPub) (*Response, error)

SendActivityPubInbox sends an ActivityPub message to a user's inbox

func (*Client) ServerVersion

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

ServerVersion returns the version of the server

func (*Client) SetBasicAuth

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

SetBasicAuth sets username and password

func (*Client) SetContext added in v0.13.0

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

SetContext set default context witch is used for http requests

func (*Client) SetHTTPClient

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

SetHTTPClient replaces default http.Client with user given one.

func (*Client) SetOTP added in v0.12.0

func (c *Client) SetOTP(otp string)

SetOTP sets OTP for 2FA

func (*Client) SetPublicOrgMembership added in v0.11.1

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

SetPublicOrgMembership publicize/conceal a user's membership

func (*Client) SetRepoTopics

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

SetRepoTopics replaces the list of repo's topics

func (*Client) SetSudo

func (c *Client) SetSudo(sudo string)

SetSudo sets username to impersonate.

func (*Client) SetUserAgent added in v0.17.0

func (c *Client) SetUserAgent(userAgent string)

SetUserAgent sets the user-agent to send with every request.

func (*Client) SignRequest added in v0.16.0

func (c *Client) SignRequest(r *http.Request) error

SignRequest signs a HTTP request

func (*Client) StarRepo added in v0.14.0

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

StarRepo star specified repo as the authenticated user

func (*Client) StartIssueStopWatch

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

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 added in v0.12.0

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) TestWebhook added in v0.24.0

func (c *Client) TestWebhook(owner, repo string, hookID int64, ref string) (*Response, error)

TestWebhook tests a webhook

func (*Client) TransferRepo added in v0.11.1

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

TransferRepo transfers the ownership of a repository

func (*Client) TriggerPushMirrorsSync added in v0.24.0

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

TriggerPushMirrorsSync triggers push-mirror syncing for a repository.

func (*Client) UnDismissPullReview added in v0.14.0

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

UnDismissPullReview cancel to dismiss a review for a pull request

func (*Client) UnStarRepo added in v0.14.0

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

UnStarRepo remove star to specified repo as the authenticated user

func (*Client) UnWatchRepo

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

UnWatchRepo stop to watch a repository

func (*Client) UnblockOrgUser added in v0.23.0

func (c *Client) UnblockOrgUser(org, username string) (*Response, error)

UnblockOrgUser unblocks a user from the organization

func (*Client) UnblockUser added in v0.23.0

func (c *Client) UnblockUser(username string) (*Response, error)

UnblockUser unblocks a user

func (*Client) Unfollow

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

Unfollow set current user unfollow the target

func (*Client) UnlinkPackage added in v0.23.0

func (c *Client) UnlinkPackage(owner, packageType, name string) (*Response, error)

UnlinkPackage unlinks a package from a repository

func (*Client) UnlockIssue added in v0.23.0

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

UnlockIssue unlocks an issue

func (*Client) UnpinIssue added in v0.23.0

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

UnpinIssue unpins an issue

func (*Client) UnresolvePullReviewComment added in v0.24.0

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

UnresolvePullReviewComment unresolves a pull-request review comment conversation. This endpoint is not yet available in any released Gitea version.

func (*Client) UpdateAdminActionRunner added in v0.24.0

func (c *Client) UpdateAdminActionRunner(runnerID int64, opt EditActionRunnerOption) (*ActionRunner, *Response, error)

UpdateAdminActionRunner updates one admin-scope Actions runner.

func (*Client) UpdateBranchProtectionPriorities added in v0.24.0

func (c *Client) UpdateBranchProtectionPriorities(owner, repo string, ids []int64) (*Response, error)

UpdateBranchProtectionPriorities updates the priorities of branch protection rules

func (*Client) UpdateFile added in v0.12.0

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

UpdateFile update a file in a repository

func (*Client) UpdateIssueDeadline added in v0.23.0

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

UpdateIssueDeadline updates an issue's deadline

func (*Client) UpdateOauth2 added in v0.12.0

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) UpdateOrgActionRunner added in v0.24.0

func (c *Client) UpdateOrgActionRunner(org string, runnerID int64, opt EditActionRunnerOption) (*ActionRunner, *Response, error)

UpdateOrgActionRunner updates one organization-scoped Actions runner.

func (*Client) UpdateOrgActionVariable added in v0.22.0

func (c *Client) UpdateOrgActionVariable(org, name string, opt UpdateActionVariableOption) (*Response, error)

UpdateOrgActionVariable updates a variable for the specified organization in the Gitea Actions.

func (*Client) UpdateOrgAvatar added in v0.23.0

func (c *Client) UpdateOrgAvatar(org string, opt UpdateUserAvatarOption) (*Response, error)

UpdateOrgAvatar updates the organization's avatar

func (*Client) UpdatePullRequest added in v0.24.0

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

UpdatePullRequest updates a pull request with new commits from the base branch

func (*Client) UpdateRepoActionRunner added in v0.24.0

func (c *Client) UpdateRepoActionRunner(owner, repo string, runnerID int64, opt EditActionRunnerOption) (*ActionRunner, *Response, error)

UpdateRepoActionRunner updates one repository-scope Actions runner.

func (*Client) UpdateRepoActionVariable added in v0.20.0

func (c *Client) UpdateRepoActionVariable(user, repo, variableName, value string) (*Response, error)

UpdateRepoActionVariable updates a repository variable in the Gitea Actions. It takes the repository owner, name, variable name and the variable value as parameters. The function returns the HTTP response and an error, if any.

func (*Client) UpdateRepoAvatar added in v0.23.0

func (c *Client) UpdateRepoAvatar(owner, repo string, opt UpdateRepoAvatarOption) (*Response, error)

UpdateRepoAvatar updates a repository's avatar

func (*Client) UpdateRepoBranch deprecated added in v0.22.0

func (c *Client) UpdateRepoBranch(user, repo, branch string, opt UpdateRepoBranchOption) (sucessful bool, resp *Response, err error)

UpdateRepoBranch renames a branch in a repository.

Deprecated: Use RenameRepoBranch instead (identical behavior, clearer name). For updating the commit a branch points to, use UpdateRepoBranchRef (PUT).

func (*Client) UpdateRepoBranchRef added in v0.24.0

func (c *Client) UpdateRepoBranchRef(user, repo, branch string, opt UpdateRepoBranchRefOption) (successful bool, resp *Response, err error)

UpdateRepoBranchRef updates the commit a branch points to. This endpoint is not yet available in any released Gitea version.

func (*Client) UpdateUserActionRunner added in v0.24.0

func (c *Client) UpdateUserActionRunner(runnerID int64, opt EditActionRunnerOption) (*ActionRunner, *Response, error)

UpdateUserActionRunner updates one user-scope Actions runner.

func (*Client) UpdateUserActionVariable added in v0.24.0

func (c *Client) UpdateUserActionVariable(variableName string, opt UpdateActionVariableOption) (*Response, error)

UpdateUserActionVariable updates one user-scope Actions variable.

func (*Client) UpdateUserAvatar added in v0.23.0

func (c *Client) UpdateUserAvatar(opt UpdateUserAvatarOption) (*Response, error)

UpdateUserAvatar updates the authenticated user's avatar

func (*Client) UpdateUserSettings added in v0.15.0

func (c *Client) UpdateUserSettings(opt UserSettingsOptions) (*UserSettings, *Response, error)

UpdateUserSettings returns user settings

func (*Client) ValidateIssueConfig added in v0.24.0

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

ValidateIssueConfig validates the issue config file for a repository

func (*Client) VerifyGPGKey added in v0.23.0

func (c *Client) VerifyGPGKey(opt VerifyGPGKeyOption) (*GPGKey, *Response, error)

VerifyGPGKey verifies a GPG key by submitting a signed verification token. First call GetGPGKeyVerificationToken to get the token, sign it with the GPG key, then call this with the key ID and armored signature.

func (*Client) WatchRepo

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

WatchRepo start to watch a repository

type ClientOption added in v0.15.1

type ClientOption func(*Client) error

ClientOption are functions used to init a new client

func SetBasicAuth added in v0.13.0

func SetBasicAuth(username, password string) ClientOption

SetBasicAuth is an option for NewClient to set username and password

func SetContext added in v0.13.0

func SetContext(ctx context.Context) ClientOption

SetContext is an option for NewClient to set the default context

func SetDebugMode added in v0.13.1

func SetDebugMode() ClientOption

SetDebugMode is an option for NewClient to enable debug mode

func SetGiteaVersion added in v0.15.1

func SetGiteaVersion(v string) ClientOption

SetGiteaVersion configures the Client to assume the given version of the Gitea server, instead of querying the server for it when initializing. Use "" to skip all canonical ways in the SDK to check for versions

func SetHTTPClient added in v0.13.0

func SetHTTPClient(httpClient *http.Client) ClientOption

SetHTTPClient is an option for NewClient to set custom http client

func SetOTP added in v0.13.0

func SetOTP(otp string) ClientOption

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

func SetSudo added in v0.13.0

func SetSudo(sudo string) ClientOption

SetSudo is an option for NewClient to set sudo header

func SetToken added in v0.13.0

func SetToken(token string) ClientOption

SetToken is an option for NewClient to set token

func SetUserAgent added in v0.17.0

func SetUserAgent(userAgent string) ClientOption

SetUserAgent is an option for NewClient to set user-agent header

func UseSSHCert added in v0.16.0

func UseSSHCert(principal, sshKey, passphrase string) ClientOption

UseSSHCert is an option for NewClient to enable SSH certificate authentication via HTTPSign If you want to auth against the ssh-agent you'll need to set a principal, if you want to use a file on disk you'll need to specify sshKey. If you have an encrypted sshKey you'll need to also set the passphrase.

func UseSSHPubkey added in v0.16.0

func UseSSHPubkey(fingerprint, sshKey, passphrase string) ClientOption

UseSSHPubkey is an option for NewClient to enable SSH pubkey authentication via HTTPSign If you want to auth against the ssh-agent you'll need to set a fingerprint, if you want to use a file on disk you'll need to specify sshKey. If you have an encrypted sshKey you'll need to also set the passphrase.

type CollaboratorPermissionResult added in v0.16.0

type CollaboratorPermissionResult struct {
	Permission AccessMode `json:"permission"`
	Role       string     `json:"role_name"`
	User       *User      `json:"user"`
}

CollaboratorPermissionResult result type for CollaboratorPermission

type CombinedStatus

type CombinedStatus struct {
	State      StatusState `json:"state"`
	SHA        string      `json:"sha"`
	TotalCount int         `json:"total_count"`
	Statuses   []*Status   `json:"statuses"`
	Repository *Repository `json:"repository"`
	CommitURL  string      `json:"commit_url"`
	URL        string      `json:"url"`
}

CombinedStatus holds the combined state of several statuses for a single commit

type Comment

type Comment struct {
	ID               int64         `json:"id"`
	HTMLURL          string        `json:"html_url"`
	PRURL            string        `json:"pull_request_url"`
	IssueURL         string        `json:"issue_url"`
	Poster           *User         `json:"user"`
	OriginalAuthor   string        `json:"original_author"`
	OriginalAuthorID int64         `json:"original_author_id"`
	Body             string        `json:"body"`
	Created          time.Time     `json:"created_at"`
	Updated          time.Time     `json:"updated_at"`
	Attachments      []*Attachment `json:"assets"`
}

Comment represents a comment on a commit or issue

type Commit

type Commit struct {
	*CommitMeta
	HTMLURL    string                 `json:"html_url"`
	RepoCommit *RepoCommit            `json:"commit"`
	Author     *User                  `json:"author"`
	Committer  *User                  `json:"committer"`
	Parents    []*CommitMeta          `json:"parents"`
	Files      []*CommitAffectedFiles `json:"files"`
	Stats      *CommitStats           `json:"stats"`
}

Commit contains information generated from a Git commit.

type CommitAffectedFiles added in v0.14.0

type CommitAffectedFiles struct {
	Filename string `json:"filename"`
}

CommitAffectedFiles store information about files affected by the commit

type CommitDateOptions added in v0.12.0

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

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 CommitStats added in v0.16.0

type CommitStats struct {
	Total     int `json:"total"`
	Additions int `json:"additions"`
	Deletions int `json:"deletions"`
}

CommitStats contains stats from a Git commit

type CommitUser

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

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

type Compare added in v0.18.0

type Compare struct {
	TotalCommits int       `json:"total_commits"` // Total number of commits in the comparison.
	Commits      []*Commit `json:"commits"`       // List of commits in the comparison.
}

Compare represents a comparison between two commits.

type ContentsExtResponse added in v0.23.0

type ContentsExtResponse struct {
	DirContents  []*ContentsResponse `json:"dir_contents,omitempty"`
	FileContents *ContentsResponse   `json:"file_contents,omitempty"`
}

ContentsExtResponse contains extended information about a repo's contents

type ContentsResponse added in v0.12.0

type ContentsResponse struct {
	Name          string  `json:"name"`
	Path          string  `json:"path"`
	SHA           string  `json:"sha"`
	LastCommitSha *string `json:"last_commit_sha,omitempty"`
	// swagger:strfmt date-time
	LastCommitterDate *time.Time `json:"last_committer_date,omitempty"`
	// swagger:strfmt date-time
	LastAuthorDate    *time.Time `json:"last_author_date,omitempty"`
	LastCommitMessage *string    `json:"last_commit_message,omitempty"`
	// `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"`
	LfsOid          *string            `json:"lfs_oid,omitempty"`
	LfsSize         *int64             `json:"lfs_size,omitempty"`
}

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

type CreateAccessTokenOption

type CreateAccessTokenOption struct {
	Name   string             `json:"name"`
	Scopes []AccessTokenScope `json:"scopes"`
}

CreateAccessTokenOption options when create access token

type CreateActionVariableOption added in v0.24.0

type CreateActionVariableOption struct {
	Value       string `json:"value"`
	Description string `json:"description"`
}

CreateActionVariableOption is used to create an Actions variable.

func (CreateActionVariableOption) Validate added in v0.24.0

func (opt CreateActionVariableOption) Validate() error

Validate checks whether the variable create payload is valid.

type CreateActionWorkflowDispatchOption added in v0.24.0

type CreateActionWorkflowDispatchOption struct {
	Ref    string            `json:"ref"`
	Inputs map[string]string `json:"inputs,omitempty"`
}

CreateActionWorkflowDispatchOption triggers a workflow_dispatch event.

func (CreateActionWorkflowDispatchOption) Validate added in v0.24.0

Validate checks whether the dispatch payload is valid.

type CreateBranchOption added in v0.13.0

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 added in v0.13.0

func (opt CreateBranchOption) Validate() error

Validate the CreateBranchOption struct

type CreateBranchProtectionOption added in v0.12.0

type CreateBranchProtectionOption struct {
	BranchName                    string   `json:"branch_name"`
	RuleName                      string   `json:"rule_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"`
	BlockOnOfficialReviewRequests bool     `json:"block_on_official_review_requests"`
	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"`
	UnprotectedFilePatterns       string   `json:"unprotected_file_patterns"`
}

CreateBranchProtectionOption options for creating a branch protection

type CreateEmailOption

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

CreateEmailOption options when creating email addresses

type CreateFileOptions added in v0.12.0

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

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

CreateForkOption options for creating a fork

type CreateGPGKeyOption

type CreateGPGKeyOption struct {
	// An armored GPG key to add
	ArmoredKey string `json:"armored_public_key"`
	// An optional armored signature for the GPG key
	Signature string `json:"armored_signature,omitempty"`
}

CreateGPGKeyOption options create user GPG key

type CreateHookOption

type CreateHookOption struct {
	Type                HookType          `json:"type"`
	Config              map[string]string `json:"config"`
	Events              []string          `json:"events"`
	BranchFilter        string            `json:"branch_filter"`
	Active              bool              `json:"active"`
	AuthorizationHeader string            `json:"authorization_header"`
}

CreateHookOption options when create a hook

func (CreateHookOption) Validate added in v0.13.0

func (opt CreateHookOption) Validate() error

Validate the CreateHookOption struct

type CreateIssueCommentOption

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

CreateIssueCommentOption options for creating a comment on an issue

func (CreateIssueCommentOption) Validate added in v0.13.0

func (opt CreateIssueCommentOption) Validate() error

Validate the CreateIssueCommentOption struct

type CreateIssueOption

type CreateIssueOption struct {
	Title     string     `json:"title"`
	Body      string     `json:"body"`
	Ref       string     `json:"ref"`
	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 added in v0.13.0

func (opt CreateIssueOption) Validate() error

Validate the CreateIssueOption struct

type CreateKeyOption

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

CreateKeyOption options when creating a key

type CreateLabelOption

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

CreateLabelOption options for creating a label

func (CreateLabelOption) Validate added in v0.13.0

func (opt CreateLabelOption) Validate() error

Validate the CreateLabelOption struct

type CreateMilestoneOption

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 added in v0.13.0

func (opt CreateMilestoneOption) Validate() error

Validate the CreateMilestoneOption struct

type CreateOauth2Option added in v0.12.0

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

CreateOauth2Option required options for creating an Application

type CreateOrUpdateSecretOption added in v0.24.0

type CreateOrUpdateSecretOption struct {
	Data        string `json:"data"`
	Description string `json:"description"`
}

CreateOrUpdateSecretOption contains the data for creating or updating an Actions secret.

func (CreateOrUpdateSecretOption) Validate added in v0.24.0

func (opt CreateOrUpdateSecretOption) Validate() error

Validate checks whether a secret payload can be sent to the API.

type CreateOrgLabelOption added in v0.22.1

type CreateOrgLabelOption struct {
	// Name of the label
	Name string `json:"name"`
	// Color of the label in hex format without #
	Color string `json:"color"`
	// Description of the label
	Description string `json:"description"`
	// Whether this is an exclusive label
	Exclusive bool `json:"exclusive"`
}

func (CreateOrgLabelOption) Validate added in v0.22.1

func (opt CreateOrgLabelOption) Validate() error

Validate the CreateLabelOption struct

type CreateOrgOption

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

CreateOrgOption options for creating an organization

func (CreateOrgOption) Validate added in v0.13.0

func (opt CreateOrgOption) Validate() error

Validate the CreateOrgOption struct

type CreatePullRequestOption

type CreatePullRequestOption struct {
	Head          string     `json:"head"`
	Base          string     `json:"base"`
	Title         string     `json:"title"`
	Body          string     `json:"body"`
	Assignee      string     `json:"assignee"`
	Assignees     []string   `json:"assignees"`
	Reviewers     []string   `json:"reviewers"`
	TeamReviewers []string   `json:"team_reviewers"`
	Milestone     int64      `json:"milestone"`
	Labels        []int64    `json:"labels"`
	Deadline      *time.Time `json:"due_date"`
}

CreatePullRequestOption options when creating a pull request

type CreatePullReviewComment added in v0.12.0

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 added in v0.13.0

func (opt CreatePullReviewComment) Validate() error

Validate the CreatePullReviewComment struct

type CreatePullReviewOptions added in v0.12.0

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 added in v0.13.0

func (opt CreatePullReviewOptions) Validate() error

Validate the CreatePullReviewOptions struct

type CreatePushMirrorOption added in v0.17.1

type CreatePushMirrorOption struct {
	Interval       string `json:"interval"`
	RemoteAddress  string `json:"remote_address"`
	RemotePassword string `json:"remote_password"`
	RemoteUsername string `json:"remote_username"`
	SyncONCommit   bool   `json:"sync_on_commit"`
}

type CreateReleaseOption

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

CreateReleaseOption options when creating a release

func (CreateReleaseOption) Validate added in v0.13.0

func (opt CreateReleaseOption) Validate() error

Validate the CreateReleaseOption struct

type CreateRepoActionsVariable added in v0.20.0

type CreateRepoActionsVariable struct {
	Value string `json:"value"`
}

CreateActionsVariable represents body for creating a action variable.

type CreateRepoFromTemplateOption added in v0.15.0

type CreateRepoFromTemplateOption struct {
	// Owner is the organization or person who will own the new repository
	Owner string `json:"owner"`
	// Name of the repository to create
	Name string `json:"name"`
	// Description of the repository to create
	Description string `json:"description"`
	// Private is whether the repository is private
	Private bool `json:"private"`
	// GitContent include git content of default branch in template repo
	GitContent bool `json:"git_content"`
	// Topics include topics of template repo
	Topics bool `json:"topics"`
	// GitHooks include git hooks of template repo
	GitHooks bool `json:"git_hooks"`
	// Webhooks include webhooks of template repo
	Webhooks bool `json:"webhooks"`
	// Avatar include avatar of the template repo
	Avatar bool `json:"avatar"`
	// Labels include labels of template repo
	Labels bool `json:"labels"`
}

CreateRepoFromTemplateOption options when creating repository using a template

func (CreateRepoFromTemplateOption) Validate added in v0.15.0

func (opt CreateRepoFromTemplateOption) Validate() error

Validate validates CreateRepoFromTemplateOption

type CreateRepoOption

type CreateRepoOption struct {
	// Name of the repository to create
	Name string `json:"name"`
	// Description of the repository to create
	Description string `json:"description"`
	// Whether the repository is private
	Private bool `json:"private"`
	// Issue Label set to use
	IssueLabels string `json:"issue_labels"`
	// Whether the repository should be auto-intialized?
	AutoInit bool `json:"auto_init"`
	// Whether the repository is template
	Template bool `json:"template"`
	// 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"`
	// TrustModel of the repository
	TrustModel TrustModel `json:"trust_model"`
	// ObjectFormatName of the repository, could be sha1 or sha256, depends on Gitea version
	ObjectFormatName string `json:"object_format_name"`
}

CreateRepoOption options when creating repository

func (CreateRepoOption) Validate added in v0.13.0

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

Validate the CreateRepoOption struct

type CreateStatusOption

type CreateStatusOption struct {
	State       StatusState `json:"state"`
	TargetURL   string      `json:"target_url"`
	Description string      `json:"description"`
	Context     string      `json:"context"`
}

CreateStatusOption holds the information needed to create a new Status for a Commit

type CreateTagOption added in v0.15.0

type CreateTagOption struct {
	TagName string `json:"tag_name"`
	Message string `json:"message"`
	Target  string `json:"target"`
}

CreateTagOption options when creating a tag

func (CreateTagOption) Validate added in v0.15.0

func (opt CreateTagOption) Validate() error

Validate validates CreateTagOption

type CreateTagProtectionOption added in v0.21.0

type CreateTagProtectionOption struct {
	NamePattern        string   `json:"name_pattern"`
	WhitelistUsernames []string `json:"whitelist_usernames"`
	WhitelistTeams     []string `json:"whitelist_teams"`
}

CreateTagProtectionOption options for creating a tag protection

type CreateTeamOption

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"`
	Units                   []RepoUnitType    `json:"units"`
	UnitsMap                map[string]string `json:"units_map"`
}

CreateTeamOption options for creating a team

func (*CreateTeamOption) Validate added in v0.13.0

func (opt *CreateTeamOption) Validate() error

Validate the CreateTeamOption struct

type CreateUserOption

type CreateUserOption struct {
	SourceID           int64        `json:"source_id"`
	LoginName          string       `json:"login_name"`
	Username           string       `json:"username"`
	FullName           string       `json:"full_name"`
	Email              string       `json:"email"`
	Password           string       `json:"password"`
	MustChangePassword *bool        `json:"must_change_password"`
	SendNotify         bool         `json:"send_notify"`
	Visibility         *VisibleType `json:"visibility"`
}

CreateUserOption create user options

func (CreateUserOption) Validate added in v0.13.0

func (opt CreateUserOption) Validate() error

Validate the CreateUserOption struct

type CreateWikiPageOptions added in v0.23.0

type CreateWikiPageOptions struct {
	Title         string `json:"title,omitempty"`
	ContentBase64 string `json:"content_base64,omitempty"`
	Message       string `json:"message,omitempty"`
}

CreateWikiPageOptions options for creating or editing a wiki page

type CronTask added in v0.13.0

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

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

DeleteEmailOption options when deleting email addresses

type DeleteFileOptions added in v0.12.0

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

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 DismissPullReviewOptions added in v0.14.0

type DismissPullReviewOptions struct {
	Message string `json:"message"`
}

DismissPullReviewOptions are options to dismiss a pull review

type EditActionRunnerOption added in v0.24.0

type EditActionRunnerOption struct {
	Disabled *bool `json:"disabled"`
}

EditActionRunnerOption contains editable runner fields.

func (EditActionRunnerOption) Validate added in v0.24.0

func (opt EditActionRunnerOption) Validate() error

Validate checks whether the runner update payload is valid.

type EditAttachmentOptions

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

EditAttachmentOptions options for editing attachments

type EditBranchProtectionOption added in v0.12.0

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"`
	BlockOnOfficialReviewRequests *bool    `json:"block_on_official_review_requests"`
	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"`
	UnprotectedFilePatterns       *string  `json:"unprotected_file_patterns"`
}

EditBranchProtectionOption options for editing a branch protection

type EditDeadlineOption added in v0.23.0

type EditDeadlineOption struct {
	Deadline *time.Time `json:"due_date"`
}

EditDeadlineOption represents options for updating issue deadline

type EditGitHookOption

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

EditGitHookOption options when modifying one Git hook

type EditHookOption

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

EditHookOption options when modify one hook

type EditIssueCommentOption

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

EditIssueCommentOption options for editing a comment

func (EditIssueCommentOption) Validate added in v0.13.0

func (opt EditIssueCommentOption) Validate() error

Validate the EditIssueCommentOption struct

type EditIssueOption

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

EditIssueOption options for editing an issue

func (EditIssueOption) Validate added in v0.13.0

func (opt EditIssueOption) Validate() error

Validate the EditIssueOption struct

type EditLabelOption

type EditLabelOption struct {
	Name        *string `json:"name"`
	Color       *string `json:"color"`
	Description *string `json:"description"`
	Exclusive   *bool   `json:"exclusive"`
	IsArchived  *bool   `json:"is_archived"`
}

EditLabelOption options for editing a label

func (EditLabelOption) Validate added in v0.13.0

func (opt EditLabelOption) Validate() error

Validate the EditLabelOption struct

type EditMilestoneOption

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 added in v0.13.0

func (opt EditMilestoneOption) Validate() error

Validate the EditMilestoneOption struct

type EditOrgLabelOption added in v0.22.1

type EditOrgLabelOption struct {
	// New name of the label
	Name *string `json:"name"`
	// New color of the label in hex format without #
	Color *string `json:"color"`
	// New description of the label
	Description *string `json:"description"`
	// Whether this is an exclusive label
	Exclusive *bool `json:"exclusive,omitempty"`
}

type EditOrgOption

type EditOrgOption struct {
	FullName                  string      `json:"full_name"`
	Email                     string      `json:"email"`
	Description               string      `json:"description"`
	Website                   string      `json:"website"`
	Location                  string      `json:"location"`
	Visibility                VisibleType `json:"visibility"`
	RepoAdminChangeTeamAccess *bool       `json:"repo_admin_change_team_access"`
}

EditOrgOption options for editing an organization

func (EditOrgOption) Validate added in v0.13.0

func (opt EditOrgOption) Validate() error

Validate the EditOrgOption struct

type EditPullRequestOption

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"`
	RemoveDeadline      *bool      `json:"unset_due_date"`
	AllowMaintainerEdit *bool      `json:"allow_maintainer_edit"`
}

EditPullRequestOption options when modify pull request

func (EditPullRequestOption) Validate added in v0.13.0

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

Validate the EditPullRequestOption struct

type EditReleaseOption

type EditReleaseOption struct {
	TagName      string `json:"tag_name"`
	Target       string `json:"target_commitish"`
	Title        string `json:"name"`
	Note         string `json:"body"`
	IsDraft      *bool  `json:"draft"`
	IsPrerelease *bool  `json:"prerelease"`
}

EditReleaseOption options when editing a release

type EditRepoOption

type EditRepoOption struct {
	// name of the repository
	Name *string `json:"name,omitempty"`
	// a short description of the repository.
	Description *string `json:"description,omitempty"`
	// a URL with more information about the repository.
	Website *string `json:"website,omitempty"`
	// either `true` to make the repository private or `false` to make it public.
	// Note: you will get a 422 error if the organization restricts changing repository visibility to organization
	// owners and a non-owner tries to change the value of private.
	Private *bool `json:"private,omitempty"`
	// either `true` to make this repository a template or `false` to make it a normal repository
	Template *bool `json:"template,omitempty"`
	// either `true` to enable issues for this repository or `false` to disable them.
	HasIssues *bool `json:"has_issues,omitempty"`
	// set this structure to configure internal issue tracker (requires has_issues)
	InternalTracker *InternalTracker `json:"internal_tracker,omitempty"`
	// set this structure to use external issue tracker (requires has_issues)
	ExternalTracker *ExternalTracker `json:"external_tracker,omitempty"`
	// either `true` to enable the wiki for this repository or `false` to disable it.
	HasWiki *bool `json:"has_wiki,omitempty"`
	// set this structure to use external wiki instead of internal (requires has_wiki)
	ExternalWiki *ExternalWiki `json:"external_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 enable project unit, or `false` to disable them.
	HasProjects *bool `json:"has_projects,omitempty"`
	// either `true` to enable release, or `false` to disable them.
	HasReleases *bool `json:"has_releases,omitempty"`
	// either `true` to enable packages, or `false` to disable them.
	HasPackages *bool `json:"has_packages,omitempty"`
	// either `true` to enable actions, or `false` to disable them.
	HasActions *bool `json:"has_actions,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 fast-forward only strategy, or `false` to prevent merging pull requests with a fast-forward only strategy. `has_pull_requests` must be `true`.
	AllowFastForwardOnlyMerge *bool `json:"allow_fast_forward_only_merge"`
	// 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"`
	// set to a string like `8h30m0s` to set the mirror interval time
	MirrorInterval *string `json:"mirror_interval,omitempty"`
	// either `true` to allow mark pr as merged manually, or `false` to prevent it. `has_pull_requests` must be `true`.
	AllowManualMerge *bool `json:"allow_manual_merge,omitempty"`
	// either `true` to enable AutodetectManualMerge, or `false` to prevent it. `has_pull_requests` must be `true`, Note: In some special cases, misjudgments can occur.
	AutodetectManualMerge *bool `json:"autodetect_manual_merge,omitempty"`
	// set to a merge style to be used by this repository: "merge", "rebase", "rebase-merge", or "squash". `has_pull_requests` must be `true`.
	DefaultMergeStyle *MergeStyle `json:"default_merge_style,omitempty"`
	// set to a projects mode to be used by this repository, to specify which kinds of projects to show: "repo" to only allow repo-level projects, "owner" to only allow owner projects, "all" to allow all projects. `has_projects` must be `true`.
	ProjectsMode *ProjectsMode `json:"projects_mode"`
	// set to `true` to delete the pull request branch after merge by default. `has_pull_requests` must be `true`.
	DefaultDeleteBranchAfterMerge *bool `json:"default_delete_branch_after_merge"`
}

EditRepoOption options when editing a repository's properties

type EditTagProtectionOption added in v0.21.0

type EditTagProtectionOption struct {
	NamePattern        *string  `json:"name_pattern"`
	WhitelistUsernames []string `json:"whitelist_usernames"`
	WhitelistTeams     []string `json:"whitelist_teams"`
}

EditTagProtectionOption options for editing a tag protection

type EditTeamOption

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"`
	Units                   []RepoUnitType    `json:"units"`
	UnitsMap                map[string]string `json:"units_map"`
}

EditTeamOption options for editing a team

func (*EditTeamOption) Validate added in v0.13.0

func (opt *EditTeamOption) Validate() error

Validate the EditTeamOption struct

type EditUserOption

type EditUserOption struct {
	SourceID                int64        `json:"source_id"`
	LoginName               string       `json:"login_name"`
	Email                   *string      `json:"email"`
	FullName                *string      `json:"full_name"`
	Password                string       `json:"password"`
	Description             *string      `json:"description"`
	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"`
	Restricted              *bool        `json:"restricted"`
	Visibility              *VisibleType `json:"visibility"`
}

EditUserOption edit user options

type Email

type Email struct {
	Email    string `json:"email"`
	Verified bool   `json:"verified"`
	Primary  bool   `json:"primary"`
	UserID   int64  `json:"user_id,omitempty"`
	Username string `json:"username,omitempty"`
}

Email an email address belonging to a user

type ErrUnknownVersion added in v0.16.0

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

ErrUnknownVersion is an unknown version from the API

func (*ErrUnknownVersion) Error added in v0.16.0

func (e *ErrUnknownVersion) Error() string

Error fulfills error

func (*ErrUnknownVersion) Is added in v0.16.0

func (*ErrUnknownVersion) Is(target error) bool

type ExternalTracker added in v0.14.0

type ExternalTracker struct {
	// URL of external issue tracker.
	ExternalTrackerURL string `json:"external_tracker_url"`
	// External Issue Tracker URL Format. Use the placeholders {user}, {repo} and {index} for the username, repository name and issue index.
	ExternalTrackerFormat string `json:"external_tracker_format"`
	// External Issue Tracker Number Format, either `numeric` or `alphanumeric`
	ExternalTrackerStyle string `json:"external_tracker_style"`
}

ExternalTracker represents settings for external tracker

type ExternalWiki added in v0.14.0

type ExternalWiki struct {
	// URL of external wiki.
	ExternalWikiURL string `json:"external_wiki_url"`
}

ExternalWiki represents setting for external wiki

type FileCommitResponse added in v0.12.0

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 added in v0.12.0

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 added in v0.12.0

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 added in v0.12.0

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"`
	// force_push (optional) will do a force-push if the new branch already exists
	ForcePush bool `json:"force_push"`
	// `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"`
	// Add a Signed-off-by trailer by the committer at the end of the commit log message.
	Signoff bool `json:"signoff"`
}

FileOptions options for all file APIs

type FileResponse added in v0.12.0

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

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"`
	Verified          bool           `json:"verified"`
	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

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

GPGKeyEmail an email attached to a GPGKey

type GetContentsExtOptions added in v0.23.0

type GetContentsExtOptions struct {
	// The name of the commit/branch/tag. Default to the repository's default branch
	Ref string `json:"ref,omitempty"`
	// Comma-separated includes options: file_content, lfs_metadata, commit_metadata, commit_message
	Includes string `json:"includes,omitempty"`
}

GetContentsExtOptions options for getting extended contents

type GetFilesOptions added in v0.24.0

type GetFilesOptions struct {
	Files []string `json:"files"`
}

GetFilesOptions controls batch file-content lookup requests.

func (GetFilesOptions) Validate added in v0.24.0

func (opt GetFilesOptions) Validate() error

Validate checks whether the batch file lookup request is valid.

type GetRepoNoteOptions added in v0.23.0

type GetRepoNoteOptions struct {
	// include verification for every commit (disable for speedup, default 'true')
	Verification *bool `json:"verification,omitempty"`
	// include a list of affected files for every commit (disable for speedup, default 'true')
	Files *bool `json:"files,omitempty"`
}

GetRepoNoteOptions options for getting a note

type GitBlobResponse

type GitBlobResponse struct {
	Content  string `json:"content"`
	Encoding string `json:"encoding"`
	URL      string `json:"url"`
	SHA      string `json:"sha"`
	Size     int64  `json:"size"`
}

GitBlobResponse represents a git blob

type GitEntry

type GitEntry struct {
	Path string `json:"path"`
	Mode string `json:"mode"`
	Type string `json:"type"`
	Size int64  `json:"size"`
	SHA  string `json:"sha"`
	URL  string `json:"url"`
}

GitEntry represents a git tree

type GitHook

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

GitHook represents a Git repository hook

type GitObject

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

GitObject represents a Git object.

type GitServiceType added in v0.13.0

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"
	// GitServiceGitea represents a gitea service
	GitServiceGitea GitServiceType = "gitea"
	// GitServiceGogs represents a gogs service
	GitServiceGogs GitServiceType = "gogs"
)

type GitTreeResponse

type GitTreeResponse struct {
	SHA        string     `json:"sha"`
	URL        string     `json:"url"`
	Entries    []GitEntry `json:"tree"`
	Truncated  bool       `json:"truncated"`
	Page       int        `json:"page"`
	TotalCount int        `json:"total_count"`
}

GitTreeResponse returns a git tree

type GitignoreTemplateInfo added in v0.23.0

type GitignoreTemplateInfo struct {
	Name   string `json:"name"`
	Source string `json:"source"`
}

GitignoreTemplateInfo represents a gitignore template

type GlobalAPISettings added in v0.13.0

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 added in v0.13.0

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 added in v0.13.0

type GlobalRepoSettings struct {
	MirrorsDisabled      bool `json:"mirrors_disabled"`
	HTTPGitDisabled      bool `json:"http_git_disabled"`
	MigrationsDisabled   bool `json:"migrations_disabled"`
	StarsDisabled        bool `json:"stars_disabled"`
	TimeTrackingDisabled bool `json:"time_tracking_disabled"`
	LFSDisabled          bool `json:"lfs_disabled"`
}

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

type GlobalUISettings added in v0.13.0

type GlobalUISettings struct {
	DefaultTheme     string   `json:"default_theme"`
	AllowedReactions []string `json:"allowed_reactions"`
	CustomEmojis     []string `json:"custom_emojis"`
}

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

type HTTPSign added in v0.16.0

type HTTPSign struct {
	ssh.Signer
	// contains filtered or unexported fields
}

HTTPSign contains the signer used for signing requests

func NewHTTPSignWithCert added in v0.16.0

func NewHTTPSignWithCert(principal, sshKey, passphrase string) (*HTTPSign, error)

NewHTTPSignWithCert can be used to create a HTTPSign with a certificate if no principal is specified it returns the first certificate found

func NewHTTPSignWithPubkey added in v0.16.0

func NewHTTPSignWithPubkey(fingerprint, sshKey, passphrase string) (*HTTPSign, error)

NewHTTPSignWithPubkey can be used to create a HTTPSign with a public key if no fingerprint is specified it returns the first public key found

type HTTPSignConfig added in v0.16.0

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

HTTPSignConfig contains the configuration for creating a HTTPSign

type Hook

type Hook struct {
	ID                  int64             `json:"id"`
	Type                string            `json:"type"`
	URL                 string            `json:"-"`
	BranchFilter        string            `json:"branch_filter"`
	Config              map[string]string `json:"config"`
	Events              []string          `json:"events"`
	AuthorizationHeader string            `json:"authorization_header"`
	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 HookType added in v0.15.0

type HookType string

HookType represent all webhook types gitea currently offer

const (
	// HookTypeDingtalk webhook that dingtalk understand
	HookTypeDingtalk HookType = "dingtalk"
	// HookTypeDiscord webhook that discord understand
	HookTypeDiscord HookType = "discord"
	// HookTypeGitea webhook that gitea understand
	HookTypeGitea HookType = "gitea"
	// HookTypeGogs webhook that gogs understand
	HookTypeGogs HookType = "gogs"
	// HookTypeMsteams webhook that msteams understand
	HookTypeMsteams HookType = "msteams"
	// HookTypeSlack webhook that slack understand
	HookTypeSlack HookType = "slack"
	// HookTypeTelegram webhook that telegram understand
	HookTypeTelegram HookType = "telegram"
	// HookTypeFeishu webhook that feishu understand
	HookTypeFeishu HookType = "feishu"
)

type Identity

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

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

type InternalTracker added in v0.14.0

type InternalTracker struct {
	// Enable time tracking (Built-in issue tracker)
	EnableTimeTracker bool `json:"enable_time_tracker"`
	// Let only contributors track time (Built-in issue tracker)
	AllowOnlyContributorsToTrackTime bool `json:"allow_only_contributors_to_track_time"`
	// Enable dependencies for issues and pull requests (Built-in issue tracker)
	EnableIssueDependencies bool `json:"enable_issue_dependencies"`
}

InternalTracker represents settings for internal tracker

type Issue

type Issue struct {
	ID               int64      `json:"id"`
	URL              string     `json:"url"`
	HTMLURL          string     `json:"html_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"`
	Ref              string     `json:"ref"`
	Labels           []*Label   `json:"labels"`
	Milestone        *Milestone `json:"milestone"`
	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 IssueBlockedBy added in v0.23.0

type IssueBlockedBy struct {
	Index     int64     `json:"index"`
	Title     string    `json:"title"`
	State     string    `json:"state"`
	CreatedAt time.Time `json:"created_at"`
}

IssueBlockedBy represents an issue that blocks another issue

type IssueConfig added in v0.24.0

type IssueConfig struct {
	BlankIssuesEnabled bool                     `json:"blank_issues_enabled"`
	ContactLinks       []IssueConfigContactLink `json:"contact_links"`
}

IssueConfig represents the parsed issue config for a repository.

type IssueConfigContactLink struct {
	Name  string `json:"name"`
	URL   string `json:"url"`
	About string `json:"about"`
}

IssueConfigContactLink represents an issue config contact link.

type IssueConfigValidation added in v0.24.0

type IssueConfigValidation struct {
	Valid   bool   `json:"valid"`
	Message string `json:"message"`
}

IssueConfigValidation represents the validation result for issue config

type IssueFormElement added in v0.16.0

type IssueFormElement struct {
	ID          string                      `json:"id"`
	Type        IssueFormElementType        `json:"type"`
	Attributes  IssueFormElementAttributes  `json:"attributes"`
	Validations IssueFormElementValidations `json:"validations"`
}

IssueFormElement describes a part of a IssueTemplate form

type IssueFormElementAttributes added in v0.16.0

type IssueFormElementAttributes struct {
	// required for all element types.
	// A brief description of the expected user input, which is also displayed in the form.
	Label string `json:"label"`
	// required for element types "dropdown", "checkboxes"
	// for dropdown, contains the available options
	Options []string `json:"options"`
	// for element types "markdown", "textarea", "input"
	// Text that is pre-filled in the input
	Value string `json:"value"`
	// for element types "textarea", "input", "dropdown", "checkboxes"
	// A description of the text area to provide context or guidance, which is displayed in the form.
	Description string `json:"description"`
	// for element types "textarea", "input"
	// A semi-opaque placeholder that renders in the text area when empty.
	Placeholder string `json:"placeholder"`
	// for element types "textarea"
	// A language specifier. If set, the input is rendered as codeblock with syntax highlighting.
	SyntaxHighlighting string `json:"render"`
	// for element types "dropdown"
	Multiple bool `json:"multiple"`
}

IssueFormElementAttributes contains the combined set of attributes available on all element types.

type IssueFormElementType added in v0.16.0

type IssueFormElementType string

IssueFormElementType is an enum

const (
	// IssueFormElementMarkdown is markdown rendered to the form for context, but omitted in the resulting issue
	IssueFormElementMarkdown IssueFormElementType = "markdown"
	// IssueFormElementTextarea is a multi line input
	IssueFormElementTextarea IssueFormElementType = "textarea"
	// IssueFormElementInput is a single line input
	IssueFormElementInput IssueFormElementType = "input"
	// IssueFormElementDropdown is a select form
	IssueFormElementDropdown IssueFormElementType = "dropdown"
	// IssueFormElementCheckboxes are a multi checkbox input
	IssueFormElementCheckboxes IssueFormElementType = "checkboxes"
)

type IssueFormElementValidations added in v0.16.0

type IssueFormElementValidations struct {
	// for all element types
	Required bool `json:"required"`
	// for element types "input"
	IsNumber bool `json:"is_number"`
	// for element types "input"
	Regex string `json:"regex"`
}

IssueFormElementValidations contains the combined set of validations available on all element types.

type IssueLabelsOption

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

IssueLabelsOption a collection of labels

type IssueMeta added in v0.23.0

type IssueMeta struct {
	Index int64 `json:"index"`
}

IssueMeta represents issue reference for blocking/dependency operations

type IssueTemplate added in v0.16.0

type IssueTemplate struct {
	Name        string   `json:"name"`
	About       string   `json:"about"`
	Filename    string   `json:"file_name"`
	IssueTitle  string   `json:"title"`
	IssueLabels []string `json:"labels"`
	IssueRef    string   `json:"ref"`
	// If non-nil, this is a form-based template
	Form []IssueFormElement `json:"body"`
	// Should only be used when .Form is nil.
	MarkdownContent string `json:"content"`
}

IssueTemplate provides metadata and content on an issue template. There are two types of issue templates: .Markdown- and .Form-based.

func (IssueTemplate) IsForm added in v0.16.0

func (t IssueTemplate) IsForm() bool

IsForm tells if this template is a form instead of a markdown-based template.

type IssueType added in v0.11.2

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

type Label struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	// example: 00aabb
	Color       string `json:"color"`
	Description string `json:"description"`
	Exclusive   bool   `json:"exclusive"`
	IsArchived  bool   `json:"is_archived"`
	URL         string `json:"url"`
}

Label a label to an issue or a pr

type LabelTemplate added in v0.23.0

type LabelTemplate struct {
	Name        string `json:"name"`
	Color       string `json:"color"`
	Description string `json:"description"`
	Exclusive   bool   `json:"exclusive"`
}

LabelTemplate represents a label template

type LicenseTemplateInfo added in v0.23.0

type LicenseTemplateInfo struct {
	Key            string `json:"key"`
	Name           string `json:"name"`
	URL            string `json:"url"`
	Body           string `json:"body"`
	Implementation string `json:"implementation"`
}

LicenseTemplateInfo represents a license template

type LicensesTemplateListEntry added in v0.23.0

type LicensesTemplateListEntry struct {
	Key  string `json:"key"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

LicensesTemplateListEntry represents a license in the list

type ListAccessTokensOptions added in v0.11.1

type ListAccessTokensOptions struct {
	ListOptions
}

ListAccessTokensOptions options for listing a users's access tokens

type ListActionArtifactsOptions added in v0.24.0

type ListActionArtifactsOptions struct {
	ListOptions
	Name string
}

ListActionArtifactsOptions controls artifact listing requests.

func (*ListActionArtifactsOptions) QueryEncode added in v0.24.0

func (opt *ListActionArtifactsOptions) QueryEncode() string

QueryEncode turns the artifact list options into a query string.

type ListActionRunnersOptions added in v0.24.0

type ListActionRunnersOptions struct {
	ListOptions
	Disabled *bool
}

ListActionRunnersOptions controls runner listing requests.

func (*ListActionRunnersOptions) QueryEncode added in v0.24.0

func (opt *ListActionRunnersOptions) QueryEncode() string

QueryEncode turns the runner list options into a query string.

type ListAdminEmailsOptions added in v0.23.0

type ListAdminEmailsOptions struct {
	ListOptions
}

ListAdminEmailsOptions options for listing all emails

type ListAdminHooksOptions added in v0.23.0

type ListAdminHooksOptions struct {
	ListOptions
	// Type of hooks to list: system, default, or all
	Type string `json:"type,omitempty"`
}

ListAdminHooksOptions options for listing admin hooks

type ListBranchProtectionsOptions added in v0.12.0

type ListBranchProtectionsOptions struct {
	ListOptions
}

ListBranchProtectionsOptions list branch protection options

type ListCollaboratorsOptions added in v0.11.1

type ListCollaboratorsOptions struct {
	ListOptions
}

ListCollaboratorsOptions options for listing a repository's collaborators

type ListCommitOptions added in v0.11.1

type ListCommitOptions struct {
	ListOptions
	// SHA or branch to start listing commits from (usually 'master')
	SHA string
	// Path indicates that only commits that include the path's file/dir should be returned.
	Path string
	// Stat includes diff stats for every commit (disable for speedup)
	Stat bool
	// Verification includes verification for every commit (disable for speedup)
	Verification bool
	// Files includes a list of affected files for every commit (disable for speedup)
	Files bool
	// Not is a string used such that commits that match the given specifier will not be listed.
	Not string
}

ListCommitOptions list commit options

func (*ListCommitOptions) QueryEncode added in v0.11.1

func (opt *ListCommitOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListCronTaskOptions added in v0.13.0

type ListCronTaskOptions struct {
	ListOptions
}

ListCronTaskOptions list options for ListCronTasks

type ListDeployKeysOptions added in v0.11.1

type ListDeployKeysOptions struct {
	ListOptions
	KeyID       int64
	Fingerprint string
}

ListDeployKeysOptions options for listing a repository's deploy keys

func (*ListDeployKeysOptions) QueryEncode added in v0.11.1

func (opt *ListDeployKeysOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListEmailsOptions added in v0.11.1

type ListEmailsOptions struct {
	ListOptions
}

ListEmailsOptions options for listing current's user emails

type ListFollowersOptions added in v0.11.1

type ListFollowersOptions struct {
	ListOptions
}

ListFollowersOptions options for listing followers

type ListFollowingOptions added in v0.11.1

type ListFollowingOptions struct {
	ListOptions
}

ListFollowingOptions options for listing a user's users being followed

type ListForksOptions added in v0.11.1

type ListForksOptions struct {
	ListOptions
}

ListForksOptions options for listing repository's forks

type ListGPGKeysOptions added in v0.11.1

type ListGPGKeysOptions struct {
	ListOptions
}

ListGPGKeysOptions options for listing a user's GPGKeys

type ListHooksOptions added in v0.11.1

type ListHooksOptions struct {
	ListOptions
}

ListHooksOptions options for listing hooks

type ListIssueBlocksOptions added in v0.23.1

type ListIssueBlocksOptions struct {
	ListOptions
}

ListIssueBlocksOptions options for listing issue blocks

type ListIssueCommentOptions added in v0.11.1

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

ListIssueCommentOptions list comment options

func (*ListIssueCommentOptions) QueryEncode added in v0.11.1

func (opt *ListIssueCommentOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListIssueDependenciesOptions added in v0.23.1

type ListIssueDependenciesOptions struct {
	ListOptions
}

ListIssueDependenciesOptions options for listing issue dependencies

type ListIssueOption

type ListIssueOption struct {
	ListOptions
	State      StateType
	Type       IssueType
	Labels     []string
	Milestones []string
	KeyWord    string
	Since      time.Time
	Before     time.Time
	// filter by created by username
	CreatedBy string
	// filter by assigned to username
	AssignedBy string
	// filter by username mentioned
	MentionedBy string
	// filter by owner (only works on ListIssues on User)
	Owner string
	// filter by team (requires organization owner parameter to be provided and only works on ListIssues on User)
	Team string
}

ListIssueOption list issue options

func (*ListIssueOption) QueryEncode

func (opt *ListIssueOption) QueryEncode() string

QueryEncode turns options into querystring argument

type ListIssueReactionsOptions added in v0.23.1

type ListIssueReactionsOptions struct {
	ListOptions
}

ListIssueReactionsOptions options for listing issue reactions

type ListIssueSubscribersOptions added in v0.23.1

type ListIssueSubscribersOptions struct {
	ListOptions
}

ListIssueSubscribersOptions options for listing issue subscribers

type ListLabelsOptions added in v0.11.1

type ListLabelsOptions struct {
	ListOptions
}

ListLabelsOptions options for listing repository's labels

type ListMilestoneOption added in v0.11.1

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

ListMilestoneOption list milestone options

func (*ListMilestoneOption) QueryEncode added in v0.11.1

func (opt *ListMilestoneOption) QueryEncode() string

QueryEncode turns options into querystring argument

type ListNotificationOptions added in v0.11.1

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

ListNotificationOptions represents the filter options

func (*ListNotificationOptions) QueryEncode added in v0.11.1

func (opt *ListNotificationOptions) QueryEncode() string

QueryEncode encode options to url query

func (ListNotificationOptions) Validate added in v0.12.2

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

Validate the CreateUserOption struct

type ListOauth2Option added in v0.12.0

type ListOauth2Option struct {
	ListOptions
}

ListOauth2Option for listing Oauth2 Applications

type ListOptions added in v0.11.1

type ListOptions struct {
	// Setting Page to -1 disables pagination on endpoints that support it.
	// Page numbering starts at 1.
	Page int
	// The default value depends on the server config DEFAULT_PAGING_NUM
	// The highest valid value depends on the server config MAX_RESPONSE_ITEMS
	PageSize int
}

ListOptions options for using Gitea's API pagination

type ListOrgActionSecretOption added in v0.16.0

type ListOrgActionSecretOption struct {
	ListOptions
}

ListOrgActionSecretOption list OrgActionSecret options

type ListOrgActionVariableOption added in v0.22.0

type ListOrgActionVariableOption struct {
	ListOptions
}

ListOrgActionVariableOption lists ActionVariable options

type ListOrgActivityFeedsOptions added in v0.23.0

type ListOrgActivityFeedsOptions struct {
	ListOptions
	Date string `json:"date,omitempty"`
}

ListOrgActivityFeedsOptions options for listing organization activity feeds

type ListOrgBlocksOptions added in v0.23.0

type ListOrgBlocksOptions struct {
	ListOptions
}

ListOrgBlocksOptions options for listing organization blocks

type ListOrgLabelsOptions added in v0.22.1

type ListOrgLabelsOptions struct {
	ListOptions
}

ListOrgLabelsOptions options for listing organization labels

type ListOrgMembershipOption added in v0.11.1

type ListOrgMembershipOption struct {
	ListOptions
}

ListOrgMembershipOption list OrgMembership options

type ListOrgReposOptions added in v0.11.1

type ListOrgReposOptions struct {
	ListOptions
}

ListOrgReposOptions options for a organization's repositories

type ListOrgsOptions added in v0.11.1

type ListOrgsOptions struct {
	ListOptions
}

ListOrgsOptions options for listing organizations

type ListPackagesOptions added in v0.16.0

type ListPackagesOptions struct {
	ListOptions
}

ListPackagesOptions options for listing packages

type ListPublicKeysOptions added in v0.11.1

type ListPublicKeysOptions struct {
	ListOptions
}

ListPublicKeysOptions options for listing a user's PublicKeys

type ListPullRequestCommitsOptions added in v0.15.0

type ListPullRequestCommitsOptions struct {
	ListOptions
}

ListPullRequestCommitsOptions options for listing pull requests

type ListPullRequestFilesOptions added in v0.16.0

type ListPullRequestFilesOptions struct {
	ListOptions
}

ListPullRequestFilesOptions options for listing pull request files

type ListPullRequestsOptions

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 added in v0.11.1

func (opt *ListPullRequestsOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListPullReviewsOptions added in v0.12.0

type ListPullReviewsOptions struct {
	ListOptions
}

ListPullReviewsOptions options for listing PullReviews

type ListReleaseAttachmentsOptions added in v0.11.1

type ListReleaseAttachmentsOptions struct {
	ListOptions
}

ListReleaseAttachmentsOptions options for listing release's attachments

type ListReleasesOptions added in v0.11.1

type ListReleasesOptions struct {
	ListOptions
	IsDraft      *bool
	IsPreRelease *bool
}

ListReleasesOptions options for listing repository's releases

func (*ListReleasesOptions) QueryEncode added in v0.15.0

func (opt *ListReleasesOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListRepoActionJobsOptions added in v0.23.0

type ListRepoActionJobsOptions struct {
	ListOptions
	Status string // Filter by status (pending, queued, in_progress, failure, success, skipped)
}

ListRepoActionJobsOptions options for listing repository action jobs

func (*ListRepoActionJobsOptions) QueryEncode added in v0.23.0

func (opt *ListRepoActionJobsOptions) QueryEncode() string

QueryEncode encodes the options to URL query parameters

type ListRepoActionRunsOptions added in v0.23.0

type ListRepoActionRunsOptions struct {
	ListOptions
	Branch  string // Filter by branch
	Event   string // Filter by triggering event
	Status  string // Filter by status (pending, queued, in_progress, failure, success, skipped)
	Actor   string // Filter by actor (user who triggered the run)
	HeadSHA string // Filter by the SHA of the head commit
}

ListRepoActionRunsOptions options for listing repository action runs

func (*ListRepoActionRunsOptions) QueryEncode added in v0.23.0

func (opt *ListRepoActionRunsOptions) QueryEncode() string

QueryEncode encodes the options to URL query parameters

type ListRepoActionSecretOption added in v0.19.0

type ListRepoActionSecretOption struct {
	ListOptions
}

ListRepoActionSecretOption list RepoActionSecret options

type ListRepoActionVariableOption added in v0.23.0

type ListRepoActionVariableOption struct {
	ListOptions
}

ListRepoActionVariableOption lists RepoActionVariable options

type ListRepoActivityFeedsOptions added in v0.24.0

type ListRepoActivityFeedsOptions struct {
	ListOptions
	Date string `json:"date"` // the date of the activities to be found (format: YYYY-MM-DD)
}

ListRepoActivityFeedsOptions options for listing repository activity feeds

type ListRepoBranchesOptions added in v0.11.1

type ListRepoBranchesOptions struct {
	ListOptions
}

ListRepoBranchesOptions options for listing a repository's branches

type ListRepoGitHooksOptions added in v0.11.1

type ListRepoGitHooksOptions struct {
	ListOptions
}

ListRepoGitHooksOptions options for listing repository's githooks

type ListRepoTagProtectionsOptions added in v0.21.0

type ListRepoTagProtectionsOptions struct {
	ListOptions
}

ListRepoTagsOptions options for listing a repository's tags

type ListRepoTagsOptions added in v0.11.1

type ListRepoTagsOptions struct {
	ListOptions
}

ListRepoTagsOptions options for listing a repository's tags

type ListRepoTopicsOptions added in v0.11.1

type ListRepoTopicsOptions struct {
	ListOptions
}

ListRepoTopicsOptions options for listing repo's topics

type ListReposOptions added in v0.11.1

type ListReposOptions struct {
	ListOptions
}

ListReposOptions options for listing repositories

type ListStargazersOptions added in v0.14.0

type ListStargazersOptions struct {
	ListOptions
}

ListStargazersOptions options for listing a repository's stargazers

type ListStatusesOption

type ListStatusesOption struct {
	ListOptions
}

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

type ListStopwatchesOptions added in v0.23.1

type ListStopwatchesOptions struct {
	ListOptions
}

ListStopwatchesOptions options for listing stopwatches

type ListTeamActivityFeedsOptions added in v0.23.0

type ListTeamActivityFeedsOptions struct {
	ListOptions
	Date string `json:"date,omitempty"`
}

ListTeamActivityFeedsOptions options for listing team activity feeds

type ListTeamMembersOptions added in v0.11.1

type ListTeamMembersOptions struct {
	ListOptions
}

ListTeamMembersOptions options for listing team's members

type ListTeamRepositoriesOptions added in v0.11.1

type ListTeamRepositoriesOptions struct {
	ListOptions
}

ListTeamRepositoriesOptions options for listing team's repositories

type ListTeamsOptions added in v0.11.1

type ListTeamsOptions struct {
	ListOptions
}

ListTeamsOptions options for listing teams

type ListTrackedTimesOptions added in v0.11.1

type ListTrackedTimesOptions struct {
	ListOptions
	Since  time.Time
	Before time.Time
	// User filter is only used by ListRepoTrackedTimes !!!
	User string
}

ListTrackedTimesOptions options for listing repository's tracked times

func (*ListTrackedTimesOptions) QueryEncode added in v0.14.0

func (opt *ListTrackedTimesOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type ListTreeOptions added in v0.21.0

type ListTreeOptions struct {
	ListOptions
	// Ref can be branch/tag/commit. required
	// e.g.: "master"
	Ref string
	// Recursive if true will return the tree in a recursive fashion
	Recursive bool
}

type ListUnadoptedReposOptions added in v0.23.0

type ListUnadoptedReposOptions struct {
	ListOptions
	Pattern string `json:"pattern,omitempty"`
}

ListUnadoptedReposOptions options for listing unadopted repositories

type ListUserActivityFeedsOptions added in v0.23.0

type ListUserActivityFeedsOptions struct {
	ListOptions
	OnlyPerformedBy bool   `json:"only-performed-by,omitempty"`
	Date            string `json:"date,omitempty"`
}

ListUserActivityFeedsOptions options for listing user activity feeds

type ListUserBlocksOptions added in v0.23.0

type ListUserBlocksOptions struct {
	ListOptions
}

ListUserBlocksOptions options for listing user blocks

type ListWikiPageRevisionsOptions added in v0.23.0

type ListWikiPageRevisionsOptions struct {
	Page int `json:"page,omitempty"`
}

ListWikiPageRevisionsOptions options for listing wiki page revisions

type ListWikiPagesOptions added in v0.23.0

type ListWikiPagesOptions struct {
	ListOptions
}

ListWikiPagesOptions options for listing wiki pages

type LockIssueOption added in v0.23.0

type LockIssueOption struct {
	LockReason string `json:"lock_reason"`
}

LockIssueOption represents options for locking an issue

type MarkNotificationOptions added in v0.11.1

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

MarkNotificationOptions represents the filter & modify options

func (*MarkNotificationOptions) QueryEncode added in v0.11.1

func (opt *MarkNotificationOptions) QueryEncode() string

QueryEncode encode options to url query

func (MarkNotificationOptions) Validate added in v0.12.2

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

Validate the CreateUserOption struct

type MarkdownOption added in v0.23.0

type MarkdownOption struct {
	Text    string `json:"Text"`
	Mode    string `json:"Mode"`
	Context string `json:"Context"`
	Wiki    bool   `json:"Wiki"`
}

MarkdownOption represents options for rendering markdown

type MarkupOption added in v0.23.0

type MarkupOption struct {
	Text     string `json:"Text"`
	Mode     string `json:"Mode"`
	Context  string `json:"Context"`
	FilePath string `json:"FilePath"`
	Wiki     bool   `json:"Wiki"`
}

MarkupOption represents options for rendering markup

type MergePullRequestOption

type MergePullRequestOption struct {
	Style                  MergeStyle `json:"Do"`
	MergeCommitID          string     `json:"MergeCommitID"`
	Title                  string     `json:"MergeTitleField"`
	Message                string     `json:"MergeMessageField"`
	DeleteBranchAfterMerge *bool      `json:"delete_branch_after_merge,omitempty"`
	ForceMerge             bool       `json:"force_merge"`
	HeadCommitId           string     `json:"head_commit_id"`
	MergeWhenChecksSucceed bool       `json:"merge_when_checks_succeed"`
}

MergePullRequestOption options when merging a pull request

func (MergePullRequestOption) Validate added in v0.13.0

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

Validate the MergePullRequestOption struct

type MergeStyle added in v0.12.0

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"
	// MergeStyleFastForwardOnly fast-forward merge
	MergeStyleFastForwardOnly MergeStyle = "fast-forward-only"
	// MergeStyleManuallyMerged manually merged
	MergeStyleManuallyMerged MergeStyle = "manually-merged"
)

type MergeUpstreamRequest added in v0.24.0

type MergeUpstreamRequest struct {
	Branch string `json:"branch"`
	FfOnly bool   `json:"ff_only"`
}

MergeUpstreamRequest options for merging upstream

type MergeUpstreamResponse added in v0.24.0

type MergeUpstreamResponse struct {
	MergeStyle string `json:"merge_type"`
}

MergeUpstreamResponse represents the response from merging upstream

type MigrateRepoOption

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"`
	MirrorInterval string         `json:"mirror_interval"`
	LFS            bool           `json:"lfs"`
	LFSEndpoint    string         `json:"lfs_endpoint"`
}

MigrateRepoOption options for migrating a repository from an external service

func (*MigrateRepoOption) Validate added in v0.13.0

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

Validate the MigrateRepoOption struct

type Milestone

type Milestone struct {
	ID           int64      `json:"id"`
	Title        string     `json:"title"`
	Description  string     `json:"description"`
	State        StateType  `json:"state"`
	OpenIssues   int        `json:"open_issues"`
	ClosedIssues int        `json:"closed_issues"`
	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 NewIssuePinsAllowed added in v0.24.0

type NewIssuePinsAllowed struct {
	Issues       bool `json:"issues"`
	PullRequests bool `json:"pull_requests"`
}

NewIssuePinsAllowed represents whether new issue/PR pins are allowed

type NodeInfo added in v0.23.0

type NodeInfo struct {
	Version           string                 `json:"version"`
	Software          NodeInfoSoftware       `json:"software"`
	Protocols         []string               `json:"protocols"`
	Services          NodeInfoServices       `json:"services"`
	OpenRegistrations bool                   `json:"openRegistrations"`
	Usage             NodeInfoUsage          `json:"usage"`
	Metadata          map[string]interface{} `json:"metadata"`
}

NodeInfo represents nodeinfo about the server

type NodeInfoServices added in v0.23.0

type NodeInfoServices struct {
	Inbound  []string `json:"inbound"`
	Outbound []string `json:"outbound"`
}

NodeInfoServices represents third party services

type NodeInfoSoftware added in v0.23.0

type NodeInfoSoftware struct {
	Name       string `json:"name"`
	Version    string `json:"version"`
	Repository string `json:"repository"`
	Homepage   string `json:"homepage"`
}

NodeInfoSoftware represents software information

type NodeInfoUsage added in v0.23.0

type NodeInfoUsage struct {
	Users         NodeInfoUsageUsers `json:"users"`
	LocalPosts    int64              `json:"localPosts"`
	LocalComments int64              `json:"localComments"`
}

NodeInfoUsage represents usage statistics

type NodeInfoUsageUsers added in v0.23.0

type NodeInfoUsageUsers struct {
	Total          int64 `json:"total"`
	ActiveHalfyear int64 `json:"activeHalfyear"`
	ActiveMonth    int64 `json:"activeMonth"`
}

NodeInfoUsageUsers represents user statistics

type Note added in v0.23.0

type Note struct {
	Message string  `json:"message"`
	Commit  *Commit `json:"commit"`
}

Note represents a git note

type NotificationSubject added in v0.11.1

type NotificationSubject struct {
	Title                string             `json:"title"`
	URL                  string             `json:"url"`
	HTMLURL              string             `json:"html_url"`
	LatestCommentURL     string             `json:"latest_comment_url"`
	LatestCommentHTMLURL string             `json:"latest_comment_html_url"`
	Type                 NotifySubjectType  `json:"type"`
	State                NotifySubjectState `json:"state"`
}

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

type NotificationThread added in v0.11.1

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 added in v0.12.2

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 NotifySubjectState added in v0.15.0

type NotifySubjectState string

NotifySubjectState reflect state of notification subject

const (
	// NotifySubjectOpen if subject is a pull/issue and is open at the moment
	NotifySubjectOpen NotifySubjectState = "open"
	// NotifySubjectClosed if subject is a pull/issue and is closed at the moment
	NotifySubjectClosed NotifySubjectState = "closed"
	// NotifySubjectMerged if subject is a pull and got merged
	NotifySubjectMerged NotifySubjectState = "merged"
)

type NotifySubjectType added in v0.15.0

type NotifySubjectType string

NotifySubjectType represent type of notification subject

const (
	// NotifySubjectIssue an issue is subject of an notification
	NotifySubjectIssue NotifySubjectType = "Issue"
	// NotifySubjectPull an pull is subject of an notification
	NotifySubjectPull NotifySubjectType = "Pull"
	// NotifySubjectCommit an commit is subject of an notification
	NotifySubjectCommit NotifySubjectType = "Commit"
	// NotifySubjectRepository an repository is subject of an notification
	NotifySubjectRepository NotifySubjectType = "Repository"
)

type Oauth2 added in v0.12.0

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"`
	ConfidentialClient bool      `json:"confidential_client"`
	Created            time.Time `json:"created"`
}

Oauth2 represents an Oauth2 Application

type OrgPermissions added in v0.16.0

type OrgPermissions struct {
	CanCreateRepository bool `json:"can_create_repository"`
	CanRead             bool `json:"can_read"`
	CanWrite            bool `json:"can_write"`
	IsAdmin             bool `json:"is_admin"`
	IsOwner             bool `json:"is_owner"`
}

OrgPermissions represents the permissions for an user in an organization

type Organization

type Organization struct {
	ID   int64  `json:"id"`
	Name string `json:"name"`
	// Deprecated: Use Name instead. See https://github.com/go-gitea/gitea/blob/main/modules/structs/org.go#L29
	UserName                  string `json:"username"`
	FullName                  string `json:"full_name"`
	Email                     string `json:"email"`
	AvatarURL                 string `json:"avatar_url"`
	Description               string `json:"description"`
	Website                   string `json:"website"`
	Location                  string `json:"location"`
	Visibility                string `json:"visibility"`
	RepoAdminChangeTeamAccess bool   `json:"repo_admin_change_team_access"`
}

Organization represents an organization

type PRBranchInfo

type PRBranchInfo struct {
	Name       string      `json:"label"`
	Ref        string      `json:"ref"`
	Sha        string      `json:"sha"`
	RepoID     int64       `json:"repo_id"`
	Repository *Repository `json:"repo"`
}

PRBranchInfo information about a branch

type Package added in v0.16.0

type Package struct {
	// the package's id
	ID int64 `json:"id"`
	// the package's owner
	Owner *User `json:"owner"`
	// the repo this package belongs to (if any)
	Repository *Repository `json:"repository"`
	// the package's creator
	Creator *User `json:"creator"`
	// the type of package:
	Type string `json:"type"`
	// the name of the package
	Name string `json:"name"`
	// the version of the package
	Version string `json:"version"`
	// the HTML URL for viewing the package
	HTMLURL string `json:"html_url"`
	// the date the package was uploaded
	CreatedAt time.Time `json:"created_at"`
}

Package represents a package

type PackageFile added in v0.16.0

type PackageFile struct {
	// the file's ID
	ID int64 `json:"id"`
	// the size of the file in bytes
	Size int64 `json:"size"`
	// the name of the file
	Name string `json:"name"`
	// the md5 hash of the file
	MD5 string `json:"md5"`
	// the sha1 hash of the file
	SHA1 string `json:"sha1"`
	// the sha256 hash of the file
	SHA256 string `json:"sha256"`
	// the sha512 hash of the file
	SHA512 string `json:"sha512"`
}

PackageFile represents a file from a package

type PayloadCommit

type PayloadCommit struct {
	// sha1 hash of the commit
	ID           string                     `json:"id"`
	Message      string                     `json:"message"`
	URL          string                     `json:"url"`
	Author       *PayloadUser               `json:"author"`
	Committer    *PayloadUser               `json:"committer"`
	Verification *PayloadCommitVerification `json:"verification"`
	Timestamp    time.Time                  `json:"timestamp"`
	Added        []string                   `json:"added"`
	Removed      []string                   `json:"removed"`
	Modified     []string                   `json:"modified"`
}

PayloadCommit represents a commit

type PayloadCommitVerification

type PayloadCommitVerification struct {
	Verified  bool   `json:"verified"`
	Reason    string `json:"reason"`
	Signature string `json:"signature"`
	Payload   string `json:"payload"`
}

PayloadCommitVerification represents the GPG verification of a commit

type PayloadUser

type PayloadUser struct {
	// Full name of the commit author
	Name     string `json:"name"`
	Email    string `json:"email"`
	UserName string `json:"username"`
}

PayloadUser represents the author or committer of a commit

type Permission

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

Permission represents a set of permissions

type ProjectsMode added in v0.21.0

type ProjectsMode string

ProjectsMode is used specify which kinds of projects to show for a repository

const (
	// ProjectsModeRepo only allow repo-level projects
	ProjectsModeRepo ProjectsMode = "repo"
	// ProjectsModeOwner only allow owner projects
	ProjectsModeOwner ProjectsMode = "owner"
	// ProjectsModeAll only allow all projects
	ProjectsModeAll ProjectsMode = "all"
)

type PublicKey

type PublicKey struct {
	ID          int64     `json:"id"`
	Key         string    `json:"key"`
	URL         string    `json:"url,omitempty"`
	Title       string    `json:"title,omitempty"`
	Fingerprint string    `json:"fingerprint,omitempty"`
	Created     time.Time `json:"created_at,omitempty"`
	Updated     time.Time `json:"last_used_at,omitempty"`
	Owner       *User     `json:"user,omitempty"`
	ReadOnly    bool      `json:"read_only,omitempty"`
	KeyType     string    `json:"key_type,omitempty"`
}

PublicKey publickey is a user key to push code to repository

type PullRequest

type PullRequest struct {
	ID                      int64      `json:"id"`
	URL                     string     `json:"url"`
	Index                   int64      `json:"number"`
	Poster                  *User      `json:"user"`
	Title                   string     `json:"title"`
	Body                    string     `json:"body"`
	Labels                  []*Label   `json:"labels"`
	Milestone               *Milestone `json:"milestone"`
	Assignee                *User      `json:"assignee"`
	Assignees               []*User    `json:"assignees"`
	RequestedReviewers      []*User    `json:"requested_reviewers"`
	RequestedReviewersTeams []*Team    `json:"requested_reviewers_teams"`
	State                   StateType  `json:"state"`
	Draft                   bool       `json:"draft"`
	IsLocked                bool       `json:"is_locked"`
	Comments                int        `json:"comments"`
	ReviewComments          int        `json:"review_comments,omitempty"`

	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"`
	AllowMaintainerEdit bool       `json:"allow_maintainer_edit"`

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

	Additions    *int `json:"additions,omitempty"`
	Deletions    *int `json:"deletions,omitempty"`
	ChangedFiles *int `json:"changed_files,omitempty"`
	PinOrder     int  `json:"pin_order"`
}

PullRequest represents a pull request

type PullRequestDiffOptions added in v0.16.0

type PullRequestDiffOptions struct {
	// Include binary file changes when requesting a .diff
	Binary bool
}

PullRequestDiffOptions options for GET /repos/<owner>/<repo>/pulls/<idx>.[diff|patch]

func (PullRequestDiffOptions) QueryEncode added in v0.16.0

func (o PullRequestDiffOptions) QueryEncode() string

QueryEncode converts the options to a query string

type PullRequestMeta

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

PullRequestMeta PR info if an issue is a PR

type PullReview added in v0.12.0

type PullReview struct {
	ID           int64           `json:"id"`
	Reviewer     *User           `json:"user"`
	ReviewerTeam *Team           `json:"team"`
	State        ReviewStateType `json:"state"`
	Body         string          `json:"body"`
	CommitID     string          `json:"commit_id"`
	// Stale indicates if the pull has changed since the review
	Stale bool `json:"stale"`
	// Official indicates if the review counts towards the required approval limit, if PR base is a protected branch
	Official          bool      `json:"official"`
	Dismissed         bool      `json:"dismissed"`
	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 added in v0.12.0

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

	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 PullReviewRequestOptions added in v0.14.0

type PullReviewRequestOptions struct {
	Reviewers     []string `json:"reviewers"`
	TeamReviewers []string `json:"team_reviewers"`
}

PullReviewRequestOptions are options to add or remove pull review requests

type PushMirrorResponse added in v0.17.1

type PushMirrorResponse struct {
	Created       string `json:"created"`
	Interval      string `json:"interval"`
	LastError     string `json:"last_error"`
	LastUpdate    string `json:"last_update"`
	RemoteAddress string `json:"remote_address"`
	RemoteName    string `json:"remote_name"`
	RepoName      string `json:"repo_name"`
	SyncONCommit  bool   `json:"sync_on_commit"`
}

PushMirrorResponse returns a git push mirror

type PutRepoActionsVariable added in v0.20.0

type PutRepoActionsVariable struct {
	Value string `json:"value"`
	Name  string `json:"name"`
}

PutActionsVariable represents body for updating a action variable.

type Reaction

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

Reaction contain one reaction

type Reference

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

Reference represents a Git reference.

type RegistrationToken added in v0.24.0

type RegistrationToken struct {
	Token string `json:"token"`
}

RegistrationToken is returned when creating an Actions runner registration token.

type Release

type Release struct {
	ID           int64         `json:"id"`
	TagName      string        `json:"tag_name"`
	Target       string        `json:"target_commitish"`
	Title        string        `json:"name"`
	Note         string        `json:"body"`
	URL          string        `json:"url"`
	HTMLURL      string        `json:"html_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 RenameOrgOption added in v0.23.0

type RenameOrgOption struct {
	NewName string `json:"new_name"`
}

RenameOrgOption options for renaming an organization

type RenameRepoBranchOption added in v0.24.0

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

RenameRepoBranchOption renames a repository branch.

func (RenameRepoBranchOption) Validate added in v0.24.0

func (opt RenameRepoBranchOption) Validate() error

Validate checks whether the rename payload is valid.

type RenameUserOption added in v0.23.0

type RenameUserOption struct {
	NewUsername string `json:"new_username"`
}

RenameUserOption options for renaming a user

type RepoActionVariable added in v0.20.0

type RepoActionVariable struct {
	OwnerID int64  `json:"owner_id"`
	RepoID  int64  `json:"repo_id"`
	Name    string `json:"name"`
	Value   string `json:"data"`
}

RepoActionVariable represents a action variable

type RepoCommit

type RepoCommit struct {
	URL          string                     `json:"url"`
	Author       *CommitUser                `json:"author"`
	Committer    *CommitUser                `json:"committer"`
	Message      string                     `json:"message"`
	Tree         *CommitMeta                `json:"tree"`
	Verification *PayloadCommitVerification `json:"verification"`
}

RepoCommit contains information of a commit in the context of a repository.

type RepoTransfer added in v0.23.1

type RepoTransfer struct {
	Doer      *User   `json:"doer"`
	Recipient *User   `json:"recipient"`
	Teams     []*Team `json:"teams"`
}

RepoTransfer represents a pending repository transfer

type RepoType added in v0.13.0

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 RepoUnitType added in v0.15.0

type RepoUnitType string

RepoUnitType represent all unit types of a repo gitea currently offer

const (
	// RepoUnitCode represent file view of a repository
	RepoUnitCode RepoUnitType = "repo.code"
	// RepoUnitIssues represent issues of a repository
	RepoUnitIssues RepoUnitType = "repo.issues"
	// RepoUnitPulls represent pulls of a repository
	RepoUnitPulls RepoUnitType = "repo.pulls"
	// RepoUnitExtIssues represent external issues of a repository
	RepoUnitExtIssues RepoUnitType = "repo.ext_issues"
	// RepoUnitWiki represent wiki of a repository
	RepoUnitWiki RepoUnitType = "repo.wiki"
	// RepoUnitExtWiki represent external wiki of a repository
	RepoUnitExtWiki RepoUnitType = "repo.ext_wiki"
	// RepoUnitReleases represent releases of a repository
	RepoUnitReleases RepoUnitType = "repo.releases"
	// RepoUnitProjects represent projects of a repository
	RepoUnitProjects RepoUnitType = "repo.projects"
	// RepoUnitPackages represents packages of a repository
	RepoUnitPackages RepoUnitType = "repo.packages"
	// RepoUnitActions represents actions of a repository
	RepoUnitActions RepoUnitType = "repo.actions"
)

type Repository

type Repository struct {
	ID                            int64            `json:"id"`
	Owner                         *User            `json:"owner"`
	Name                          string           `json:"name"`
	FullName                      string           `json:"full_name"`
	Description                   string           `json:"description"`
	Empty                         bool             `json:"empty"`
	Private                       bool             `json:"private"`
	Fork                          bool             `json:"fork"`
	Template                      bool             `json:"template"`
	Parent                        *Repository      `json:"parent"`
	Mirror                        bool             `json:"mirror"`
	Size                          int              `json:"size"`
	Language                      string           `json:"language"`
	LanguagesURL                  string           `json:"languages_url"`
	HTMLURL                       string           `json:"html_url"`
	URL                           string           `json:"url"`
	Link                          string           `json:"link"`
	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"`
	OpenPulls                     int              `json:"open_pr_counter"`
	Releases                      int              `json:"release_counter"`
	DefaultBranch                 string           `json:"default_branch"`
	Archived                      bool             `json:"archived"`
	ArchivedAt                    time.Time        `json:"archived_at"`
	Created                       time.Time        `json:"created_at"`
	Updated                       time.Time        `json:"updated_at"`
	Permissions                   *Permission      `json:"permissions,omitempty"`
	HasIssues                     bool             `json:"has_issues"`
	HasCode                       bool             `json:"has_code"`
	InternalTracker               *InternalTracker `json:"internal_tracker,omitempty"`
	ExternalTracker               *ExternalTracker `json:"external_tracker,omitempty"`
	HasWiki                       bool             `json:"has_wiki"`
	ExternalWiki                  *ExternalWiki    `json:"external_wiki,omitempty"`
	HasPullRequests               bool             `json:"has_pull_requests"`
	HasProjects                   bool             `json:"has_projects"`
	HasReleases                   bool             `json:"has_releases,omitempty"`
	HasPackages                   bool             `json:"has_packages,omitempty"`
	HasActions                    bool             `json:"has_actions,omitempty"`
	IgnoreWhitespaceConflicts     bool             `json:"ignore_whitespace_conflicts"`
	AllowFastForwardOnlyMerge     bool             `json:"allow_fast_forward_only_merge"`
	AllowMerge                    bool             `json:"allow_merge_commits"`
	AllowRebase                   bool             `json:"allow_rebase"`
	AllowRebaseMerge              bool             `json:"allow_rebase_explicit"`
	AllowRebaseUpdate             bool             `json:"allow_rebase_update"`
	AllowSquash                   bool             `json:"allow_squash_merge"`
	DefaultAllowMaintainerEdit    bool             `json:"default_allow_maintainer_edit"`
	AvatarURL                     string           `json:"avatar_url"`
	Internal                      bool             `json:"internal"`
	MirrorInterval                string           `json:"mirror_interval"`
	MirrorUpdated                 time.Time        `json:"mirror_updated,omitempty"`
	DefaultMergeStyle             MergeStyle       `json:"default_merge_style"`
	ProjectsMode                  *ProjectsMode    `json:"projects_mode"`
	DefaultDeleteBranchAfterMerge bool             `json:"default_delete_branch_after_merge"`
	ObjectFormatName              string           `json:"object_format_name"`
	Topics                        []string         `json:"topics"`
	Licenses                      []string         `json:"licenses"`
	RepoTransfer                  *RepoTransfer    `json:"repo_transfer,omitempty"`
}

Repository represents a repository

type RepositoryMeta added in v0.11.1

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 added in v0.13.0

type Response struct {
	*http.Response

	FirstPage int
	PrevPage  int
	NextPage  int
	LastPage  int
}

Response represents the gitea response

type ReviewStateType added in v0.12.0

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 RunDetails added in v0.24.0

type RunDetails struct {
	WorkflowRunID int64  `json:"workflow_run_id"`
	RunURL        string `json:"run_url"`
	HTMLURL       string `json:"html_url"`
}

RunDetails contains the workflow run identifiers returned by workflow dispatch.

type SearchAdminEmailsOptions added in v0.23.0

type SearchAdminEmailsOptions struct {
	ListOptions
	Query string `json:"q,omitempty"`
}

SearchAdminEmailsOptions options for searching emails

type SearchRepoOptions added in v0.11.1

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 added in v0.11.1

func (opt *SearchRepoOptions) QueryEncode() string

QueryEncode turns options into querystring argument

type SearchTeamsOptions added in v0.16.0

type SearchTeamsOptions struct {
	ListOptions
	Query              string
	IncludeDescription bool
}

SearchTeamsOptions options for searching teams.

type SearchUsersOption added in v0.11.1

type SearchUsersOption struct {
	ListOptions
	KeyWord string
	UID     int64
}

SearchUsersOption options for SearchUsers

func (*SearchUsersOption) QueryEncode added in v0.11.1

func (opt *SearchUsersOption) QueryEncode() string

QueryEncode turns options into querystring argument

type Secret added in v0.16.0

type Secret struct {
	// the secret's name
	Name string `json:"name"`
	// the secret's data
	Data string `json:"data"`
	// the secret's description
	Description string `json:"description"`
	// Date and Time of secret creation
	Created time.Time `json:"created_at"`
}

type StateType

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

type Status struct {
	ID          int64       `json:"id"`
	State       StatusState `json:"status"`
	TargetURL   string      `json:"target_url"`
	Description string      `json:"description"`
	URL         string      `json:"url"`
	Context     string      `json:"context"`
	Creator     *User       `json:"creator"`
	Created     time.Time   `json:"created_at"`
	Updated     time.Time   `json:"updated_at"`
}

Status holds a single Status of a single Commit

type StatusState

type StatusState string

StatusState holds the state of a Status It can be "pending", "success", "error", "failure", and "warning"

const (
	// StatusPending is for when the Status is Pending
	StatusPending StatusState = "pending"
	// StatusSuccess is for when the Status is Success
	StatusSuccess StatusState = "success"
	// StatusError is for when the Status is Error
	StatusError StatusState = "error"
	// StatusFailure is for when the Status is Failure
	StatusFailure StatusState = "failure"
	// StatusWarning is for when the Status is Warning
	StatusWarning StatusState = "warning"
)

type StopWatch

type StopWatch struct {
	Created       time.Time `json:"created"`
	Seconds       int64     `json:"seconds"`
	Duration      string    `json:"duration"`
	IssueIndex    int64     `json:"issue_index"`
	IssueTitle    string    `json:"issue_title"`
	RepoOwnerName string    `json:"repo_owner_name"`
	RepoName      string    `json:"repo_name"`
}

StopWatch represents a running stopwatch of an issue / pr

type SubmitPullReviewOptions added in v0.12.0

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

SubmitPullReviewOptions are options to submit a pending pull review

func (SubmitPullReviewOptions) Validate added in v0.13.0

func (opt SubmitPullReviewOptions) Validate() error

Validate the SubmitPullReviewOptions struct

type Tag

type Tag struct {
	Name       string      `json:"name"`
	Message    string      `json:"message"`
	ID         string      `json:"id"`
	Commit     *CommitMeta `json:"commit"`
	ZipballURL string      `json:"zipball_url"`
	TarballURL string      `json:"tarball_url"`
}

Tag represents a repository tag

type TagProtection added in v0.21.0

type TagProtection struct {
	ID                 int64     `json:"id"`
	NamePattern        string    `json:"name_pattern"`
	WhitelistUsernames []string  `json:"whitelist_usernames"`
	WhitelistTeams     []string  `json:"whitelist_teams"`
	Created            time.Time `json:"created_at"`
	Updated            time.Time `json:"updated_at"`
}

TagProtection represents a tag protection for a repository

type Team

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"`
	Units                   []RepoUnitType    `json:"units"`
	UnitsMap                map[string]string `json:"units_map"`
}

Team represents a team in an organization

type TeamSearchResults added in v0.16.0

type TeamSearchResults struct {
	OK    bool    `json:"ok"`
	Error string  `json:"error"`
	Data  []*Team `json:"data"`
}

TeamSearchResults is the JSON struct that is returned from Team search API.

type TimelineComment added in v0.21.0

type TimelineComment 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"`
	Type             string     `json:"type"`
	Label            []*Label   `json:"label"`
	NewMilestone     *Milestone `json:"milestone"`
	OldMilestone     *Milestone `json:"old_milestone"`
	NewTitle         string     `json:"new_title"`
	OldTitle         string     `json:"old_title"`
}

Comment represents a comment on a commit or issue

type TopicResponse added in v0.24.0

type TopicResponse struct {
	ID        int64     `json:"id"`
	Name      string    `json:"topic_name"`
	RepoCount int       `json:"repo_count"`
	Created   time.Time `json:"created"`
	Updated   time.Time `json:"updated"`
}

TopicResponse represents a topic

type TopicSearchOptions added in v0.24.0

type TopicSearchOptions struct {
	ListOptions
	Query string `json:"q"` // query string
}

TopicSearchOptions options for searching topics

type TopicSearchResult added in v0.24.0

type TopicSearchResult struct {
	Topics []*TopicResponse `json:"topics"`
}

TopicSearchResult represents a topic search result

type TrackedTime

type TrackedTime struct {
	ID      int64     `json:"id"`
	Created time.Time `json:"created"`
	// Time in seconds
	Time int64 `json:"time"`
	// deprecated (only for backwards compatibility)
	UserID   int64  `json:"user_id"`
	UserName string `json:"user_name"`
	// deprecated (only for backwards compatibility)
	IssueID int64  `json:"issue_id"`
	Issue   *Issue `json:"issue"`
}

TrackedTime worked time for an issue / pr

type TransferRepoOption added in v0.11.1

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 TrustModel added in v0.13.2

type TrustModel string

TrustModel represent how git signatures are handled in a repository

const (
	// TrustModelDefault use TM set by global config
	TrustModelDefault TrustModel = "default"
	// TrustModelCollaborator gpg signature has to be owned by a repo collaborator
	TrustModelCollaborator TrustModel = "collaborator"
	// TrustModelCommitter gpg signature has to match committer
	TrustModelCommitter TrustModel = "committer"
	// TrustModelCollaboratorCommitter gpg signature has to match committer and owned by a repo collaborator
	TrustModelCollaboratorCommitter TrustModel = "collaboratorcommitter"
)

type UpdateActionVariableOption added in v0.24.0

type UpdateActionVariableOption struct {
	Name        string `json:"name"`
	Value       string `json:"value"`
	Description string `json:"description"`
}

UpdateActionVariableOption is used to update an Actions variable.

func (UpdateActionVariableOption) Validate added in v0.24.0

func (opt UpdateActionVariableOption) Validate() error

Validate checks whether the variable update payload is valid.

type UpdateFileOptions added in v0.12.0

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 UpdateRepoAvatarOption added in v0.23.0

type UpdateRepoAvatarOption struct {
	Image string `json:"image"` // base64 encoded image
}

UpdateRepoAvatarOption options for updating repository avatar

type UpdateRepoBranchOption added in v0.22.0

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

func (UpdateRepoBranchOption) Validate added in v0.22.0

func (opt UpdateRepoBranchOption) Validate() error

type UpdateRepoBranchRefOption added in v0.24.0

type UpdateRepoBranchRefOption struct {
	NewCommitID string `json:"new_commit_id"`
	OldCommitID string `json:"old_commit_id"`
	Force       bool   `json:"force"`
}

UpdateRepoBranchRefOption updates a branch ref to point to a new commit.

func (UpdateRepoBranchRefOption) Validate added in v0.24.0

func (opt UpdateRepoBranchRefOption) Validate() error

Validate checks whether the branch update payload is valid.

type UpdateUserAvatarOption added in v0.23.0

type UpdateUserAvatarOption struct {
	Image string `json:"image"` // base64 encoded image
}

UpdateUserAvatarOption options for updating user avatar

type User

type User struct {
	// the user's id
	ID int64 `json:"id"`
	// the user's username
	UserName string `json:"login"`
	// The login_name of non local users (e.g. LDAP / OAuth / SMTP)
	LoginName string `json:"login_name"`
	// The ID of the Authentication Source for non local users.
	SourceID int64 `json:"source_id"`
	// 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"`
	// URL to the user's profile
	HTMLURL string `json:"html_url"`
	// User locale
	Language string `json:"language"`
	// Is the user an administrator
	IsAdmin bool `json:"is_admin"`
	// Date and Time of last login
	LastLogin time.Time `json:"last_login"`
	// Date and Time of user creation
	Created time.Time `json:"created"`
	// Is user restricted
	Restricted bool `json:"restricted"`
	// Is user active
	IsActive bool `json:"active"`
	// Is user login prohibited
	ProhibitLogin bool `json:"prohibit_login"`
	// the user's location
	Location string `json:"location"`
	// the user's website
	Website string `json:"website"`
	// the user's description
	Description string `json:"description"`
	// User visibility level option
	Visibility VisibleType `json:"visibility"`

	// user counts
	FollowerCount    int `json:"followers_count"`
	FollowingCount   int `json:"following_count"`
	StarredRepoCount int `json:"starred_repos_count"`
}

User represents a user

type UserBadgeOption added in v0.23.0

type UserBadgeOption struct {
	BadgeSlugs []string `json:"badge_slugs"`
}

UserBadgeOption represents options for adding badges to a user

type UserHeatmapData added in v0.23.0

type UserHeatmapData struct {
	Timestamp     int64 `json:"timestamp"`
	Contributions int64 `json:"contributions"`
}

UserHeatmapData represents the data needed to create a heatmap

type UserSettings added in v0.15.0

type UserSettings struct {
	FullName      string `json:"full_name"`
	Website       string `json:"website"`
	Description   string `json:"description"`
	Location      string `json:"location"`
	Language      string `json:"language"`
	Theme         string `json:"theme"`
	DiffViewStyle string `json:"diff_view_style"`
	// Privacy
	HideEmail    bool `json:"hide_email"`
	HideActivity bool `json:"hide_activity"`
}

UserSettings represents user settings

type UserSettingsOptions added in v0.15.0

type UserSettingsOptions struct {
	FullName      *string `json:"full_name,omitempty"`
	Website       *string `json:"website,omitempty"`
	Description   *string `json:"description,omitempty"`
	Location      *string `json:"location,omitempty"`
	Language      *string `json:"language,omitempty"`
	Theme         *string `json:"theme,omitempty"`
	DiffViewStyle *string `json:"diff_view_style,omitempty"`
	// Privacy
	HideEmail    *bool `json:"hide_email,omitempty"`
	HideActivity *bool `json:"hide_activity,omitempty"`
}

UserSettingsOptions represents options to change user settings

type VerifyGPGKeyOption added in v0.23.0

type VerifyGPGKeyOption struct {
	// KeyID is the GPG key ID to verify
	KeyID string `json:"key_id"`
	// Signature is the ASCII-armored signature of the verification token
	Signature string `json:"armored_signature"`
}

VerifyGPGKeyOption options for verifying a GPG key

type VisibleType

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

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

type WikiCommit added in v0.23.0

type WikiCommit struct {
	ID       string      `json:"sha"`
	Message  string      `json:"message"`
	Author   *CommitUser `json:"author,omitempty"`
	Commiter *CommitUser `json:"commiter,omitempty"`
}

WikiCommit represents a wiki commit/revision

type WikiCommitList added in v0.23.0

type WikiCommitList struct {
	WikiCommits []*WikiCommit `json:"commits"`
	Count       int64         `json:"count"`
}

WikiCommitList represents a list of wiki commits

type WikiPage added in v0.23.0

type WikiPage struct {
	Title         string      `json:"title"`
	ContentBase64 string      `json:"content_base64"`
	CommitCount   int64       `json:"commit_count"`
	Sidebar       string      `json:"sidebar"`
	Footer        string      `json:"footer"`
	HTMLURL       string      `json:"html_url"`
	SubURL        string      `json:"sub_url"`
	LastCommit    *WikiCommit `json:"last_commit,omitempty"`
}

WikiPage represents a wiki page

type WikiPageMetaData added in v0.23.0

type WikiPageMetaData struct {
	Title      string      `json:"title"`
	HTMLURL    string      `json:"html_url"`
	SubURL     string      `json:"sub_url"`
	LastCommit *WikiCommit `json:"last_commit,omitempty"`
}

WikiPageMetaData represents metadata for a wiki page (without content)

Jump to

Keyboard shortcuts

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