prompt

package
v0.0.0-...-f59cb8c Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetFieldFromList

func GetFieldFromList(idx int, list any) any

GetFieldFromList return the field at the given index in the given list.

func GetFromTag

func GetFromTag(parent any, tag string) any

GetFromTag get a field from a struct given the xml tag.

func InitializeIfNil

func InitializeIfNil(parent any, fv *FieldValue)

InitializeIfNil initialize the given field in the given data if it's nil.

func SetValue

func SetValue(parent any, tag string, newValue any)

SetValue set the given value at the given field in the given data.

Types

type FieldValue

type FieldValue struct {
	Name     string
	Value    reflect.Value
	Type     reflect.Type
	Kind     reflect.Kind
	ListKind reflect.Kind
	ListType reflect.Type
}

FieldValue the values of a field in a struct.

func DereferencePointer

func DereferencePointer(parent any, fv *FieldValue) *FieldValue

DereferencePointer return the FieldValue for the underlying value of the pointer.

func GetFieldValues

func GetFieldValues(data any) []*FieldValue

GetFieldValues get all fields in the given data as FieldValue.

func (*FieldValue) AddToStructList

func (f *FieldValue) AddToStructList(newData any)

AddToStructList add new data to the current list.

func (*FieldValue) ListValuesAsString

func (f *FieldValue) ListValuesAsString() []string

ListValuesAsString returns all values in a list as strings.

func (*FieldValue) NewOfListType

func (f *FieldValue) NewOfListType() any

NewOfListType returns a pointer to an empty item of the type in the current list.

func (*FieldValue) RemoveAtIndex

func (f *FieldValue) RemoveAtIndex(index int)

RemoveAtIndex removes the value at the given index in a list.

func (*FieldValue) ValueAsString

func (f *FieldValue) ValueAsString() string

ValueAsString returns the value as string.

type Output

type Output interface {
	Println(...interface{})
}

Output a collection of functions needed for output.

type Prompt

type Prompt struct {
	Client            *pkg.Client
	Templates         pkg.Templates
	MultilineScanner  *bufio.Scanner
	ValidateResponses bool
	XMLValidator      *validation.XMLValidator
	Cli               Output
}

Prompt handles the prompt interface to the epp client. Present options for commands and the corresponding data to be sent to the server.

func (*Prompt) Run

func (p *Prompt) Run(ctx context.Context, validateResponses bool)

Run start the epp client interface. Provides options for which command and data to send.

Jump to

Keyboard shortcuts

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