Documentation ¶
Index ¶
- func New(opts Opts) (remote.Remote, error)
- type Gitea
- func (c *Gitea) Activate(ctx context.Context, u *model.User, r *model.Repo, link string) error
- func (c *Gitea) Auth(ctx context.Context, token, secret string) (string, error)
- func (c *Gitea) Branches(ctx context.Context, u *model.User, r *model.Repo) ([]string, error)
- func (c *Gitea) Deactivate(ctx context.Context, u *model.User, r *model.Repo, link string) error
- func (c *Gitea) Dir(ctx context.Context, u *model.User, r *model.Repo, b *model.Build, f string) ([]*remote.FileMeta, error)
- func (c *Gitea) File(ctx context.Context, u *model.User, r *model.Repo, b *model.Build, f string) ([]byte, error)
- func (c *Gitea) Hook(ctx context.Context, r *http.Request) (*model.Repo, *model.Build, error)
- func (c *Gitea) Login(ctx context.Context, w http.ResponseWriter, req *http.Request) (*model.User, error)
- func (c *Gitea) Netrc(u *model.User, r *model.Repo) (*model.Netrc, error)
- func (c *Gitea) Perm(ctx context.Context, u *model.User, r *model.Repo) (*model.Perm, error)
- func (c *Gitea) Refresh(ctx context.Context, user *model.User) (bool, error)
- func (c *Gitea) Repo(ctx context.Context, u *model.User, owner, name string) (*model.Repo, error)
- func (c *Gitea) Repos(ctx context.Context, u *model.User) ([]*model.Repo, error)
- func (c *Gitea) Status(ctx context.Context, user *model.User, repo *model.Repo, build *model.Build, ...) error
- func (c *Gitea) TeamPerm(u *model.User, org string) (*model.Perm, error)
- func (c *Gitea) Teams(ctx context.Context, u *model.User) ([]*model.Team, error)
- type Opts
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Gitea ¶
func (*Gitea) Activate ¶
Activate activates the repository by registering post-commit hooks with the Gitea repository.
func (*Gitea) Auth ¶
Auth uses the Gitea oauth2 access token and refresh token to authenticate a session and return the Gitea account login.
func (*Gitea) Deactivate ¶
Deactivate deactives the repository be removing repository push hooks from the Gitea repository.
func (*Gitea) File ¶
func (c *Gitea) File(ctx context.Context, u *model.User, r *model.Repo, b *model.Build, f string) ([]byte, error)
File fetches the file from the Gitea repository and returns its contents.
func (*Gitea) Hook ¶
Hook parses the incoming Gitea hook and returns the Repository and Build details. If the hook is unsupported nil values are returned.
func (*Gitea) Login ¶
func (c *Gitea) Login(ctx context.Context, w http.ResponseWriter, req *http.Request) (*model.User, error)
Login authenticates an account with Gitea using basic authentication. The Gitea account details are returned when the user is successfully authenticated.
func (*Gitea) Netrc ¶
Netrc returns a netrc file capable of authenticating Gitea requests and cloning Gitea repositories. The netrc will use the global machine account when configured.
func (*Gitea) Refresh ¶
Refresh refreshes the Gitea oauth2 access token. If the token is refreshed the user is updated and a true value is returned.
func (*Gitea) Repos ¶
Repos returns a list of all repositories for the Gitea account, including organization repositories.
func (*Gitea) Status ¶
func (c *Gitea) Status(ctx context.Context, user *model.User, repo *model.Repo, build *model.Build, proc *model.Proc) error
Status is supported by the Gitea driver.