config

package
v0.0.0-...-cc66a5a Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MapCmds

func MapCmds(cfg *Config) (map[string][]string, error)

MapCmds prints a map from options to commands.

Types

type Config

type Config struct {
	Hosts   string        `yaml:"hosts"`   // file of hosts to configure
	User    string        `yaml:"user"`    // username for host login
	Pass    string        `yaml:"pass"`    // password for host login
	Keys    []string      `yaml:"keys"`    // ssh private keys for authentication
	Accept  string        `yaml:"accept"`  // group of hosts to accept connections to
	Timeout time.Duration `yaml:"timeout"` // time to wait to establish an ssh client connection
	Aliases []cmdSet      `yaml:"aliases"` // aliases for configuration command sets
	Config  []cmdSet      `yaml:"config"`  // sets of configuration commands to run
	// contains filtered or unexported fields
}

Config represents a `netcfg` configuration file.

func New

func New(name string) *Config

New creates a new configuration.

func (*Config) Name

func (c *Config) Name() string

Name returns the name of this Config.

func (*Config) Parse

func (c *Config) Parse(src string) (*Config, error)

Parse parses a Config with any template data.

func (*Config) String

func (c *Config) String() string

String returns the string representation of this Config.

func (*Config) Template

func (c *Config) Template(src string) *Config

Template adds template data to a Config for use in parsing.

Jump to

Keyboard shortcuts

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