gitea

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminClient

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

AdminClient is the struct holding information about gitea client Implements GitAdminClient interface

func NewAdminClient

func NewAdminClient(logger *log.Logger) (*AdminClient, error)

NewAdminClient creates a new gitea client and performs authentication from the credentials provided as env variables

func (*AdminClient) AddRepoTopics added in v0.2.1

func (gac *AdminClient) AddRepoTopics(org, name string, labels []string) error

AddRepoTopics adds topics to given repository

func (*AdminClient) CreateProject added in v0.2.1

func (gac *AdminClient) CreateProject(name, desc string, ignoreExisting bool) (*domain.Project, error)

CreateProject creates a Project (= implemented as Organization in git). If ignoreExisting argument is true, the call will not fail when a project with same name already exists.

func (*AdminClient) CreateRepo added in v0.2.1

func (gac *AdminClient) CreateRepo(c *domain.Codeset) error

CreateRepo creates a git repository with given name under given org

func (*AdminClient) CreateRepoWebhook

func (gac *AdminClient) CreateRepoWebhook(org, name string, listenerURL *string) (*int64, error)

CreateRepoWebhook creates webhook for given repository and wire it to the listenerURL

func (*AdminClient) CreateUser added in v0.2.1

func (gac *AdminClient) CreateUser(org string) (*string, *string, error)

CreateUser creates user assigned to current project

func (*AdminClient) DeleteProject added in v0.2.1

func (gac *AdminClient) DeleteProject(org string) error

DeleteProject deletes a project

func (*AdminClient) DeleteRepoWebhook added in v0.1.0

func (gac *AdminClient) DeleteRepoWebhook(org, name string, hookID *int64) error

DeleteRepoWebhook deletes a webhook for given repository

func (*AdminClient) DeleteRepository

func (gac *AdminClient) DeleteRepository(org, name string) error

DeleteRepository delete a repository

func (*AdminClient) GetGiteaURL added in v0.2.1

func (gac *AdminClient) GetGiteaURL() (string, error)

GetGiteaURL returns the gitea url

func (*AdminClient) GetProject added in v0.2.1

func (gac *AdminClient) GetProject(name string) (*domain.Project, error)

GetProject retrieves a project by its name

func (*AdminClient) GetProjects added in v0.2.1

func (gac *AdminClient) GetProjects() ([]*domain.Project, error)

GetProjects retrieves all projects (orgs)

func (*AdminClient) GetReposForOrg added in v0.2.1

func (gac *AdminClient) GetReposForOrg(org string, label *string) ([]*domain.Codeset, error)

GetReposForOrg retrieves all repositories for given project, can be filtered by label

func (*AdminClient) GetRepositories

func (gac *AdminClient) GetRepositories(org, label *string) ([]*domain.Codeset, error)

GetRepositories retrieves all repositories, can be filtered by project(org) and label

func (*AdminClient) GetRepository

func (gac *AdminClient) GetRepository(org, name string) (*domain.Codeset, error)

GetRepository retrieves information about the repository

func (*AdminClient) PrepareRepository

func (gac *AdminClient) PrepareRepository(code *domain.Codeset, listenerURL *string) (*string, *string, error)

PrepareRepository prepares the org, repository, and creates a user

type Client

type Client interface {
	GetOrg(orgname string) (*gitea.Organization, *gitea.Response, error)
	CreateOrg(gitea.CreateOrgOption) (*gitea.Organization, *gitea.Response, error)
	GetUserInfo(string) (*gitea.User, *gitea.Response, error)
	AdminCreateUser(gitea.CreateUserOption) (*gitea.User, *gitea.Response, error)
	AdminDeleteUser(string) (*gitea.Response, error)
	ListOrgTeams(string, gitea.ListTeamsOptions) ([]*gitea.Team, *gitea.Response, error)
	AddTeamMember(int64, string) (*gitea.Response, error)
	ListTeamMembers(int64, gitea.ListTeamMembersOptions) ([]*gitea.User, *gitea.Response, error)
	GetRepo(string, string) (*gitea.Repository, *gitea.Response, error)
	CreateOrgRepo(string, gitea.CreateRepoOption) (*gitea.Repository, *gitea.Response, error)
	AddRepoTopic(string, string, string) (*gitea.Response, error)
	ListRepoHooks(string, string, gitea.ListHooksOptions) ([]*gitea.Hook, *gitea.Response, error)
	ListOrgRepos(string, gitea.ListOrgReposOptions) ([]*gitea.Repository, *gitea.Response, error)
	CreateRepoHook(string, string, gitea.CreateHookOption) (*gitea.Hook, *gitea.Response, error)
	DeleteRepoHook(string, string, int64) (*gitea.Response, error)
	ListRepoTopics(string, string, gitea.ListRepoTopicsOptions) ([]string, *gitea.Response, error)
	ListMyOrgs(gitea.ListOrgsOptions) ([]*gitea.Organization, *gitea.Response, error)
	ListUserOrgs(string, gitea.ListOrgsOptions) ([]*gitea.Organization, *gitea.Response, error)
	DeleteRepo(string, string) (*gitea.Response, error)
	DeleteOrg(string) (*gitea.Response, error)
	DeleteOrgMembership(org, user string) (*gitea.Response, error)
}

Client describes the interface of Gitea Client

Jump to

Keyboard shortcuts

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