conf

package
v0.0.0-...-73d3301 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2016 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package conf is responsable for creating an interactive menu to fill configuration variables

Package conf is responsable for creating an interactive menu to fill configuration variables

Index

Constants

This section is empty.

Variables

View Source
var (
	HostnameOrIPInput = regexp.MustCompile("[0-9A-Za-z\\-\\.\\:]")
	HostnameInput     = regexp.MustCompile("[0-9A-Za-z\\-\\.]")
	AlphaNumericInput = regexp.MustCompile("[0-9A-Za-z]")
	NumericInput      = regexp.MustCompile("[0-9]")
	IPRangeInput      = regexp.MustCompile("[0-9a-fA-F\\:\\.,/]")
)

Functions

func ManageInputNumberScreen

func ManageInputNumberScreen(title, description string, number string) (int, bool)

func ManageInputTextScreen

func ManageInputTextScreen(
	title, description, input string,
	allowedInput *regexp.Regexp,
	validate func(string) (bool, string),
) (string, bool)

func Run

func Run(configFilePath, sampleConfigFilePath, keysPath string)

Types

type Option

type Option struct {
	Value    string
	Selected bool
}

func ManageInputOptionsScreen

func ManageInputOptionsScreen(
	title, description string,
	options []Option,
	checkConsistency func([]Option, int) []Option,
) ([]Option, bool)

func ManageInputTextOptionsScreen

func ManageInputTextOptionsScreen(
	title, description string,
	input string,
	allowedInput *regexp.Regexp,
	validate func(string) (bool, string),
	options []Option,
	checkConsistency func([]Option, int) []Option,
) (string, []Option, bool)

Jump to

Keyboard shortcuts

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