config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2019 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoWatch          = errors.New("picasso: task no defined")
	ErrNoDefaultTask    = errors.New("picasso: default task missing")
	ErrDuplicateDefault = errors.New("picasso: default task duplicate")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	// CfgFile
	File string `envconfig:"PICASSO_CONFIG_FILE" default:".picasso.yaml"`

	// LogFormat
	LogFormat string `envconfig:"PICASSO_CONFIG_LOG_FORMAT" default:"text"`

	// LogLevel
	LogLevel log.Level

	// Verbose
	Verbose bool `envconfig:"PICASSO_VERBOSE"`

	// FileMode
	FileMode os.FileMode
}

func New

func New() *Config

func (*Config) AddFlags

func (c *Config) AddFlags(cmd *cobra.Command)

func (*Config) Cwd

func (c *Config) Cwd() (string, error)

func (*Config) SetupLogger

func (c *Config) SetupLogger()

SetupLogger prepares the logger instance

type Settings

type Settings struct {
	Version string
	Author  string
	Project string
	Tasks   task.Tasks
	Vars    Vars
}

Settings ...

func NewSettings

func NewSettings() *Settings

func (*Settings) Task

func (s *Settings) Task(n string) (*task.Task, error)

func (*Settings) UnmarshalYAML

func (s *Settings) UnmarshalYAML(unmarshal func(interface{}) error) error

type Var

type Var string

Var

type Vars

type Vars map[string][]Var

Vars ...

Jump to

Keyboard shortcuts

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