cliconfig

package module
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2020 License: MIT Imports: 7 Imported by: 0

README

Cliconfig

Cliconfig is a utility package that helps setup and manage cli configurations

cliconfig.New("path/to/config/folder")
cliconfig.Init(configStruct) // Creates the yaml config.yml file inside the config folder
cliconfig.FromFile(configStruct) // Updates the configStruct from the config.yml file

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is the configuration client for a cli

func New

func New(path string) *Client

New creates a new cliconfig client

func (*Client) Dir

func (client *Client) Dir() string

Dir returns the default directory to the configuration directory

func (*Client) FromFile

func (client *Client) FromFile(config interface{}) error

FromFile creates a new config from a file

func (*Client) Init

func (client *Client) Init(config interface{}) error

Init initialize the configuration file with default values

func (*Client) Open

func (client *Client) Open()

Open opens the configuration file inside the default file editor

func (*Client) Path

func (client *Client) Path() string

Path returns the default path to the configuration file

func (*Client) Reset

func (client *Client) Reset(config interface{}) error

Reset updates the configuration file with default values

func (*Client) Show

func (client *Client) Show(config interface{}) error

Show prints the content of the config file inside the console

Jump to

Keyboard shortcuts

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