Help us shape the future of Go! Take the 2026 Go Developer Survey

api

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoResult = errors.New("no result from remote server")
)

Functions

func Exec added in v0.5.0

func Exec(op string, remote *core.Remote, h func(p Provider) error) error

func Register added in v0.5.0

func Register(name string, creator ProviderCreator)

Types

type MergeOption

type MergeOption struct {
	Title string
	Body  string

	SourceBranch string
	TargetBranch string

	Upstream *Repository
}

type Provider

type Provider interface {
	Name() string
	SearchRepositories(group, query string) ([]*Repository, error)
	ListRepositories(group string) ([]*Repository, error)
	GetRepository(name string) (*Repository, error)

	GetMerge(repo *core.Repository, opts MergeOption) (string, error)
	CreateMerge(repo *core.Repository, opts MergeOption) (string, error)

	GetRelease(repo *core.Repository, tag string) (*Release, error)
	ListReleases(repo *core.Repository) ([]*Release, error)
	DownloadReleaseFile(repo *core.Repository, file *ReleaseFile) (io.ReadCloser, error)
}

func GetProvider added in v0.5.0

func GetProvider(remote *core.Remote) (Provider, error)

type ProviderCreator added in v0.5.0

type ProviderCreator func(*core.Remote) (Provider, error)

type Release added in v0.3.0

type Release struct {
	Name string
	Tag  string

	WebURL string

	Files []*ReleaseFile
}

type ReleaseFile added in v0.3.0

type ReleaseFile struct {
	ID any

	Name string

	Size int64
}

type Repository

type Repository struct {
	Name string

	Remote *core.Remote

	WebURL string

	DefaultBranch string

	Upstream *Repository

	Archived bool
}

func GetRepo added in v0.5.0

func GetRepo(remote *core.Remote, repo *core.Repository) (*Repository, error)

func SearchRepo added in v0.5.0

func SearchRepo(remote *core.Remote, query string) (*Repository, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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