types

package
v0.0.0-...-6a708a1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StringBool0                    = "0"
	StringBool1                    = "1"
	StringBoolFalseFirstCapital    = "False"
	StringBoolFalseLowercase       = "false"
	StringBoolTrueFirstCapital     = "True"
	StringBoolTrueLowercase        = "true"
	StringBoolNoFirstCapital       = "No"
	StringBoolNoLowercase          = "no"
	StringBoolYesFirstCapital      = "Yes"
	StringBoolYesLowercase         = "yes"
	StringBoolOffFirstCapital      = "Off"
	StringBoolOffLowercase         = "off"
	StringBoolOnFirstCapital       = "On"
	StringBoolOnLowercase          = "on"
	StringBoolDisableFirstCapital  = "Disable"
	StringBoolDisableLowercase     = "disable"
	StringBoolEnableFirstCapital   = "Enable"
	StringBoolEnableLowercase      = "enable"
	StringBoolDisabledFirstCapital = "Disabled"
	StringBoolDisabledLowercase    = "disabled"
	StringBoolEnabledFirstCapital  = "Enabled"
	StringBoolEnabledLowercase     = "enabled"
)

Set of string boolean constants

View Source
const (
	// PortMayBeAssignedLaterOrLeftUnused value means that port
	// is not assigned yet and is expected to be assigned later.
	PortMayBeAssignedLaterOrLeftUnused = int32(0)
)

Variables

This section is empty.

Functions

func IsPortAssigned

func IsPortAssigned(port int32) bool

IsPortAssigned checks whether port is assigned

func IsPortInvalid

func IsPortInvalid(port int32) bool

IsPortInvalid checks whether port is invalid

func IsPortUnassigned

func IsPortUnassigned(port int32) bool

IsPortUnassigned checks whether port is unassigned

func PortUnassigned

func PortUnassigned() int32

PortUnassigned returns value for unassigned port

Types

type CopyCROptions

type CopyCROptions struct {
	// SkipStatus specifies whether to copy status
	SkipStatus bool
	// SkipManagedFields specifies whether to copy managed fields
	SkipManagedFields bool
}

CopyCROptions specifies options for custom resource copier

type CopyStatusField

type CopyStatusField struct {
	Copy  Status
	Merge Status
}

type CopyStatusFieldGroup

type CopyStatusFieldGroup struct {
	FieldGroupActions     bool
	FieldGroupErrors      bool
	FieldGroupNormalized  bool
	FieldGroupMain        bool
	FieldGroupWholeStatus bool
	FieldGroupInheritable bool
}

type CopyStatusOptions

type CopyStatusOptions struct {
	CopyStatusFieldGroup
	CopyStatusField
}

CopyStatusOptions specifies what parts to copy in status

type CycleAddress

type CycleAddress struct {
	// CycleIndex specifies index of the cycle within something bigger
	CycleIndex int
	// Index specifies index within the cycle
	Index int
}

CycleAddress defines cycle address of an entity

func NewCycleAddress

func NewCycleAddress() *CycleAddress

NewCycleAddress creates new CycleAddress

func (*CycleAddress) Inc

func (s *CycleAddress) Inc(spec *CycleSpec)

Inc increases the CycleAddress

func (*CycleAddress) Init

func (s *CycleAddress) Init()

Init initializes the CycleAddress

type CycleSpec

type CycleSpec struct {
	// Size specifies size of a cycle
	Size int
}

CycleSpec defines spec of a cycle, such as size

func NewCycleSpec

func NewCycleSpec(size int) *CycleSpec

NewCycleSpec creates new CycleSpec

func (*CycleSpec) IsValid

func (s *CycleSpec) IsValid() bool

IsValid specifies whether spec is a valid one

type HostScopeAddress

type HostScopeAddress struct {
	// CRScopeAddress specifies address of a host within CHI scope
	CRScopeAddress *ScopeAddress
	// ClusterScopeAddress specifies address of a host within cluster scope
	ClusterScopeAddress *ScopeAddress
	// ClusterIndex specifies index of a cluster within CHI
	ClusterIndex int
	// ShardIndex specifies index of a shard within cluster
	ShardIndex int
	// ReplicaIndex specifies index of a replica within cluster
	ReplicaIndex int
}

HostScopeAddress specifies address of a host

func NewHostScopeAddress

func NewHostScopeAddress(crScopeCycleSize, clusterScopeCycleSize int) (a *HostScopeAddress)

NewHostScopeAddress creates new HostScopeAddress

type Int32

type Int32 int32

Int32 defines int32 representation with possibility to be optional

func EnsurePortValue

func EnsurePortValue(port, value, _default *Int32) *Int32

EnsurePortValue ensures port either: - already has own value assigned - or has provided value - or value is fell back to default

func NewInt32

func NewInt32(i int32) *Int32

NewInt32 creates new variable

func (*Int32) Equal

func (i *Int32) Equal(to *Int32) bool

Equal checks whether is equal to another

func (*Int32) EqualValue

func (i *Int32) EqualValue(to *Int32) bool

EqualValue checks whether has equal values

func (*Int32) From

func (i *Int32) From(value int32) *Int32

From casts int32

func (*Int32) HasValue

func (i *Int32) HasValue() bool

