client

package
v0.167.0 Latest Latest
Warning

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

Go to latest
Published: May 31, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Overview

Package client contains the client implementations for several providers.

Index

Constants

View Source
const DefaultGitHubDownloadURL = "https://github.com"
View Source
const DefaultGitLabDownloadURL = "https://gitlab.com"

Variables

This section is empty.

Functions

func IsNotImplementedErr added in v0.139.0

func IsNotImplementedErr(err error) bool

IsNotImplementedErr returns true if given error is a NotImplementedError.

Types

type Client

type Client interface {
	CloseMilestone(ctx *context.Context, repo Repo, title string) (err error)
	CreateRelease(ctx *context.Context, body string) (releaseID string, err error)
	ReleaseURLTemplate(ctx *context.Context) (string, error)
	CreateFile(ctx *context.Context, commitAuthor config.CommitAuthor, repo Repo, content []byte, path, message string) (err error)
	Upload(ctx *context.Context, releaseID string, artifact *artifact.Artifact, file *os.File) (err error)
}

Client interface.

func New added in v0.112.0

func New(ctx *context.Context) (Client, error)

New creates a new client depending on the token type.

func NewGitHub

func NewGitHub(ctx *context.Context, token string) (Client, error)

NewGitHub returns a github client implementation.

func NewGitLab added in v0.112.0

func NewGitLab(ctx *context.Context, token string) (Client, error)

NewGitLab returns a gitlab client implementation.

func NewGitea added in v0.117.0

func NewGitea(ctx *context.Context, token string) (Client, error)

NewGitea returns a gitea client implementation.

func NewWithToken added in v0.139.0

func NewWithToken(ctx *context.Context, token string) (Client, error)

type ErrNoMilestoneFound added in v0.140.0

type ErrNoMilestoneFound struct {
	Title string
}

ErrNoMilestoneFound is an error when no milestone is found.

func (ErrNoMilestoneFound) Error added in v0.140.0

func (e ErrNoMilestoneFound) Error() string

type Info

type Info struct {
	Description string
	Homepage    string
	URL         string
}

Info of the repository.

type NotImplementedError added in v0.139.0

type NotImplementedError struct {
	TokenType context.TokenType
}

NotImplementedError happens when trying to use something a client does not implement.

func (NotImplementedError) Error added in v0.139.0

func (e NotImplementedError) Error() string

type Repo added in v0.139.0

type Repo struct {
	Owner string
	Name  string
}

func RepoFromRef added in v0.139.0

func RepoFromRef(ref config.RepoRef) Repo

func (Repo) String added in v0.139.0

func (r Repo) String() string

type RetriableError added in v0.130.0

type RetriableError struct {
	Err error
}

RetriableError is an error that will cause the action to be retried.

func (RetriableError) Error added in v0.130.0

func (e RetriableError) Error() string

Jump to

Keyboard shortcuts

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