usrbin

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2023 License: Apache-2.0 Imports: 10 Imported by: 3

README

usrbin-go

This is the Go SDK for usrbin.app.

Design Goals

  • High compatibility with go projects. Avoid the go mod hell that some find themselves in.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger interface {
	Printf(format string, v ...interface{})
}

type Option

type Option func(*SDK) error

Option is a functional option for configuring the client

func UsingGitHubUpdateChecker

func UsingGitHubUpdateChecker(repo string) Option

Using GitHubUpdateChecker will cause the repo passed in to be the source of truth when checking for new updates

func UsingHomebrewFormula

func UsingHomebrewFormula(formula string) Option

UsingHomebrewFormula will cause the formula passed in to be used when checking if this CLI was installed using homebrew

func UsingLogger

func UsingLogger(logger Logger) Option

UsingLogger can be set if you want to get log output from this sdk By default no log output is emitted.

func UsingOCIUpdateChecker added in v0.0.4

func UsingOCIUpdateChecker(artifact string) Option

UsingOCIUpdateChecker will cause the image passed in to be the source of truth when checking for new updates

type SDK

type SDK struct {
	// contains filtered or unexported fields
}

func New

func New(version string, opts ...Option) (*SDK, error)

func (SDK) CanSupportUpgrade

func (s SDK) CanSupportUpgrade() (bool, error)

CanSupportUpgrade

func (SDK) ExternalUpgradeCommand

func (s SDK) ExternalUpgradeCommand() string

func (SDK) GetUpdateInfo

func (s SDK) GetUpdateInfo() (*updatechecker.UpdateInfo, error)

GetUpdateInfo will return the latest version

func (SDK) Upgrade

func (s SDK) Upgrade() error

Upgrade is the entrypoint that the app will use to perform an in-place upgrade we need to assume that the app is running and we are running in the main thread

Directories

Path Synopsis
pkg
oci

Jump to

Keyboard shortcuts

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