gitea

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// gitea corrently doesn't have any auth scope
	GiteaOauth2Scopes = []string{""}
)

Functions

This section is empty.

Types

type Client

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

func New

func New(opts Opts) (*Client, error)

func NewWithBasicAuth added in v0.8.0

func NewWithBasicAuth(opts Opts) (*Client, error)
func (c *Client) BranchLink(repoInfo *gitsource.RepoInfo, branch string) string

func (*Client) BranchRef

func (c *Client) BranchRef(branch string) string
func (c *Client) CommitLink(repoInfo *gitsource.RepoInfo, commitSHA string) string

func (*Client) CreateAccessToken added in v0.8.0

func (c *Client) CreateAccessToken(tokenName string) (string, error)

func (*Client) CreateCommitStatus

func (c *Client) CreateCommitStatus(repopath, commitSHA string, status gitsource.CommitStatus, targetURL, description, context string) (bool, error)

func (*Client) CreateDeployKey

func (c *Client) CreateDeployKey(repopath, title, pubKey string, readonly bool) error

func (*Client) CreateRepoWebhook

func (c *Client) CreateRepoWebhook(repopath, url, secret string) error

func (*Client) DeleteDeployKey

func (c *Client) DeleteDeployKey(repopath, title string) error

func (*Client) DeleteRepoWebhook

func (c *Client) DeleteRepoWebhook(repopath, u string) error

func (*Client) GetCommit

func (c *Client) GetCommit(repopath, commitSHA string) (*gitsource.Commit, error)

func (*Client) GetFile

func (c *Client) GetFile(repopath, commit, file string) ([]byte, error)

func (*Client) GetRef

func (c *Client) GetRef(repopath, ref string) (*gitsource.Ref, error)

func (*Client) GetRepoInfo

func (c *Client) GetRepoInfo(repopath string) (*gitsource.RepoInfo, error)

func (*Client) GetUserInfo

func (c *Client) GetUserInfo() (*gitsource.UserInfo, error)

func (*Client) ListUserRepos

func (c *Client) ListUserRepos() ([]*gitsource.RepoInfo, error)

func (*Client) ParseWebhook

func (c *Client) ParseWebhook(r *http.Request, secret string) (*types.WebhookData, error)
func (c *Client) PullRequestLink(repoInfo *gitsource.RepoInfo, prID string) string

func (*Client) PullRequestRef

func (c *Client) PullRequestRef(prID string) string

func (*Client) RefType

func (c *Client) RefType(ref string) (gitsource.RefType, string, error)
func (c *Client) TagLink(repoInfo *gitsource.RepoInfo, tag string) string

func (*Client) TagRef

func (c *Client) TagRef(tag string) string

func (*Client) UpdateDeployKey

func (c *Client) UpdateDeployKey(repopath, title, pubKey string, readonly bool) error

type Oauth2Client added in v0.8.0

type Oauth2Client struct {
	APIURL string
	// contains filtered or unexported fields
}

func NewOauth2Client added in v0.8.0

func NewOauth2Client(opts Oauth2Opts) (*Oauth2Client, error)

func (*Oauth2Client) GetOauth2AuthorizationURL added in v0.8.0

func (c *Oauth2Client) GetOauth2AuthorizationURL(callbackURL, state string) (string, error)

func (*Oauth2Client) RefreshOauth2Token added in v0.8.0

func (c *Oauth2Client) RefreshOauth2Token(refreshToken string) (*oauth2.Token, error)

func (*Oauth2Client) RequestOauth2Token added in v0.8.0

func (c *Oauth2Client) RequestOauth2Token(callbackURL, code string) (*oauth2.Token, error)

type Oauth2Opts added in v0.8.0

type Oauth2Opts struct {
	APIURL         string
	SkipVerify     bool
	Oauth2ClientID string
	Oauth2Secret   string
}

type Opts

type Opts struct {
	APIURL     string
	SkipVerify bool
	UserName   string
	Password   string
	Token      string
}

Jump to

Keyboard shortcuts

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