external

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 25 Imported by: 6

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTagNotFound = errors.New("tag not found")
	ErrHTTPStatus  = errors.New("invalid http status")
)

Functions

func BaseURL

func BaseURL(protocol string, tls bool, trimmedURL string, a ...any) string

BaseURL prepends `protocol + "://"` or `protocol + "s://"` to the url depending on TLS support.

func GetUsername

func GetUsername() string

GetUsername tries to determine the name of the current user. It looks at the following things in order:

  1. git config user.name
  2. currently logged in user of the OS
  3. returns <your-name> with a note to change it

func GithubTagFromVersion

func GithubTagFromVersion(owner, repo, version string) (string, error)

func HasContentType

func HasContentType(h http.Header, mimetype string) bool

HasContentType returns true if the 'content-type' header includes mimetype.

func InstallProgram

func InstallProgram(name, filename, url, version, path string) (string, error)

func IsTLS

func IsTLS(trimmedURL string) bool

IsTLS verifies the TLS certificate of a trimmed URL.

func LatestGithubTag

func LatestGithubTag(owner, repo string) (string, error)

func LibraryVersionFromCGVersion

func LibraryVersionFromCGVersion(owner, repo, cgVersion string) string

func LoadVersionsJSON

func LoadVersionsJSON(owner, repo string) (json.RawMessage, error)

func TrimURL

func TrimURL(url string) string

TrimURL removes the protocol version and trailing slashes.

Types

This section is empty.

Jump to

Keyboard shortcuts

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