Documentation ¶
Index ¶
Constants ¶
const DefaultConfigFilename = "config.yaml"
DefaultConfigFilename is the default config filename
const DefaultHome = Home("${HOME}/.fabric")
DefaultHome is the default cli home directory
Variables ¶
DefaultStreams contains the default io streams
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action func(c *Config)
Action is used to modify config
func DeleteContext ¶
DeleteContext deletes a specified context
func DeleteNetwork ¶
DeleteNetwork deletes the specified network
func SetContext ¶
SetContext adds or updates the specified context
func SetCurrentContext ¶
SetCurrentContext updates the current context
func SetNetwork ¶
SetNetwork adds or updates the specified network
type Config ¶
type Config struct { Networks map[string]*Network `yaml:",omitempty"` Contexts map[string]*Context `yaml:",omitempty"` CurrentContext string `yaml:"current-context,omitempty"` }
Config contains information needed to manage fabric networks
func (*Config) GetCurrentContext ¶
GetCurrentContext returns the current context
func (*Config) GetCurrentContextNetwork ¶
GetCurrentContextNetwork returns the current network
func (*Config) LoadFromFile ¶
LoadFromFile populates config based on the specified path
type Context ¶
type Context struct { Network string `yaml:",omitempty"` Organization string `yaml:",omitempty"` User string `yaml:",omitempty"` Channel string `yaml:",omitempty"` Orderers []string `yaml:",omitempty"` Peers []string `yaml:",omitempty"` }
Context contains network interaction parameters
type Home ¶
type Home string
Home is the location of the configuration files By default, the files are stored in ~/.fabric
type Network ¶
type Network struct { // path to fabric go sdk config file ConfigPath string `yaml:"path,omitempty"` }
Network contains a fabric network's configurations
type Settings ¶
type Settings struct { Home Home Streams Streams DisablePlugins bool Config *Config // contains filtered or unexported fields }
Settings contains environment configuration details
func NewDefaultSettings ¶
func NewDefaultSettings() *Settings
NewDefaultSettings returns settings populated with default values
func (*Settings) Init ¶
Init populates the settings based on a precedence:
Flag > Env > Config File > Defaults
func (*Settings) ModifyConfig ¶
ModifyConfig loads the config file and updates it based on actions
func (*Settings) SetupPluginEnvironment ¶
func (s *Settings) SetupPluginEnvironment()
SetupPluginEnvironment sets the environment variables that are important to plugins This is needed because environment variables are not populated with defaults