config

package
v0.0.0-...-be19f74 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIKey              string   `json:"key"`
	DefaultOrganization string   `json:"org"`
	Organizations       []string `json:"orgs"`
}

type Service

type Service interface {
	// ConfigFile returns the configuration file path.
	ConfigFile() string

	// CheckConfigFile checks if the configuration file is exists.
	CheckConfigFile() bool

	// Create creates the configuration file.
	Create(apikey, org string) (string, error)

	// Read reads the configration file content.
	Read() (*Config, error)

	// UpdateDefaultOrganization updates default organization on the configuration.
	UpdateDefaultOrganization(org string) error

	// AddOrganization adds the new organization to the configuration.
	AddOrganization(org string) (bool, error)
}

func New

func New(cfile cfile.IConfigFile) Service

Jump to

Keyboard shortcuts

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