Documentation
¶
Overview ¶
Package update implements a new command to replace the current PocketBase executable with the one from the latest BugStage releases.
Note that it expects the fetched release to have file(s) in the following formats:
- "*_linux_amd64.zip"
- "*_linux_arm64.zip"
- "*_linux_armv7.zip"
- "*_darwin_amd64.zip"
- "*_darwin_arm64.zip"
- "*_windows_amd64.zip"
- "*_windows_arm64.zip"
The appropriate file is auto downloaded based on the user platform. If there is no file matching the user platform then an error is returned.
Example plugin registration:
update.MustRegister(app, app.RootCmd, update.Config{
BaseURL: "https://ganigeorgiev.com",
Project: "pocketbase",
Repository: "pocketbase",
})
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustRegister ¶
MustRegister registers the update plugin to the provided app instance and panic if it fails.
Types ¶
type Config ¶
type Config struct {
// BaseURL is the base URL of the BugStage host (or similar compatible)
// used to fetch the latest releases information.
//
// This field is required!
BaseURL string
// Project specifies the project name of the repository.
//
// This field is required!
Project string
// Repository specifies the name of the repository.
//
// This field is required!
Repository string
// Channel specifies the name of the release channel to check.
//
// If not set uses the system "default" channel.
Channel string
// ArchiveExecutable specifies the name of the executable file in the release archive
// (default to the same value as in [Config.Repository]; an additional ".exe" check is also performed as a fallback).
ArchiveExecutable 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 update plugin.
Click to show internal directories.
Click to hide internal directories.