config

package
v0.0.0-...-ef18504 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2024 License: Apache-2.0 Imports: 8 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetOrder

func GetOrder() []string

GetOrder will return target connection history from Viper store.

func GetPrompts

func GetPrompts() map[string]Prompts

GetPrompts returns a slice of all prompts configs available.

func GetTargets

func GetTargets() map[string]Target

GetTargets will return target connection history from Viper store.

func Init

func Init(filePath string)

Init will read and if needed, initialize the config file.

func SetTarget

func SetTarget(targetName, targetAddress, ca, caKey string, abs bool) error

SetTarget adds any new target to the list of known targets.

Types

type Prompts

type Prompts struct {
	Name    string            `json:"name" mapstructure:"name"`
	Prompts map[string]string `json:"prompts" mapstructure:"prompts"`
	Files   map[string]string `json:"files" mapstructure:"files"`
}

Prompts represents a prompt config set that will get stored in viper.

func (*Prompts) Set

func (p *Prompts) Set() error

Set prompts in viper.

type Target

type Target struct {
	Address string `json:"address" mapstructure:"address"`
	Ca      string `json:"ca" mapstructure:"ca"`
	CaKey   string `json:"cakey" mapstructure:"cakey"`
}

Target stores connection details of a target.

type Test

type Test struct {
	Name       string            `json:"name" mapstructure:"name"`
	Args       map[string]string `json:"args" mapstructure:"args"`
	MustFail   bool              `json:"mustfail" mapstructure:"mustfail"`
	Wait       int               `json:"wait" mapstructure:"wait"`
	Wants      string            `json:"wants" mapstructure:"wants"`
	DoesntWant string            `json:"doesntwant" mapstructure:"doesntwant"`
	Prompt     []string          `json:"prompt" mapstructure:"prompt"`
}

Test represents a single set of inputs and expected outputs.

type Tests

type Tests map[string][]Test

Tests represent a set of major tests.

func GetTests

func GetTests() Tests

GetTests will return tests from viper store.

Jump to

Keyboard shortcuts

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