config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidConfig = errors.New("invalid config file")

Functions

This section is empty.

Types

type Config

type Config struct {
	Style              ui.Config        `yaml:"style" mapstructure:"style"`
	Editor             string           `` /* 215-byte string literal not displayed */
	DefaultRootCommand string           `` /* 196-byte string literal not displayed */
	Providers          providers.Config `yaml:"provider" mapstructure:"provider"`
}

type ErrConfigNotFound

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

func (ErrConfigNotFound) Error

func (e ErrConfigNotFound) Error() string

func (ErrConfigNotFound) Is

func (e ErrConfigNotFound) Is(target error) bool

type Option

type Option interface {
	// contains filtered or unexported methods
}

Option configures an App.

func WithSystem

func WithSystem(system *system.System) Option

WithSystem sets the system instance for the Service.

func WithTerminal

func WithTerminal(t ui.Terminal) Option

WithTerminal sets the terminal for the Service.

func WithViper

func WithViper(v *viper.Viper) Option

WithViper sets the viper instance for the Service.

type Service

type Service interface {
	Create()
	LoadConfig() (Config, error)
	Edit()
	Clean()
	ConfigFilePath() string
}

func NewService

func NewService(options ...Option) Service

NewService creates a new Service.

type VersionWrapper

type VersionWrapper struct {
	Version string `yaml:"version" mapstructure:"version"`
	Config  Config `yaml:"config" mapstructure:"config"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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