utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: Apache-2.0, MIT Imports: 5 Imported by: 54

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssureBoolValue

func AssureBoolValue(mod bool, old bool, value bool) (bool, bool)

func AssureInt64PtrPtr

func AssureInt64PtrPtr(mod bool, old *int64, ptr *int64) (*int64, bool)

func AssureInt64PtrValue

func AssureInt64PtrValue(mod bool, old *int64, value int64) (*int64, bool)

func AssureInt64Value

func AssureInt64Value(mod bool, old int64, value int64) (int64, bool)

func AssureIntPtrValue

func AssureIntPtrValue(mod bool, old *int, value int) (*int, bool)

func AssureIntValue

func AssureIntValue(mod bool, old int, value int) (int, bool)

func AssureStringPtrPtr

func AssureStringPtrPtr(mod bool, old *string, ptr *string) (*string, bool)

func AssureStringPtrValue

func AssureStringPtrValue(mod bool, old *string, value string) (*string, bool)

func AssureStringSet

func AssureStringSet(mod bool, old []string, value StringSet) ([]string, bool)

func AssureStringValue

func AssureStringValue(mod bool, old string, value string) (string, bool)

func FillStringValue

func FillStringValue(msg string, variable *string, value string) error

func GlobMatcher

func GlobMatcher(s, p interface{}) bool

func Int64Equal

func Int64Equal(a, b *int64) bool

func Int64Value

func Int64Value(v *int64, def int64) int64

func IntEqual

func IntEqual(a, b *int) bool

func IsEmptyString

func IsEmptyString(s *string) bool

func IsNil

func IsNil(o interface{}) bool

func Match

func Match(s, p []interface{}, star interface{}, match func(interface{}, interface{}) bool) bool

func RuneMatcher

func RuneMatcher(s, p interface{}) bool

func Runes

func Runes(s string) (runes []interface{})

func SetValue

func SetValue(f reflect.Value, v interface{}) error

func StringEqual

func StringEqual(a, b *string) bool

func StringValue

func StringValue(s *string) string

func Strings

func Strings(s ...string) string

func TypeKey

func TypeKey(v interface{}) (reflect.Type, error)

Types

type Matcher

type Matcher interface {
	Match(s string) bool
}

func NewPathGlobMatcher

func NewPathGlobMatcher(pattern string) Matcher

func NewStringGlobMatcher

func NewStringGlobMatcher(pattern string) Matcher

func NewStringMatcher

func NewStringMatcher(s string) Matcher

type ModificationState

type ModificationState struct {
	Modified bool
}

func (*ModificationState) AssureBoolValue

func (this *ModificationState) AssureBoolValue(dst *bool, val bool) *ModificationState

func (*ModificationState) AssureInt64PtrPtr

func (this *ModificationState) AssureInt64PtrPtr(dst **int64, ptr *int64) *ModificationState

func (*ModificationState) AssureInt64PtrValue

func (this *ModificationState) AssureInt64PtrValue(dst **int64, val int64) *ModificationState

func (*ModificationState) AssureInt64Value

func (this *ModificationState) AssureInt64Value(dst *int64, val int64) *ModificationState

func (*ModificationState) AssureIntPtrValue

func (this *ModificationState) AssureIntPtrValue(dst **int, val int) *ModificationState

func (*ModificationState) AssureIntValue

func (this *ModificationState) AssureIntValue(dst *int, val int) *ModificationState

func (*ModificationState) AssureStringPtrPtr

func (this *ModificationState) AssureStringPtrPtr(dst **string, ptr *string) *ModificationState

func (*ModificationState) AssureStringPtrValue

func (this *ModificationState) AssureStringPtrValue(dst **string, val string) *ModificationState

func (*ModificationState) AssureStringSet

func (this *ModificationState) AssureStringSet(dst *[]string, val StringSet) *ModificationState

func (*ModificationState) AssureStringValue

func (this *ModificationState) AssureStringValue(dst *string, val string) *ModificationState

func (*ModificationState) IsModified

func (this *ModificationState) IsModified() bool

func (*ModificationState) Modify

func (this *ModificationState) Modify(m bool) *ModificationState

func (*ModificationState) OnModified

func (this *ModificationState) OnModified(f func() error) error

type Properties

type Properties map[string]string

func (Properties) Copy

func (this Properties) Copy() Properties

func (Properties) Equals

func (this Properties) Equals(t map[string]string) bool

func (Properties) Has

func (this Properties) Has(k string) bool

func (Properties) Keys

func (this Properties) Keys() StringSet

type StringSet

type StringSet map[string]struct{}

func NewStringSet

func NewStringSet(a ...string) StringSet

func NewStringSetByArray

func NewStringSetByArray(a []string) StringSet

func NewStringSetBySets

func NewStringSetBySets(sets ...StringSet) StringSet

func (StringSet) Add

func (this StringSet) Add(n ...string) StringSet

func (StringSet) AddAll

func (this StringSet) AddAll(n []string) StringSet

func (StringSet) AddAllSplitted

func (this StringSet) AddAllSplitted(n string) StringSet

func (StringSet) AddSet

func (this StringSet) AddSet(sets ...StringSet) StringSet

func (StringSet) AsArray

func (this StringSet) AsArray() []string

func (StringSet) Clear

func (this StringSet) Clear()

func (StringSet) Contains

func (this StringSet) Contains(n string) bool

func (StringSet) Copy

func (this StringSet) Copy() StringSet

func (StringSet) DiffFrom

func (this StringSet) DiffFrom(set StringSet) (add, del StringSet)

func (StringSet) Equals

func (this StringSet) Equals(set StringSet) bool

func (StringSet) Remove

func (this StringSet) Remove(n string) StringSet

func (StringSet) String

func (this StringSet) String() string

type Versioned

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

Versioned maintains a set of provided object versions and yields the best such version for given required version.

func NewVersioned

func NewVersioned(proto interface{}) *Versioned

func (*Versioned) GetFor

func (this *Versioned) GetFor(req *semver.Version) interface{}

func (*Versioned) MustRegisterVersion

func (this *Versioned) MustRegisterVersion(v *semver.Version, obj interface{})

func (*Versioned) RegisterVersion

func (this *Versioned) RegisterVersion(v *semver.Version, obj interface{}) error

func (*Versioned) SetDefault

func (this *Versioned) SetDefault(obj interface{}) error

Jump to

Keyboard shortcuts

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