Documentation
¶
Overview ¶
Package client contains the client implementations for several providers.
Index ¶
- Constants
- Variables
- type Client
- type ErrNoMilestoneFound
- type GitHubClient
- type Info
- type Mock
- func (c *Mock) Changelog(ctx *context.Context, repo Repo, prev, current string) (string, error)
- func (c *Mock) CloseMilestone(ctx *context.Context, repo Repo, title string) error
- func (c *Mock) CreateFile(ctx *context.Context, commitAuthor config.CommitAuthor, repo Repo, ...) error
- func (c *Mock) CreateRelease(ctx *context.Context, body string) (string, error)
- func (c *Mock) GenerateReleaseNotes(ctx *context.Context, repo Repo, prev, current string) (string, error)
- func (c *Mock) GetDefaultBranch(ctx *context.Context, repo Repo) (string, error)
- func (c *Mock) ReleaseURLTemplate(ctx *context.Context) (string, error)
- func (c *Mock) Upload(ctx *context.Context, releaseID string, artifact *artifact.Artifact, ...) error
- type Repo
- type RetriableError
Constants ¶
View Source
const DefaultGitHubDownloadURL = "https://github.com"
View Source
const DefaultGitLabDownloadURL = "https://gitlab.com"
Variables ¶
View Source
var ErrNotImplemented = fmt.Errorf("not implemented")
ErrNotImplemented is returned when a client does not implement certain feature.
Functions ¶
This section is empty.
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)
GetDefaultBranch(ctx *context.Context, repo Repo) (string, error)
Changelog(ctx *context.Context, repo Repo, prev, current string) (string, error)
}
Client interface.
type ErrNoMilestoneFound ¶
type ErrNoMilestoneFound struct {
Title string
}
ErrNoMilestoneFound is an error when no milestone is found.
func (ErrNoMilestoneFound) Error ¶
func (e ErrNoMilestoneFound) Error() string
type GitHubClient ¶
type GitHubClient interface {
Client
GenerateReleaseNotes(ctx *context.Context, repo Repo, prev, current string) (string, error)
}
GitHubClient is the client with GitHub-only features.
type Mock ¶
type Mock struct {
CreatedFile bool
Content string
Path string
FailToCreateRelease bool
FailToUpload bool
CreatedRelease bool
UploadedFile bool
UploadedFileNames []string
UploadedFilePaths map[string]string
FailFirstUpload bool
Lock sync.Mutex
ClosedMilestone string
FailToCloseMilestone bool
Changes string
ReleaseNotes string
}
func (*Mock) CloseMilestone ¶
func (*Mock) CreateFile ¶
func (*Mock) CreateRelease ¶
func (*Mock) GenerateReleaseNotes ¶
func (*Mock) GetDefaultBranch ¶
func (*Mock) ReleaseURLTemplate ¶
type Repo ¶
func RepoFromRef ¶
type RetriableError ¶
type RetriableError struct {
Err error
}
RetriableError is an error that will cause the action to be retried.
func (RetriableError) Error ¶
func (e RetriableError) Error() string
Click to show internal directories.
Click to hide internal directories.