utils

package
v0.9.1-check-version Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MPL-2.0 Imports: 15 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 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 StringSliceToMapInterface

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

func StringToPointer

func StringToPointer(s string) *string

func StructToString added in v0.4.41

func StructToString(item interface{}) string

StructToString Make string from struct for example or documentation

func UpdateStructFromString added in v0.4.41

func UpdateStructFromString(item interface{}, value string) error

UpdateStructFromString Update struct from string by pattern key=value;

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