Documentation ¶
Overview ¶
Package configurator provides read / write functionalities to manage application configuration.
Index ¶
- Variables
- type Option
- type PromptConfigurator
- func (c *PromptConfigurator) Clean(oldCfg service.Config, newCfg service.Config) error
- func (c *PromptConfigurator) Configurator() service.Configurator
- func (c *PromptConfigurator) Configure() (err error)
- func (c *PromptConfigurator) Read() (service.Config, error)
- func (c *PromptConfigurator) SafeRead() (service.Config, error)
- func (c *PromptConfigurator) Write(cfg service.Config) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConfigIsDir = errors.New("config file is a directory")
ErrConfigIsDir indicates that the config file is a directory.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option func(c *PromptConfigurator)
Option configures Configurator.
func WithFileSystem ¶ added in v0.4.8
WithFileSystem sets filesystem for PromptConfigurator.
func WithStdioProvider ¶
func WithStdioProvider(p cobra.StdioProvider) Option
WithStdioProvider configures stdio for prompt.
type PromptConfigurator ¶
type PromptConfigurator struct {
// contains filtered or unexported fields
}
PromptConfigurator manages service.Config.
func New ¶
func New(configFile string, options ...Option) *PromptConfigurator
New creates a new Configurator.
func (*PromptConfigurator) Configurator ¶ added in v0.4.8
func (c *PromptConfigurator) Configurator() service.Configurator
Configurator provides Configurator.
func (*PromptConfigurator) Configure ¶
func (c *PromptConfigurator) Configure() (err error)
Configure runs the configuration prompt.
func (*PromptConfigurator) Read ¶
func (c *PromptConfigurator) Read() (service.Config, error)
Read reads configuration from config file.
Click to show internal directories.
Click to hide internal directories.