gitea

package
v0.54.1 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gitea

type Gitea struct {
	RepositoryListing

	MergeTypes []scm.MergeType
	SSHAuth    bool
	// contains filtered or unexported fields
}

Gitea contain Gitea configuration

func New

func New(token, baseURL string, repoListing RepositoryListing, mergeTypes []scm.MergeType, sshAuth bool) (*Gitea, error)

New create a new Gitea client

func (*Gitea) ClosePullRequest

func (g *Gitea) ClosePullRequest(ctx context.Context, pullReq scm.PullRequest) error

ClosePullRequest closes a pull request

func (*Gitea) CreatePullRequest

func (g *Gitea) CreatePullRequest(ctx context.Context, repo scm.Repository, prRepo scm.Repository, newPR scm.NewPullRequest) (scm.PullRequest, error)

CreatePullRequest creates a pull request

func (*Gitea) ForkRepository added in v0.27.0

func (g *Gitea) ForkRepository(ctx context.Context, repo scm.Repository, newOwner string) (scm.Repository, error)

ForkRepository forks a GiteaRepository. If newOwner is empty, fork on the logged in user

func (*Gitea) GetOpenPullRequest added in v0.37.0

func (g *Gitea) GetOpenPullRequest(ctx context.Context, repo scm.Repository, branchName string) (scm.PullRequest, error)

GetOpenPullRequest gets a pull request for one specific repository

func (*Gitea) GetPullRequests

func (g *Gitea) GetPullRequests(ctx context.Context, branchName string) ([]scm.PullRequest, error)

GetPullRequests gets all pull requests of with a specific branch

func (*Gitea) GetRepositories

func (g *Gitea) GetRepositories(ctx context.Context) ([]scm.Repository, error)

GetRepositories fetches repositories from all sources (groups/user/specific repo)

func (*Gitea) MergePullRequest

func (g *Gitea) MergePullRequest(ctx context.Context, pullReq scm.PullRequest) error

MergePullRequest merges a pull request

func (*Gitea) UpdatePullRequest added in v0.50.0

func (g *Gitea) UpdatePullRequest(ctx context.Context, repo scm.Repository, pullReq scm.PullRequest, updatedPR scm.NewPullRequest) (scm.PullRequest, error)

UpdatePullRequest updates an existing pull request

type RepositoryListing

type RepositoryListing struct {
	Organizations []string
	Users         []string
	Repositories  []RepositoryReference
	Topics        []string
	SkipForks     bool
}

RepositoryListing contains information about which repositories that should be fetched

type RepositoryReference

type RepositoryReference struct {
	OwnerName string
	Name      string
}

RepositoryReference contains information to be able to reference a repository

func ParseRepositoryReference

func ParseRepositoryReference(val string) (RepositoryReference, error)

ParseRepositoryReference parses a repository reference from the format "ownerName/repoName"

Jump to

Keyboard shortcuts

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