value

package
v0.7.12 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrIllegalFqdn = errors.New("illegal fqdn")
)

Functions

This section is empty.

Types

type Bool

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

func False

func False() Bool

func True

func True() Bool

func UndefinedBool

func UndefinedBool() Bool

func (Bool) Get

func (this Bool) Get() bool

func (Bool) GetOr

func (this Bool) GetOr(def bool) bool

func (Bool) IsPresent

func (this Bool) IsPresent() bool

func (*Bool) Set

func (this *Bool) Set(plain string) error

func (Bool) String

func (this Bool) String() string

type Duration

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

func NewDuration added in v0.7.0

func NewDuration(value time.Duration) Duration

func ParseDuration

func ParseDuration(plain string) (result Duration, err error)

func (Duration) AsSeconds

func (this Duration) AsSeconds() int

func (Duration) Get

func (this Duration) Get() time.Duration

func (Duration) GetOr added in v0.7.0

func (this Duration) GetOr(def time.Duration) time.Duration

func (Duration) IsPresent

func (this Duration) IsPresent() bool

func (*Duration) Set

func (this *Duration) Set(plain string) error

func (Duration) String

func (this Duration) String() string

type Forcible

type Forcible[V Value[T], T any, MV Mutable[V]] struct {
	// contains filtered or unexported fields
}

func NewForcible

func NewForcible[V Value[T], T any, MV Mutable[V]](value V, forced bool) Forcible[V, T, MV]

func (Forcible[V, T, MV]) Evaluate

func (this Forcible[V, T, MV]) Evaluate(other V) V

func (Forcible[V, T, MV]) EvaluateOr added in v0.7.0

func (this Forcible[V, T, MV]) EvaluateOr(other V, def V) V

func (Forcible[V, T, MV]) Get

func (this Forcible[V, T, MV]) Get() T

func (Forcible[V, T, MV]) GetOr added in v0.7.0

func (this Forcible[V, T, MV]) GetOr(def T) T

func (Forcible[V, T, MV]) IsForced

func (this Forcible[V, T, MV]) IsForced() bool

func (Forcible[V, T, MV]) IsPresent

func (this Forcible[V, T, MV]) IsPresent() bool

func (Forcible[V, T, MV]) Select

func (this Forcible[V, T, MV]) Select(target Forcible[V, T, MV]) Forcible[V, T, MV]

func (*Forcible[V, T, MV]) Set

func (this *Forcible[V, T, MV]) Set(plain string) error

func (Forcible[V, T, MV]) String

func (this Forcible[V, T, MV]) String() string

type ForcibleBool

type ForcibleBool struct {
	Forcible[Bool, bool, *Bool]
}

func NewForcibleBool

func NewForcibleBool(init Bool, forced bool) ForcibleBool

func (ForcibleBool) Select

func (this ForcibleBool) Select(target ForcibleBool) ForcibleBool

type ForcibleDuration

type ForcibleDuration struct {
	Forcible[Duration, time.Duration, *Duration]
}

func NewForcibleDuration

func NewForcibleDuration(init Duration, forced bool) ForcibleDuration

func (ForcibleDuration) Select added in v0.7.0

type ForcibleString

type ForcibleString struct {
	Forcible[String, string, *String]
}

func NewForcibleString

func NewForcibleString(init String, forced bool) ForcibleString

func (ForcibleString) Select added in v0.7.0

func (this ForcibleString) Select(target ForcibleString) ForcibleString

type Fqdn

type Fqdn string

func (Fqdn) Get

func (this Fqdn) Get() interface{}

func (Fqdn) IsPresent

func (this Fqdn) IsPresent() bool

func (Fqdn) MarshalText

func (this Fqdn) MarshalText() (text []byte, err error)

func (Fqdn) Parent

func (this Fqdn) Parent() Fqdn

func (*Fqdn) Set

func (this *Fqdn) Set(plain string) error

func (Fqdn) String

func (this Fqdn) String() string

func (*Fqdn) UnmarshalText

func (this *Fqdn) UnmarshalText(b []byte) error

type Fqdns added in v0.7.0

type Fqdns []Fqdn

func (Fqdns) String added in v0.7.0

func (this Fqdns) String() string

func (Fqdns) Strings added in v0.7.0

func (this Fqdns) Strings() []string
type Header struct {
	Key    string
	Value  string
	Forced bool
	Add    bool
	Del    bool
}

func (*Header) Set added in v0.7.0

func (this *Header) Set(plain string) error

func (Header) String added in v0.7.0

func (this Header) String() string

type Headers added in v0.7.0

type Headers []Header

func (*Headers) IsCumulative added in v0.7.0

func (this *Headers) IsCumulative() bool

func (*Headers) Set added in v0.7.0

func (this *Headers) Set(plain string) error

func (Headers) String added in v0.7.0

func (this Headers) String() string

type Mutable added in v0.7.0

type Mutable[T any] interface {
	Set(string) error
	*T
}

type String

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

func (String) Get

func (this String) Get() string

func (String) GetOr added in v0.7.0

func (this String) GetOr(def string) string

func (String) IsPresent

func (this String) IsPresent() bool

func (*String) Set

func (this *String) Set(plain string) error

func (String) String

func (this String) String() string

type Value

type Value[T any] interface {
	String() string
	IsPresent() bool
	GetOr(def T) T
	Get() T
}

type WildcardSupportingFqdn

type WildcardSupportingFqdn Fqdn

func (WildcardSupportingFqdn) Get

func (this WildcardSupportingFqdn) Get() interface{}

func (WildcardSupportingFqdn) IsPresent

func (this WildcardSupportingFqdn) IsPresent() bool

func (WildcardSupportingFqdn) MarshalText

func (this WildcardSupportingFqdn) MarshalText() (text []byte, err error)

func (*WildcardSupportingFqdn) Set

func (this *WildcardSupportingFqdn) Set(plain string) error

func (WildcardSupportingFqdn) String

func (this WildcardSupportingFqdn) String() string

func (*WildcardSupportingFqdn) UnmarshalText

func (this *WildcardSupportingFqdn) UnmarshalText(b []byte) error

func (WildcardSupportingFqdn) WithoutWildcard

func (this WildcardSupportingFqdn) WithoutWildcard() (hadWildcard bool, withoutWildcard Fqdn, err error)

type WildcardSupportingFqdns added in v0.7.0

type WildcardSupportingFqdns []WildcardSupportingFqdn

func (WildcardSupportingFqdns) String added in v0.7.0

func (this WildcardSupportingFqdns) String() string

func (WildcardSupportingFqdns) Strings added in v0.7.0

func (this WildcardSupportingFqdns) Strings() []string

Jump to

Keyboard shortcuts

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