common

package
v0.4.11 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2020 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureCliCommands

func ConfigureCliCommands(context string, hc HasCommands, version string) (err error)

func Environ

func Environ() map[string]string

func GetObjectPathValue

func GetObjectPathValue(object interface{}, segments ...string) interface{}

func GuessOutputWidth

func GuessOutputWidth(w io.Writer) int

func IsTimeout

func IsTimeout(candidate error) bool

func SimplifyValue

func SimplifyValue(v reflect.Value) reflect.Value

func ToReadCloser

func ToReadCloser(reader io.Reader) io.ReadCloser

Types

type CliFactory

type CliFactory interface {
	ConfigureCliCommands(context string, hc HasCommands, version string) error
}

func RegisterCliFactory

func RegisterCliFactory(cliFactory CliFactory) CliFactory

type EvaluatingPartMatcher

type EvaluatingPartMatcher struct {
	// contains filtered or unexported fields
}

func NewEvaluatingPartMatcher

func NewEvaluatingPartMatcher(valueTemplate string, check string) (EvaluatingPartMatcher, error)

func ParseEvaluatingPartMatcher

func ParseEvaluatingPartMatcher(plain string) (EvaluatingPartMatcher, error)

func (EvaluatingPartMatcher) Matches

func (instance EvaluatingPartMatcher) Matches(data interface{}) (bool, error)

func (EvaluatingPartMatcher) String

func (instance EvaluatingPartMatcher) String() string

func (EvaluatingPartMatcher) Value

func (instance EvaluatingPartMatcher) Value(data interface{}) (string, error)

type EvaluatingPartPredicate

type EvaluatingPartPredicate []EvaluatingPartMatcher

func (EvaluatingPartPredicate) Matches

func (instance EvaluatingPartPredicate) Matches(data interface{}) (bool, error)

type EvaluatingPredicate

type EvaluatingPredicate struct {
	Includes EvaluatingPartPredicate
	Excludes EvaluatingPartPredicate
}

func (*EvaluatingPredicate) EvaluatePatterns

func (instance *EvaluatingPredicate) EvaluatePatterns(patterns []string) error

func (EvaluatingPredicate) MarshalJSON

func (instance EvaluatingPredicate) MarshalJSON() ([]byte, error)

func (EvaluatingPredicate) MarshalYAML

func (instance EvaluatingPredicate) MarshalYAML() (interface{}, error)

func (EvaluatingPredicate) Matches

func (instance EvaluatingPredicate) Matches(data interface{}) (bool, error)

func (EvaluatingPredicate) Patterns

func (instance EvaluatingPredicate) Patterns() []string

func (*EvaluatingPredicate) Set

func (instance *EvaluatingPredicate) Set(plain string) error

func (EvaluatingPredicate) String

func (instance EvaluatingPredicate) String() string

func (*EvaluatingPredicate) UnmarshalJSON

func (instance *EvaluatingPredicate) UnmarshalJSON(b []byte) error

func (*EvaluatingPredicate) UnmarshalYAML

func (instance *EvaluatingPredicate) UnmarshalYAML(unmarshal func(interface{}) error) error

type HasCommands

type HasCommands interface {
	Command(name, help string) *kingpin.CmdClause
}

type HasFlags

type HasFlags interface {
	Flag(name, help string) *kingpin.FlagClause
}

type Runnable

type Runnable interface {
	Run() error
}

type TimeoutError

type TimeoutError struct {
	Message string
}

func NewTimeoutError

func NewTimeoutError(message string, args ...interface{}) TimeoutError

func (TimeoutError) Error

func (instance TimeoutError) Error() string

func (TimeoutError) String

func (instance TimeoutError) String() string

Jump to

Keyboard shortcuts

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