githosting

package
v0.3.0-rc1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrProviderNotSupported = errors.New("no remote provider found")

Functions

This section is empty.

Types

type LabelStore

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

func NewLabelStore

func NewLabelStore(providers ProviderMap) *LabelStore

func (*LabelStore) EnsureLabelsForRepository

func (s *LabelStore) EnsureLabelsForRepository(repository *domain.GitRepository, labels domain.LabelSet) error

func (*LabelStore) FetchLabelsForRepository

func (s *LabelStore) FetchLabelsForRepository(repository *domain.GitRepository) (domain.LabelSet, error)

func (*LabelStore) RemoveLabelsFromRepository

func (s *LabelStore) RemoveLabelsFromRepository(repository *domain.GitRepository, labels domain.LabelSet) error

type ProviderMap

type ProviderMap map[RemoteProvider]Remote

type PullRequestStore

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

func NewPullRequestStore

func NewPullRequestStore(providers ProviderMap) *PullRequestStore

func (*PullRequestStore) EnsurePullRequest

func (p *PullRequestStore) EnsurePullRequest(repository *domain.GitRepository) error

func (*PullRequestStore) FindMatchingPullRequest

func (p *PullRequestStore) FindMatchingPullRequest(repository *domain.GitRepository) (*domain.PullRequest, error)

type Remote

type Remote interface {
	// FetchLabels returns the domain.LabelSet found for the given repository.
	// An empty set without error is returned if none found.
	FetchLabels(repository *domain.GitRepository) (domain.LabelSet, error)

	DeleteLabels(repository *domain.GitRepository, labels domain.LabelSet) error

	EnsureLabels(repository *domain.GitRepository, labels domain.LabelSet) error

	// FindPullRequest returns a remote-specific domain.PullRequest or nil if none matching the branches exist remotely.
	FindPullRequest(repository *domain.GitRepository) (*domain.PullRequest, error)

	// EnsurePullRequest creates or updates the given domain.PullRequest.
	// The same rules as domain.PullRequestStore:EnsurePullRequest applies.
	EnsurePullRequest(repository *domain.GitRepository, pr *domain.PullRequest) error

	// HasSupportFor returns true if the remote implementation supports interacting with the remote API for the given repository URL.
	HasSupportFor(url *domain.GitURL) bool
}

type RemoteProvider

type RemoteProvider string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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