config

package
v0.2.9 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrNoContext        stringError = "no context in use"
	ErrParametersNumber stringError = "please provide parameter - value pairs"
	HiddenToken                     = "***"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Name        string            `json:"name"`
	KeystoneURL string            `json:"keystone"`
	OrionURL    string            `json:"orion"`
	UrboURL     string            `json:"urbo"`
	IotamURL    string            `json:"iotam"`
	PerseoURL   string            `json:"perseo"`
	Service     string            `json:"service"`
	Subservice  string            `json:"subservice"`
	Username    string            `json:"username"`
	Token       string            `json:"token,omitempty"`
	UrboToken   string            `json:"urbotoken,omitempty"`
	Params      map[string]string `json:"params,omitempty"`
}

Config almacena información de conexión a un entorno

func (*Config) HasToken added in v0.1.2

func (c *Config) HasToken() string

func (*Config) HasUrboToken added in v0.2.8

func (c *Config) HasUrboToken() string

func (*Config) String

func (c *Config) String() string

type Store

type Store struct {
	Path    string
	Current Config
}

Store can manage several configs

func (*Store) CanConfig

func (s *Store) CanConfig() []string

CanConfig returns a list of parameter names recoginzed by `Set`

func (*Store) Create

func (s *Store) Create(name string) error

Create a named Cotext

func (*Store) Delete

func (s *Store) Delete(name string) error

Delete the named config, return the current one

func (*Store) Dup

func (s *Store) Dup(name string) error

Dup the current config with a new name

func (*Store) Info

func (s *Store) Info(name string) (Config, error)

Info about a particular Config

func (*Store) List

func (s *Store) List() ([]string, error)

List available Configs

func (*Store) Read

func (s *Store) Read() error

Read the config file

func (*Store) Set

func (s *Store) Set(pairs []string) error

func (*Store) SetParams

func (s *Store) SetParams(pairs []string) error

func (*Store) Use

func (s *Store) Use(name string) error

Use the named Config

Jump to

Keyboard shortcuts

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