create

package
v1.15.11 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2023 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionCallback

type ActionCallback func(context.Context, *cli.Context, string, string, bool) error

ActionCallback is the callback for the creation calls to print and copy the credentials.

type Attribute

type Attribute struct {
	Name    string `yaml:"name"`
	Type    string `yaml:"type"`
	Prompt  string `yaml:"prompt"`
	Charset string `yaml:"charset"`
	Min     int    `yaml:"min"`
	Max     int    `yaml:"max"`
}

Attribute is a credential attribute that is being asked for when populating a template.

type Template

type Template struct {
	Name       string      `yaml:"name"`
	Priority   int         `yaml:"priority"`
	Prefix     string      `yaml:"prefix"`
	NameFrom   []string    `yaml:"name_from"`
	Welcome    string      `yaml:"welcome"`
	Attributes []Attribute `yaml:"attributes"`
}

Template is an action template for the create wizard.

type Wizard

type Wizard struct {
	Templates []Template
}

Wizard is the templateable credential creation wizard.

func New

func New(ctx context.Context, s backend.Storage) (*Wizard, error)

New creates a new instance of the wizard. It will parse the user supplied templates and add the default templates.

func (*Wizard) Actions

func (w *Wizard) Actions(s *root.Store, cb ActionCallback) cui.Actions

Actions returns a list of actions that can be performed on the wizard. The actions directly interact with the underlying storage.

Jump to

Keyboard shortcuts

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