conditions

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

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

Condition reflects a dedicated condition for a dedicated object. It can be retrieved for a dedicated object using a ConditionType object.

func (*Condition) AddModificationHandler

func (this *Condition) AddModificationHandler(h ModificationHandler)

func (*Condition) Assure

func (this *Condition) Assure() error

func (*Condition) AssureInterface

func (this *Condition) AssureInterface() interface{}

func (*Condition) Delete

func (this *Condition) Delete() (bool, error)

func (*Condition) Get

func (this *Condition) Get(name string) interface{}

func (*Condition) GetLastUpdateTime

func (this *Condition) GetLastUpdateTime() time.Time

func (*Condition) GetMessage

func (this *Condition) GetMessage() string

func (*Condition) GetReason

func (this *Condition) GetReason() string

func (*Condition) GetStatus

func (this *Condition) GetStatus() string

func (*Condition) GetStringField

func (this *Condition) GetStringField(name string) string

func (*Condition) GetTimeField

func (this *Condition) GetTimeField(name string) time.Time

func (*Condition) GetTransitionTime

func (this *Condition) GetTransitionTime() time.Time

func (*Condition) Has

func (this *Condition) Has() bool

func (*Condition) Interface

func (this *Condition) Interface() interface{}

func (*Condition) IsModified

func (this *Condition) IsModified() bool

func (*Condition) Modify

func (this *Condition) Modify(m bool)

func (*Condition) Name

func (this *Condition) Name() string

func (*Condition) RemoveModificationHandler

func (this *Condition) RemoveModificationHandler(h ModificationHandler)

func (*Condition) ResetModified

func (this *Condition) ResetModified()

func (*Condition) Set

func (this *Condition) Set(name string, value interface{}) error

func (*Condition) SetLastUpdateTime

func (this *Condition) SetLastUpdateTime(v time.Time) error

func (*Condition) SetMessage

func (this *Condition) SetMessage(v string) error

func (*Condition) SetReason

func (this *Condition) SetReason(v string) error

func (*Condition) SetStatus

func (this *Condition) SetStatus(v string) error

func (*Condition) SetTransitionTime

func (this *Condition) SetTransitionTime(v time.Time) error

type ConditionLayout

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

ConditionLayout represents a dedicated kind of condition layout for a dedicated class of condition carrying objects. Therefore it holds field name information to to access conditions in this class of objects and about the representation of some standard field like Type and Status inside a condition entry. A ConditionType is configured using an arbitrary set of TweakFunctions. There are dedicated creator functions for all modifyable attributes.

func NewConditionLayout

func NewConditionLayout(cfg ...TweakFunction) *ConditionLayout

func (*ConditionLayout) For

func (this *ConditionLayout) For(o interface{}) (*Conditions, error)

func (*ConditionLayout) Types

func (this *ConditionLayout) Types(o interface{}) utils.StringSet

type ConditionType

type ConditionType struct {
	*ConditionLayout
	// contains filtered or unexported fields
}

ConditionType represents a dedicated kind of condition for a dedicated class of condition carrying objects using a dedicated condition layout. Therefore is is configured by a name for the dedicated condition kind a condition layout.

func NewConditionType

func NewConditionType(name string, t *ConditionLayout) *ConditionType

func (*ConditionType) Assure

func (this *ConditionType) Assure(o interface{}) *Condition

func (*ConditionType) AssureInterface

func (this *ConditionType) AssureInterface(o interface{}) interface{}

func (*ConditionType) DeleteCondition

func (this *ConditionType) DeleteCondition(o interface{}) bool

func (*ConditionType) Get

func (this *ConditionType) Get(o interface{}) *Condition

func (*ConditionType) GetInterface

func (this *ConditionType) GetInterface(o interface{}) interface{}

func (*ConditionType) GetLastUpdateTime

func (this *ConditionType) GetLastUpdateTime(o interface{}) time.Time

func (*ConditionType) GetMessage

func (this *ConditionType) GetMessage(o interface{}) string

func (*ConditionType) GetReason

func (this *ConditionType) GetReason(o interface{}) string

func (*ConditionType) GetStatus

func (this *ConditionType) GetStatus(o interface{}) string

func (*ConditionType) GetStringField

func (this *ConditionType) GetStringField(o interface{}, name string) string

