env

package
v0.1.12 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2020 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DefaultHost is the default host of the GitHub
	DefaultHost = "github.com"
)
View Source
const (
	EnvarPrefix = "GORDON_"
)

Variables

View Source
var EmptyYAMLReader io.Reader = nil

Functions

func GetAppenv

func GetAppenv(yamlReader io.Reader, envarPrefix string) (config Config, access Access, err error)

func OptionNames added in v0.1.9

func OptionNames() []string

func ValidateArchitecture

func ValidateArchitecture(arch string) error

func ValidateDist

func ValidateDist(os, arch string) error

func ValidateFile

func ValidateFile(file string) error

func ValidateOS

func ValidateOS(os string) error

func ValidateOwner

func ValidateOwner(owner string) error

func ValidateRegexp

func ValidateRegexp(pattern string) error

func ValidateRoot

func ValidateRoot(root string) error

Types

type Access

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

func GetAccess

func GetAccess(yamlReader io.Reader, envarPrefix string) (access Access, err error)

func (*Access) Architecture

func (a *Access) Architecture() string

func (*Access) Bin

func (a *Access) Bin() string

func (*Access) Cache

func (a *Access) Cache() string

func (*Access) GithubHost

func (a *Access) GithubHost() string

func (*Access) GithubUser

func (a *Access) GithubUser() string

func (*Access) Hooks

func (a *Access) Hooks() []string

func (*Access) Man

func (a *Access) Man() string

func (*Access) OS

func (a *Access) OS() string

type Architecture

type Architecture struct{ types.StringValue }

func (*Architecture) Default

func (*Architecture) Default() interface{}

type Bin

type Bin struct {
	extypes.Path
}

func (*Bin) Default

func (*Bin) Default() interface{}

type Cache

type Cache struct {
	extypes.Path
}

func (*Cache) Default

func (*Cache) Default() interface{}

type Config

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

func GetConfig

func GetConfig(yamlReader io.Reader) (config Config, err error)

func (*Config) Architecture added in v0.1.9

func (a *Config) Architecture() types.Config

func (*Config) Bin added in v0.1.9

func (a *Config) Bin() types.Config

func (*Config) Cache added in v0.1.9

func (a *Config) Cache() types.Config

func (*Config) GithubHost added in v0.1.9

func (a *Config) GithubHost() types.Config

func (*Config) GithubUser added in v0.1.9

func (a *Config) GithubUser() types.Config

func (*Config) Hooks added in v0.1.9

func (a *Config) Hooks() types.Config

func (*Config) Man added in v0.1.9

func (a *Config) Man() types.Config

func (*Config) OS added in v0.1.9

func (a *Config) OS() types.Config

func (*Config) Option added in v0.1.9

func (a *Config) Option(name string) (types.Config, error)

func (*Config) Save

func (c *Config) Save(yamlWriter io.Writer) error

type Envar

type Envar struct {
	GithubHost   *GithubHost
	GithubUser   *GithubUser
	Architecture *Architecture
	OS           *OS
	Cache        *Cache
	Bin          *Bin
	Man          *Man
	Hooks        *Hooks
}

type GithubHost

type GithubHost struct {
	types.StringValue
}

func (*GithubHost) Default

func (*GithubHost) Default() interface{}

type GithubUser

type GithubUser struct {
	types.StringValue
}

type Hooks

type Hooks struct {
	extypes.Paths
}

func (*Hooks) Default

func (*Hooks) Default() interface{}

type Man

type Man struct {
	extypes.Path
}

func (*Man) Default

func (*Man) Default() interface{}

type OS

type OS struct{ types.StringValue }

func (*OS) Default

func (*OS) Default() interface{}

type YAML

type YAML struct {
	GithubHost   *GithubHost   `yaml:"githubHost,omitempty"`
	GithubUser   *GithubUser   `yaml:"githubUser,omitempty"`
	Architecture *Architecture `yaml:"architecture,omitempty"`
	OS           *OS           `yaml:"os,omitempty"`
	Cache        *Cache        `yaml:"cache,omitempty"`
	Bin          *Bin          `yaml:"bin,omitempty"`
	Man          *Man          `yaml:"man,omitempty"`
	Hooks        *Hooks        `yaml:"hooks,omitempty"`
}

Jump to

Keyboard shortcuts

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