Documentation ¶
Overview ¶
Package github provides Installer plugin installer.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotGithub indicates the url is not github. ErrNotGithub = errors.New("not a github url") // ErrMissingOwner indicates that there is no owner in the url. ErrMissingOwner = errors.New("missing github owner") // ErrMissingRepository indicates that there is no repository in the url. ErrMissingRepository = errors.New("missing github repository") )
View Source
var ErrArtifactNotFound = errors.New("artifact not found")
ErrArtifactNotFound indicates that the artifact is not found.
Functions ¶
func RegisterInstaller ¶ added in v0.1.2
func RegisterInstaller(options ...Option)
RegisterInstaller registers the installer.
Types ¶
type Installer ¶
type Installer struct {
// contains filtered or unexported fields
}
Installer installs plugin from github.
func NewInstaller ¶
NewInstaller initiates a new github installer.
func (*Installer) Install ¶
Install installs the plugin. The installer will download the archive or binary from github, then uses the filesystem installers to install the plugin.
func (*Installer) WithService ¶
func (i *Installer) WithService(service RepositoryService) *Installer
WithService sets the repository service.
type Option ¶
type Option func(i *Installer)
Option is option to configure Installer.
func WithService ¶
func WithService(service RepositoryService) Option
WithService sets the repository service.
type RepositoryService ¶
type RepositoryService interface { DownloadContents(ctx context.Context, owner, repo, filepath string, opts *github.RepositoryContentGetOptions) (io.ReadCloser, *github.Response, error) GetLatestRelease(ctx context.Context, owner, repo string) (*github.RepositoryRelease, *github.Response, error) GetReleaseByTag(ctx context.Context, owner, repo, tag string) (*github.RepositoryRelease, *github.Response, error) DownloadReleaseAsset(ctx context.Context, owner, repo string, id int64, followRedirectsClient *http.Client) (rc io.ReadCloser, redirectURL string, err error) }
RepositoryService is a wrapper around *github.RepositoryService.
Click to show internal directories.
Click to hide internal directories.