core

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Overview

Package core handles asset information for file extraction management

Package core handles templating value

Package core maintains configuration definitions

Index

Constants

This section is empty.

Variables

View Source
var (

	// BaseTemplate are common templating needs
	BaseTemplate = baseValues{
		runtime.GOARCH,
		runtime.GOOS,
	}
)

Functions

This section is empty.

Types

type AppSet added in v0.3.3

type AppSet map[string]Application

AppSet are a name->app pair

type Application

type Application struct {
	Priority  int
	Flags     FlagSet
	GitHub    *GitHubMode
	Git       *GitMode
	Web       *WebMode
	Exec      *RunMode
	Static    *StaticMode
	Extract   Extraction
	Variables Variables
	ClearEnv  bool
	Setup     []Step
	Platforms []struct {
		Disable bool
		Value   Resolved
		Target  string
	}
}

Application defines how an application is downloaded, unpacked, and deployed

func (Application) CommandEnv added in v0.5.0

func (a Application) CommandEnv() CommandEnv

CommandEnv creates a command environment from an application

func (Application) Enabled added in v0.5.3

func (a Application) Enabled() bool

Enabled indicates if an application is enabled for use

func (Application) Items added in v0.4.0

func (a Application) Items() iter.Seq[any]

Items will iterate over the available source itmes

type CommandEnv added in v0.5.0

type CommandEnv struct {
	Clear     bool
	Variables Variables
}

CommandEnv wraps build command environment settings

type Connections added in v0.3.3

type Connections struct {
	GitHub   GitHubSettings
	Timeouts struct {
		Get     uint
		All     uint
		Command uint
	}
}

Connections are various endpoint settings

type Extraction added in v0.3.3

type Extraction struct {
	Skip    bool
	NoDepth bool
	Command []Resolved
}

Extraction handles asset extraction

type Filtered added in v0.5.5

type Filtered struct {
	Download string
	Filters  []string
	Sort     string
}

Filtered deals with modes that need to filters the results

type FlagSet added in v0.6.0

type FlagSet []string

FlagSet is a simple string array to control application rules

func (FlagSet) Check added in v0.6.0

func (f FlagSet) Check() error

Check will validate a flag set

func (FlagSet) Pin added in v0.6.0

func (f FlagSet) Pin() bool

Pin indicates if the flag means something should be pinned (not updated/disabled but not pruned)

func (FlagSet) ReDeploy added in v0.7.0

func (f FlagSet) ReDeploy() bool

ReDeploy indicates the application prefers to be redeployed

func (FlagSet) Skipped added in v0.6.0

func (f FlagSet) Skipped() bool

Skipped indicates a flag wants an actual disabled activity

type GitHubBranchMode added in v0.3.3

type GitHubBranchMode struct {
	Name string
}

GitHubBranchMode will enable a repository+branch to pull a tarball

type GitHubMode

type GitHubMode struct {
	Project string
	Release *GitHubReleaseMode
	Branch  *GitHubBranchMode
}

GitHubMode indicates processing of a github project for upstreams

func (GitHubMode) Is added in v0.4.0

func (g GitHubMode) Is()

Is toggles on source mode

type GitHubReleaseMode added in v0.3.3

type GitHubReleaseMode struct {
	Asset string
}

GitHubReleaseMode are github modes operating on releases

type GitHubSettings added in v0.3.3

type GitHubSettings struct {
	Token   string
	Command []Resolved
}

GitHubSettings are overall github settings

func (GitHubSettings) Env added in v0.3.3

func (g GitHubSettings) Env() []string

Env will get the possible environment variables

func (GitHubSettings) Value added in v0.3.3

func (g GitHubSettings) Value() (string, []string)

Value will get the configured token value

type GitMode added in v0.3.3

type GitMode struct {
	Repository string
	Tagged     *Filtered
}

GitMode enables git-based fetches

func (GitMode) Is added in v0.4.0

func (g GitMode) Is()

Is toggles on source mode

type Pinned added in v0.3.3

type Pinned []string

Pinned are pinned names (for regex use)

type Resolved added in v0.3.3

type Resolved string

Resolved will handle env-based strings for resolution of env vars

func (Resolved) String added in v0.3.3

func (r Resolved) String() string

String will resolve ~/ and basic env vars

