selector

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISelector

type ISelector interface {
	SelectItems() ([]*SelectorItem, error)
}

func AssetSelector

func AssetSelector(ghClient *api.RESTClient, repo string,
	releaseId int, name string, matcher string, interactive bool) (ISelector, error)

func BinarySelector

func BinarySelector(downloadPath string, name string, matcher string, interactive bool) (ISelector, error)

func ReleaseSelector

func ReleaseSelector(ghClient *api.RESTClient, repo string, version string, interactive bool) (ISelector, error)

type InteractiveSelector

type InteractiveSelector struct {
	Kind         string
	LastSelected int
	Items        []*SelectorItem
	Prompt       string
	Multiple     bool
}

func (*InteractiveSelector) SelectItems

func (s *InteractiveSelector) SelectItems() ([]*SelectorItem, error)

type PropertyPair

type PropertyPair struct {
	Key   string
	Value interface{}
}

func MakeProp

func MakeProp(key string, val interface{}) PropertyPair

type Selector

type Selector struct {
	Kind     string
	Items    []*SelectorItem
	Name     string
	Matcher  string
	Multiple bool
}

func (*Selector) SelectItems

func (s *Selector) SelectItems() ([]*SelectorItem, error)

type SelectorItem

type SelectorItem struct {
	Name       string
	Selected   bool
	Properties map[string]interface{}
}

selection item with collection of IProperty properties

func MakeSelectorItem

func MakeSelectorItem(name string, selected bool, properties ...PropertyPair) *SelectorItem

func (SelectorItem) GetProp

func (i SelectorItem) GetProp(key string) interface{}

func (SelectorItem) GetPropBool

func (i SelectorItem) GetPropBool(key string) bool

func (SelectorItem) GetPropFs

func (i SelectorItem) GetPropFs(key string) fs.FS

func (SelectorItem) GetPropInt

func (i SelectorItem) GetPropInt(key string) int

func (SelectorItem) GetPropStr

func (i SelectorItem) GetPropStr(key string) string

func (SelectorItem) SetProp

func (i SelectorItem) SetProp(key string, value interface{})

Jump to

Keyboard shortcuts

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