func (*ConditionType) GetTimeField

func (this *ConditionType) GetTimeField(o interface{}, name string) time.Time

func (*ConditionType) GetTransitionTime

func (this *ConditionType) GetTransitionTime(o interface{}) time.Time

func (*ConditionType) GetValue

func (this *ConditionType) GetValue(o interface{}, name string) interface{}

func (*ConditionType) Has

func (this *ConditionType) Has(o interface{}) bool

func (*ConditionType) Name

func (this *ConditionType) Name() string

func (*ConditionType) SetLastUpdateTime

func (this *ConditionType) SetLastUpdateTime(o interface{}, v time.Time) error

func (*ConditionType) SetMessage

func (this *ConditionType) SetMessage(o interface{}, v string) error

func (*ConditionType) SetReason

func (this *ConditionType) SetReason(o interface{}, v string) error

func (*ConditionType) SetStatus

func (this *ConditionType) SetStatus(o interface{}, v string) error

func (*ConditionType) SetTransitionTime

func (this *ConditionType) SetTransitionTime(o interface{}, v time.Time) error

func (*ConditionType) SetValue

func (this *ConditionType) SetValue(o interface{}, name string, value interface{}) error

type Conditions

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

func (*Conditions) AddModificationHandler

func (this *Conditions) AddModificationHandler(h ModificationHandler)

func (*Conditions) Delete

func (this *Conditions) Delete(name string) bool

func (*Conditions) Get

func (this *Conditions) Get(name string) *Condition

func (*Conditions) GetLastUpdateTime

func (this *Conditions) GetLastUpdateTime(ctype string) time.Time

func (*Conditions) GetMessage

func (this *Conditions) GetMessage(ctype string) string

func (*Conditions) GetReason

func (this *Conditions) GetReason(ctype string) string

func (*Conditions) GetStatus

func (this *Conditions) GetStatus(ctype string) string

func (*Conditions) GetStringField

func (this *Conditions) GetStringField(ctype, name string) string

func (*Conditions) GetTimeField

func (this *Conditions) GetTimeField(ctype string, name string) time.Time

func (*Conditions) GetTransitionTime

func (this *Conditions) GetTransitionTime(ctype string) time.Time

func (*Conditions) GetValue

func (this *Conditions) GetValue(ctype, name string) interface{}

func (*Conditions) IsModified

func (this *Conditions) IsModified() bool

func (*Conditions) Modify

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

func (*Conditions) RemoveModificationHandler

func (this *Conditions) RemoveModificationHandler(h ModificationHandler)

func (*Conditions) ResetModified

func (this *Conditions) ResetModified() bool

func (*Conditions) SetLastUpdateTime

func (this *Conditions) SetLastUpdateTime(ctype string, v time.Time) error

func (*Conditions) SetMessage

func (this *Conditions) SetMessage(ctype, v string) error

func (*Conditions) SetReason

func (this *Conditions) SetReason(ctype, v string) error

func (*Conditions) SetStatus

func (this *Conditions) SetStatus(ctype, v string) error

func (*Conditions) SetTransitionTime

func (this *Conditions) SetTransitionTime(ctype string, v time.Time) error

func (*Conditions) SetValue

func (this *Conditions) SetValue(ctype, name string, value interface{}) error

func (*Conditions) Types

func (this *Conditions) Types() utils.StringSet

type ModificationHandler

type ModificationHandler interface {
	Modified(*Condition)
}

type ModificationHandlers

type ModificationHandlers []ModificationHandler

type TweakFunction

type TweakFunction func(c *ConditionLayout)

TweakFunction is used to configure a ConditionType for a dedicated class of objects

func ConditionsField

func ConditionsField(field string) TweakFunction

func Inherit

func Inherit(b *ConditionLayout) TweakFunction

func LastUpdateTimeField

func LastUpdateTimeField(field string) TweakFunction

func MessageField

func MessageField(field string) TweakFunction

func ObjectStatusField

func ObjectStatusField(field string) TweakFunction

func ReasonField

func ReasonField(field string) TweakFunction

func StatusField

func StatusField(field string) TweakFunction

func TransitionTimeField

func TransitionTimeField(field string) TweakFunction

func TypeField

func TypeField(field string) TweakFunction

Jump to

Keyboard shortcuts

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