utils

package
v0.4.31 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2021 License: MPL-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToPointer

func BoolToPointer(b bool) *bool

func CheckYamlFile

func CheckYamlFile(filename string) (content []byte, err error)

func FileExists

func FileExists(filename string) (bool, error)

func GetAbsPath

func GetAbsPath(filename string) (string, error)

func GetEnumStringSliceValue

func GetEnumStringSliceValue(c *cli.Context, name string) []string

func GetItemsByIDs

func GetItemsByIDs(items []string, getter func(item string) (Item, error)) chan Result

func IntFromIndex

func IntFromIndex(content []int, idx int, defaultValue int) int

func IntToPointer

func IntToPointer(i int) *int

func ReadFile

func ReadFile(filename string) ([]byte, error)

func ShowResults

func ShowResults(input interface{}, format string)

func StringFromIndex

func StringFromIndex(content []string, idx int, defaultValue string) string

func StringSliceToMap

func StringSliceToMap(slice []string) (map[string]string, error)

func StringSliceToMapInterface

func StringSliceToMapInterface(slice []string) (map[string]interface{}, error)

func StringSliceToMapNil

func StringSliceToMapNil(slice []string) (*map[string]string, error)

func StringToPointer

func StringToPointer(s string) *string

func ValidateEqualSlicesLength

func ValidateEqualSlicesLength(slices ...interface{}) error

func WaitTaskAndShowResult

func WaitTaskAndShowResult(
	c *cli.Context,
	client *gcorecloud.ServiceClient,
	results *tasks.TaskResults,
	stopOnTaskError bool,
	infoRetriever tasks.RetrieveTaskResult,
) error

func WriteToFile

func WriteToFile(filename string, content []byte) error

Types

type EnumStringSliceValue

type EnumStringSliceValue struct {
	Enum    []string
	Default string
	// contains filtered or unexported fields
}

func (EnumStringSliceValue) Get

func (e EnumStringSliceValue) Get() interface{}

Get returns the slice of strings set by this flag

func (EnumStringSliceValue) Serialize

func (e EnumStringSliceValue) Serialize() string

Serialize allows EnumStringSliceValue to fulfill Serializer

func (*EnumStringSliceValue) Set

func (e *EnumStringSliceValue) Set(value string) error

func (EnumStringSliceValue) String

func (e EnumStringSliceValue) String() string

func (EnumStringSliceValue) Value

func (e EnumStringSliceValue) Value() []string

Value returns the slice of strings set by this flag

type EnumValue

type EnumValue struct {
	Enum        []string
	Default     string
	Destination *string
	// contains filtered or unexported fields
}

func (*EnumValue) Set

func (e *EnumValue) Set(value string) error

func (EnumValue) String

func (e EnumValue) String() string

type Item

type Item interface {
}

type Result

type Result struct {
	Item    Item
	Request string
	Err     error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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