config

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Platforms is a matrix of OS and Arch for the binaries which
	// the project would like to save checksums on.
	// i.e. map["linux"][]{"amd64", "arm64"}
	Platforms map[string][]string `json:"platforms"`

	// Programs is a list of program specification
	Programs []*program.Config `json:"programs"`
}

Config is a configuration which is used to declare a project's dependencies. By default, this is the content of bindl.yaml

type Lock

type Lock struct {
	Programs ProgramLocks `json:"programs"`
}

Lock is a configuration which was generated from Config. By default, this is the content of .bindl-lock.yaml

func NewLock added in v0.0.3

func NewLock(p []*program.Lock) *Lock

func ParseLock

func ParseLock(path string) (*Lock, error)

ParseLock reads a file from path and returns *Lock

func ParseLockBytes added in v0.0.3

func ParseLockBytes(b []byte) (*Lock, error)

ParseLock reads a file from parameter and returns *Lock

type ProgramLocks added in v0.0.3

type ProgramLocks []*program.Lock

ProgramLocks implements sort.Interface TODO: use generics?

func (ProgramLocks) Len added in v0.0.3

func (p ProgramLocks) Len() int

func (ProgramLocks) Less added in v0.0.3

func (p ProgramLocks) Less(i, j int) bool

func (ProgramLocks) Swap added in v0.0.3

func (p ProgramLocks) Swap(i, j int)

type Runtime

type Runtime struct {
	Path         string `envconfig:"CONFIG"`
	LockfilePath string `envconfig:"LOCK"`
	BinDir       string `envconfig:"BIN"`
	ProgDir      string `envconfig:"PROG"`

	OS   string `envconfig:"OS"`
	Arch string `envconfig:"ARCH"`

	UseCache bool `envconfig:"USE_CACHE"`

	Debug  bool `envconfig:"DEBUG"`
	Silent bool `envconfig:"SILENT"`
}

Runtime is a configuration which is primarily used by command/cli. All variables which users can change at runtime with global effect can be found here.

Jump to

Keyboard shortcuts

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