parameter

package
v1.3.1-0...-9810bd5 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeBoolean   = "boolean"
	TypeInteger   = "integer"
	TypeList      = "list"
	TypeMultiList = "multi_list"
	TypeString    = "string"
	TypeSecret    = "secret"
	TypeText      = "text"
)
View Source
const UnknownGroup = "unknown"

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition struct {
	ParameterName    string      `yaml:"parameter_name"       json:"parameter_name"       mapstructure:"parameter_name"`
	ValueEmpty       *bool       `yaml:"value_empty"          json:"value_empty"          mapstructure:"value_empty"`
	ValueEquals      interface{} `yaml:"value_equals"         json:"value_equals"         mapstructure:"value_equals"`
	ValueNotEquals   interface{} `yaml:"value_not_equals"     json:"value_not_equals"     mapstructure:"value_not_equals"`
	ValueContains    interface{} `yaml:"value_contains"       json:"value_contains"       mapstructure:"value_contains"`
	ValueNotContains interface{} `yaml:"value_not_contains"   json:"value_not_contains"   mapstructure:"value_not_contains"`
	// contains filtered or unexported fields
}

func (*Condition) Contains

func (c *Condition) Contains(val interface{}) bool

func (*Condition) Equal

func (c *Condition) Equal(val interface{}) bool

func (*Condition) IsEmpty

func (c *Condition) IsEmpty(empty bool, val interface{}) bool

func (*Condition) Match

func (c *Condition) Match() bool

func (*Condition) NotContains

func (c *Condition) NotContains(val interface{}) bool

func (*Condition) NotEqual

func (c *Condition) NotEqual(val interface{}) bool

func (*Condition) Validate

func (c *Condition) Validate() []error

type DependsOn

type DependsOn struct {
	AndConditions []*Condition `yaml:"and_conditions"  json:"and_conditions" mapstructure:"and_conditions"`
	OrConditions  []*Condition `yaml:"or_conditions"   json:"or_conditions"  mapstructure:"or_conditions"`
}

type FieldKey

type FieldKey string

func GetFiledKey

func GetFiledKey(key string) FieldKey

func NewFiledKey

func NewFiledKey(item string, group ...string) FieldKey

type Group

type Group struct {
	Name      string    `yaml:"name"       json:"name"       mapstructure:"name"`
	DependsOn DependsOn `yaml:"depends_on" json:"depends_on" mapstructure:"depends_on"`
}

func NewGroup

func NewGroup(name string) *Group

func (*Group) Render

func (g *Group) Render(all map[FieldKey]huh.Field, fields []huh.Field) *huh.Group

func (*Group) Validate

func (g *Group) Validate() []error

type Interface

type Interface interface {
	huh.Field
	GetGroup() string
	Render()
	Validate() []error
}

type Parameter

type Parameter struct {
	huh.Field   `mapstructure:"-"`
	Name        string    `yaml:"name"        json:"name"        mapstructure:"name"`
	Group       string    `yaml:"group"       json:"group"       mapstructure:"group"`
	Label       string    `yaml:"label"       json:"label"       mapstructure:"label"`
	Description string    `yaml:"description" json:"description" mapstructure:"description"`
	Type        string    `yaml:"type"        json:"type"        mapstructure:"type"`
	DependsOn   DependsOn `yaml:"depends_on"  json:"depends_on"  mapstructure:"depends_on"`
}

func (*Parameter) GetGroup

func (p *Parameter) GetGroup() string

func (*Parameter) Render

func (p *Parameter) Render()

func (*Parameter) Validate

func (p *Parameter) Validate() []error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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