urltemplate

package
v1.9.7 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const Prefix = "template:"

Variables

This section is empty.

Functions

func DetectLibc

func DetectLibc() string

func EffectiveSystem

func EffectiveSystem(system, currentGOOS, currentGOARCH string, detectLibc func() string, fixDarwin func(string, string) (string, string)) (string, string, string)

func ExtractJSONPath

func ExtractJSONPath(data []byte, path string) (string, error)

func ExtractYAMLPath added in v1.7.2

func ExtractYAMLPath(data []byte, path string) (string, error)

func FixDarwinRosetta

func FixDarwinRosetta(goos, goarch string) (string, string)

func IsTarget

func IsTarget(value string) bool

func ParseChecksum

func ParseChecksum(data []byte, cfg Config) (string, error)

func ParseLatest

func ParseLatest(data []byte, cfg Config) (string, error)

func ParseLatestDescription added in v1.8.1

func ParseLatestDescription(data []byte, cfg Config) (string, error)

func ParseLatestPublishedAt added in v1.7.2

func ParseLatestPublishedAt(data []byte, cfg Config) (time.Time, error)

func Render

func Render(template string, vars map[string]string) (string, error)

func VariablesFor

func VariablesFor(input VariableInput) (map[string]string, error)

Types

type Config

type Config struct {
	URLTemplate         string
	LatestURL           string
	LatestFormat        string
	LatestJSONPath      string
	VersionRegex        string
	OSMap               map[string]string
	ArchMap             map[string]string
	ExtMap              map[string]string
	LibcMap             map[string]string
	ChecksumURLTemplate string
	ChecksumFormat      string
	ChecksumJSONPath    string
	ChecksumRegex       string
	InstallAction       string
	InstallArgs         []string
}

type Finder

type Finder struct {
	Name    string
	Target  Target
	Config  Config
	Tag     string
	GOOS    string
	GOARCH  string
	Libc    string
	Getter  HTTPGetter
	Version string
	// contains filtered or unexported fields
}

func (*Finder) Find

func (f *Finder) Find() ([]string, error)

func (*Finder) Latest

func (f *Finder) Latest() (LatestInfo, error)

func (*Finder) Vars

func (f *Finder) Vars() map[string]string

type HTTPGetter

type HTTPGetter interface {
	Get(url string) (*http.Response, error)
}

type LatestInfo

type LatestInfo struct {
	Version     string
	Description string
	PublishedAt time.Time
}

type Target

type Target struct {
	ID         string
	Normalized string
}

func ParseTarget

func ParseTarget(value string) (Target, error)

type VariableInput

type VariableInput struct {
	Name    string
	Version string
	GOOS    string
	GOARCH  string
	Libc    string
	Config  Config
}

Jump to

Keyboard shortcuts

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