HasValue checks whether value is specified

func (*Int32) IntValue

func (i *Int32) IntValue() int

IntValue returns int value

func (*Int32) IsValid

func (i *Int32) IsValid() bool

IsValid checks whether var has a proper value

func (*Int32) MergeFrom

func (i *Int32) MergeFrom(from *Int32) *Int32

MergeFrom merges value from another variable

func (*Int32) Normalize

func (i *Int32) Normalize(defaultValue int32) *Int32

Normalize normalizes value with fallback to defaultValue in case initial value is incorrect

func (*Int32) String

func (i *Int32) String() string

String casts to a string

func (*Int32) Value

func (i *Int32) Value() int32

Value returns value

type List

type List map[string]string

func (List) Get

func (l List) Get(name string) string

type Matchable

type Matchable string

Matchable defines string that can be matched against another string

func (*Matchable) Match

func (m *Matchable) Match(str string) bool

Match checks whether provided string matches this matchable

type ScopeAddress

type ScopeAddress struct {
	// CycleSpec specifies cycle which to be used to specify CycleAddress
	CycleSpec *CycleSpec
	// CycleAddress specifies CycleAddress within the scope
	CycleAddress *CycleAddress
	// Index specifies index within the scope
	Index int
}

ScopeAddress defines scope address of an entity

func NewScopeAddress

func NewScopeAddress(cycleSize int) *ScopeAddress

NewScopeAddress creates new ScopeAddress

func (*ScopeAddress) Inc

func (s *ScopeAddress) Inc()

Inc increases the ScopeAddress

func (*ScopeAddress) Init

func (s *ScopeAddress) Init()

Init initializes the ScopeAddress

type Status

type Status struct {
	CHOpVersion            bool
	CHOpCommit             bool
	CHOpDate               bool
	CHOpIP                 bool
	ClustersCount          bool
	ShardsCount            bool
	ReplicasCount          bool
	HostsCount             bool
	Status                 bool
	TaskID                 bool
	TaskIDsStarted         bool
	TaskIDsCompleted       bool
	Action                 bool
	Actions                bool
	Error                  bool
	Errors                 bool
	HostsUpdatedCount      bool
	HostsAddedCount        bool
	HostsUnchangedCount    bool
	HostsFailedCount       bool
	HostsCompletedCount    bool
	HostsDeletedCount      bool
	HostsDeleteCount       bool
	Pods                   bool
	PodIPs                 bool
	FQDNs                  bool
	Endpoint               bool
	NormalizedCR           bool
	NormalizedCRCompleted  bool
	HostsWithTablesCreated bool
	UsedTemplates          bool
}

type String

type String string

String defines string representation with possibility to be optional

func NewString

func NewString(str string) *String

NewString creates new variable

func (*String) From

func (s *String) From(value string) *String

From casts string

func (*String) HasValue

func (s *String) HasValue() bool

HasValue checks whether value is specified

func (*String) IsValid

func (s *String) IsValid() bool

IsValid checks whether var has a proper value

func (*String) MergeFrom

func (s *String) MergeFrom(from *String) *String

MergeFrom merges value from another variable

func (*String) Normalize

func (s *String) Normalize(defaultValue string) *String

Normalize normalizes value with fallback to defaultValue in case initial value is incorrect

func (*String) String

func (s *String) String() string

String casts to a string

func (*String) Value

func (s *String) Value() string

Value returns value

type StringBool

type StringBool string

StringBool defines string representation of a bool type

func NewStringBool

func NewStringBool(value ...bool) *StringBool

NewStringBool creates new StringBool variable with optional value

func (*StringBool) CastTo01

func (s *StringBool) CastTo01(defaultValue bool) string

CastTo01 casts string-bool into string "0"/"1"

func (*StringBool) CastToStringTrueFalse

func (s *StringBool) CastToStringTrueFalse(defaultValue bool) string

CastToStringTrueFalse casts string-bool into string "true"/"false"

func (*StringBool) From

func (s *StringBool) From(value bool) *StringBool

From casts bool to a StringBool

func (*StringBool) HasValue

func (s *StringBool) HasValue() bool

HasValue checks whether value is specified

func (*StringBool) IsFalse

func (s *StringBool) IsFalse() bool

IsFalse checks whether str is a string as bool "false" value

func (*StringBool) IsTrue

func (s *StringBool) IsTrue() bool

IsTrue checks whether str is a string as bool "true" value

func (*StringBool) IsValid

func (s *StringBool) IsValid() bool

IsValid checks whether StringBool has a proper value

func (*StringBool) MergeFrom

func (s *StringBool) MergeFrom(from *StringBool) *StringBool

MergeFrom merges value from another variable

func (*StringBool) Normalize

func (s *StringBool) Normalize(defaultValue bool) *StringBool

Normalize normalizes StringBool value with fallback to defaultValue in case initial value is incorrect

func (*StringBool) String

func (s *StringBool) String() string

String casts StringBool to a string

func (*StringBool) Value

func (s *StringBool) Value() bool

Value returns bool value

type UpdateStatusOptions

type UpdateStatusOptions struct {
	CopyStatusOptions
	TolerateAbsence bool
}

UpdateStatusOptions defines how to update CHI status

Jump to

Keyboard shortcuts

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