ghupdate
import ghupdate "ganigeorgiev.com/pocketbase/pocketbase/plugins/ghupdate"
Package ghupdate implements a new command to selfupdate the current PocketBase executable with the latest GitHub release.
This is kept only for backward-compatibility and it is replaced by the equivalent `update` BugStage plugin.
Example usage:
ghupdate.MustRegister(app, app.RootCmd, ghupdate.Config{})
Source: plugins/ghupdate.
Functions
MustRegister
func MustRegister(app core.App, rootCmd *cobra.Command, config Config)
MustRegister registers the ghupdate plugin to the provided app instance and panic if it fails.
Register
func Register(app core.App, rootCmd *cobra.Command, config Config) error
Register registers the ghupdate plugin to the provided app instance.
Types
Config
type Config struct {
// Owner specifies the account owner of the repository (default to "pocketbase").
Owner string
// Repo specifies the name of the repository (default to "pocketbase").
Repo string
// ArchiveExecutable specifies the name of the executable file in the release archive
// (default to "pocketbase"; an additional ".exe" check is also performed as a fallback).
ArchiveExecutable string
// BaseURL is the base URL of the GitHub API (or similar compatible)
// used to fetch the latest releases information.
//
// Defaults to "https://api.github.com".
BaseURL string
// Optional context to use when fetching and downloading the latest release.
Context context.Context
// The HTTP client to use when fetching and downloading the latest release.
// Defaults to `http.DefaultClient`.
HttpClient HttpClient
}
Config defines the config options of the ghupdate plugin.
NB! This plugin is considered experimental and its config options may change in the future.
HttpClient
type HttpClient interface {
Do(req *http.Request) (*http.Response, error)
}
HttpClient is a base HTTP client interface (usually used for test purposes).
Questions and comments
Comments are a GitHub Discussions thread; sign in with GitHub to post.