env

package
v1.8.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KeyringService = "gogh.kyoh86.dev"
	EnvarPrefix    = "GOGH_"
)
View Source
const (
	// DefaultHost is the default host of the GitHub
	DefaultHost = "github.com"
)

Variables

View Source
var EmptyYAMLReader io.Reader = nil

Functions

func GetAppenv added in v1.5.2

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

func OptionNames added in v1.7.1

func OptionNames() []string

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) GithubHost

func (a *Access) GithubHost() string

func (*Access) GithubUser

func (a *Access) GithubUser() string

func (*Access) Hooks added in v1.5.1

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

func (*Access) Roots

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

type Config

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

func GetConfig

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

func (*Config) GithubHost added in v1.7.1

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

func (*Config) GithubUser added in v1.7.1

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

func (*Config) Hooks added in v1.7.1

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

func (*Config) Option added in v1.7.1

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

func (*Config) Roots added in v1.7.1

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

func (*Config) Save

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

type Envar

type Envar struct {
	GithubHost *GithubHost
	GithubUser *GithubUser
	Roots      *Roots
	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 added in v1.5.1

type Hooks struct {
	Paths
}

func (*Hooks) Default added in v1.5.1

func (*Hooks) Default() interface{}

type Paths added in v1.5.1

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

func (*Paths) MarshalText added in v1.5.1

func (p *Paths) MarshalText() (text []byte, err error)

func (*Paths) MarshalYAML added in v1.5.1

func (p *Paths) MarshalYAML() (interface{}, error)

MarshalYAML implements the interface `yaml.Marshaler`

func (*Paths) UnmarshalText added in v1.5.1

func (p *Paths) UnmarshalText(text []byte) error

func (*Paths) UnmarshalYAML added in v1.5.1

func (p *Paths) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML implements the interface `yaml.Unmarshaler`

func (*Paths) Value added in v1.5.1

func (p *Paths) Value() interface{}

type Roots

type Roots struct {
	Paths
}

func (*Roots) Default

func (*Roots) Default() interface{}

type YAML

type YAML struct {
	GithubHost *GithubHost `yaml:"githubHost,omitempty"`
	GithubUser *GithubUser `yaml:"githubUser,omitempty"`
	Roots      *Roots      `yaml:"roots,omitempty"`
	Hooks      *Hooks      `yaml:"hooks,omitempty"`
}

Jump to

Keyboard shortcuts

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