ghupdate

package
v0.0.0-...-6b390a6 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

Package ghupdate implements a new command to selfupdate the current PocketBase executable with the latest GitHub release.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustRegister

func MustRegister(app core.App, rootCmd *cobra.Command, options *Options)

MustRegister registers the ghupdate plugin to the provided app instance and panic if it fails.

func Register

func Register(app core.App, rootCmd *cobra.Command, options *Options) error

Register registers the ghupdate plugin to the provided app instance.

Types

type HttpClient

type HttpClient interface {
	Do(req *http.Request) (*http.Response, error)
}

HttpClient is a base HTTP client interface (usually used for test purposes).

type Options

type Options 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

	// 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
}

Options defines optional struct to customize the default plugin behavior.

NB! This plugin is considered experimental and its options may change in the future.

Jump to

Keyboard shortcuts

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