Skip to content

Create a dedicated package for config management #2

@pedromotita

Description

@pedromotita

Description

Instead of calling config from the CLI layer, create a dedicated package. Viper would be wrapped in this package, and would not appear anywhere in the code, all config management would be done by the config package.

It's API could look something like:

type PorkbunAPIConfig struct {
	Key       string `json:"key"`
	SecretKey string `json:"secretKey"`
	Domain    string `json:"domain"`
	Subdomain string `json:"subdomain"`
	Type      string `json:"type"`
}

type Config struct{}

func (c *Config) Get() (PorkbunAPIConfig, error)
func (c *Config) GetKey(key string) (PorkbunAPIConfig, error)
func (c *Config) Set(key, value string) error
func (c *Config) Delete(key) error

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions