config

package
v0.0.0-...-ed455c3 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2020 License: Apache-2.0 Imports: 5 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 {
	ACLID               string   `mapstructure:"acl-id"`
	ACLName             string   `mapstructure:"acl-name"`
	Filter              []string `mapstructure:"filter"`
	InstanceID          string   `mapstructure:"instance-id"`
	InstanceName        string   `mapstructure:"instance-name"`
	NetworkID           string   `mapstructure:"network-id"`
	NetworkName         string   `mapstructure:"network-name"`
	Output              string   `mapstructure:"output"`
	Profile             string   `mapstructure:"profile"`
	ReverseSort         bool     `mapstructure:"reverse-sort"`
	ShowDescription     bool     `mapstructure:"show-description"`
	ShowHost            bool     `mapstructure:"show-host"`
	ShowID              bool     `mapstructure:"show-id"`
	ShowMACAddress      bool     `mapstructure:"show-mac-address"`
	ShowACLID           bool     `mapstructure:"show-acl-id"`
	ShowACLName         bool     `mapstructure:"show-acl-name"`
	ShowRuleNumber      bool     `mapstructure:"show-rule-number"`
	ShowNetwork         bool     `mapstructure:"show-network"`
	ShowRedundantStatus bool     `mapstructure:"show-redundant-status"`
	ShowRestartRequired bool     `mapstructure:"show-restart-required"`
	ShowSNAT            bool     `mapstructure:"show-snat"`
	ShowServiceOffering bool     `mapstructure:"show-service-offering"`
	ShowTemplate        bool     `mapstructure:"show-template"`
	ShowVersion         bool     `mapstructure:"show-version"`
	SortBy              string   `mapstructure:"sort-by"`
	VPCID               string   `mapstructure:"vpc-id"`
	VPCName             string   `mapstructure:"vpc-name"`
	Profiles            map[string]struct {
		APIURL    string `mapstructure:"api_url"`
		APIKey    string `mapstructure:"api_key"`
		SecretKey string `mapstructure:"secret_key"`
	}
}

Config contains cosmic-cli options.

func New

func New() (*Config, error)

New returns an initialized Config.

func (*Config) CheckDuplicatedProfile

func (c *Config) CheckDuplicatedProfile()

CheckDuplicatedProfile will check for any profiles; if any find an error will be returned asking the user to fix their config before proceeding.

func (*Config) ValidProfile

func (c *Config) ValidProfile(p string)

ValidProfile will check the profile exists.

Jump to

Keyboard shortcuts

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