type Resource added in v0.3.3

type Resource struct {
	URL   string
	File  string
	Tag   string
	Paths struct {
		Archive string
		Unpack  string
		// contains filtered or unexported fields
	}
	// contains filtered or unexported fields
}

Resource handles download information and extract for asset managing

func (*Resource) Extract added in v0.3.3

func (asset *Resource) Extract(opts util.Runner) error

Extract will unpack an asset

func (*Resource) ID added in v0.3.3

func (asset *Resource) ID() (string, error)

ID attempt to get a reasonable id for file system parsing

func (*Resource) SetAppData added in v0.3.3

func (asset *Resource) SetAppData(name, workdir string, settings Extraction) error

SetAppData will set the asset's data for the overall application

type RunMode added in v0.5.6

type RunMode struct {
	Executable Resolved
	Arguments  []Resolved
	Fetch      *Filtered
}

RunMode indicates running an executable

func (RunMode) Is added in v0.5.6

func (r RunMode) Is()

Is toggles running a command mode

type SetVariables added in v0.4.0

type SetVariables map[string]struct {
	// contains filtered or unexported fields
}

SetVariables are the variables that are set on Variables.Set and should be "unset"

func (SetVariables) Unset added in v0.4.0

func (v SetVariables) Unset()

Unset will clear/reset variables to prior state

type SourceType added in v0.4.0

type SourceType interface {
	Is()
}

SourceType indicates if an application field contains a source

type StaticMode added in v0.5.5

type StaticMode struct {
	URL  WebURL
	File string
	Tag  string
}

StaticMode allows for downloading a static asset

func (StaticMode) Is added in v0.5.5

func (s StaticMode) Is()

Is toggles on for static mode

type Step added in v0.3.3

type Step struct {
	Directory Resolved
	Commands  interface{}
	Variables Variables
	ClearEnv  bool
}

Step is a build process step

func (Step) CommandEnv added in v0.5.0

func (s Step) CommandEnv() CommandEnv

CommandEnv creates a command environment from a step

func (Step) Steps added in v0.9.0

func (s Step) Steps() iter.Seq[[]Resolved]

Steps will get the step commands

type Token added in v0.3.3

type Token interface {
	Env() []string
	Value() (string, []string)
}

Token defines an interface for setting API/auth tokens

type Values added in v0.3.3

type Values[T any] struct {
	Name string
	Vars T
	// contains filtered or unexported fields
}

Values is the environment variables/values (for templating)

func NewValues added in v0.3.3

func NewValues[T any](name string, in T) (Values[T], error)

NewValues create a new environment variable set

func (Values) Getenv added in v0.6.1

func (Values) Getenv(key string) string

Getenv allows for reading environment variable in templating

func (Values[T]) Template added in v0.3.3

func (v Values[T]) Template(in string) (string, error)

Template will template a string

type Variables added in v0.3.3

type Variables []struct {
	Key   string
	Value Resolved
}

Variables define os environment variables to set

func (Variables) Set added in v0.3.3

func (v Variables) Set() SetVariables

Set will set os environment variables

type Version added in v0.7.0

type Version string

Version is a tag that could be a semantic version

func (Version) Full added in v0.7.0

func (v Version) Full() string

Full is the major.minor.patch.remainder (- prefix 'v')

func (Version) Major added in v0.7.0

func (v Version) Major() string

Major is the major component

func (Version) Minor added in v0.7.0

func (v Version) Minor() string

Minor is the minor component

func (Version) Patch added in v0.7.0

func (v Version) Patch() string

Patch is the patch component

func (Version) Remainder added in v0.7.0

func (v Version) Remainder() string

Remainder is anything after patch

type WebMode added in v0.5.5

type WebMode struct {
	URL    WebURL
	Scrape *Filtered
}

WebMode represents web-based lookups

func (WebMode) Is added in v0.5.5

func (w WebMode) Is()

Is toggles on source mode

type WebURL added in v0.6.1

type WebURL string

WebURL can be templated with settings from the host

func (WebURL) CanTemplate added in v0.6.1

func (w WebURL) CanTemplate() bool

CanTemplate indicates that this type can be templated (as it can)

func (WebURL) String added in v0.6.1

func (w WebURL) String() string

String returns the string of the web URL

Jump to

Keyboard shortcuts

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