value

package
v1.11.2 Latest Latest
Warning

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

Go to latest
Published: Oct 18, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Null = &null{}

Functions

func Unwrap

func Unwrap[T ValueTypes](v Value) T

Types

type Acl

type Acl struct {
	Value   *ast.AclDeclaration
	Literal bool
}

func (*Acl) Copy

func (v *Acl) Copy() Value

func (*Acl) IsLiteral

func (v *Acl) IsLiteral() bool

func (*Acl) String

func (v *Acl) String() string

func (*Acl) Type

func (v *Acl) Type() Type

type Backend

type Backend struct {
	Value    *ast.BackendDeclaration
	Director *DirectorConfig // wrap director as Backend
	Literal  bool
	Healthy  *atomic.Bool
}

func (*Backend) Copy

func (v *Backend) Copy() Value

func (*Backend) IsLiteral

func (v *Backend) IsLiteral() bool

func (*Backend) String

func (v *Backend) String() string

func (*Backend) Type

func (v *Backend) Type() Type

type Boolean

type Boolean struct {
	Value    bool
	Literal  bool
	IsNotSet bool
}

func (*Boolean) Copy

func (v *Boolean) Copy() Value

func (*Boolean) IsLiteral

func (v *Boolean) IsLiteral() bool

func (*Boolean) String

func (v *Boolean) String() string

func (*Boolean) Type

func (v *Boolean) Type() Type

type DirectorConfig

type DirectorConfig struct {
	Type          string // director type
	Name          string // director name
	Quorum        int    // only exists on random, hash, client and chash
	Retries       int    // only exists on random
	Key           string // only exists on chash
	Seed          uint32 // only exists on chash
	VNodesPerNode int    // only exists on chash
	Backends      []*DirectorConfigBackend
}

type DirectorConfigBackend

type DirectorConfigBackend struct {
	Backend *Backend
	Id      string
	Weight  int
}

type Float

type Float struct {
	Value         float64
	Literal       bool
	IsNAN         bool
	IsNegativeInf bool
	IsPositiveInf bool
	IsNotSet      bool
}

func (*Float) Copy

func (v *Float) Copy() Value

func (*Float) IsLiteral

func (v *Float) IsLiteral() bool

func (*Float) String

func (v *Float) String() string

func (*Float) Type

func (v *Float) Type() Type

type IP

type IP struct {
	Value    net.IP
	Literal  bool
	IsNotSet bool
}

func (*IP) Copy

func (v *IP) Copy() Value

func (*IP) IsLiteral

func (v *IP) IsLiteral() bool

func (*IP) String

func (v *IP) String() string

func (*IP) Type

func (v *IP) Type() Type

type Ident

type Ident struct {
	Value   string
	Literal bool
}

func (*Ident) Copy

func (v *Ident) Copy() Value

func (*Ident) IsLiteral

func (v *Ident) IsLiteral() bool

func (*Ident) String

func (v *Ident) String() string

func (*Ident) Type

func (v *Ident) Type() Type

type Integer

type Integer struct {
	Value         int64
	Literal       bool
	IsNAN         bool
	IsNegativeInf bool
	IsPositiveInf bool
	IsNotSet      bool
}

func (*Integer) Copy

func (v *Integer) Copy() Value

func (*Integer) IsLiteral

func (v *Integer) IsLiteral() bool

func (*Integer) String

func (v *Integer) String() string

func (*Integer) Type

func (v *Integer) Type() Type

type RTime

type RTime struct {
	Value    time.Duration
	Literal  bool
	IsNotSet bool
}

func (*RTime) Copy

func (v *RTime) Copy() Value

func (*RTime) IsLiteral

func (v *RTime) IsLiteral() bool

func (*RTime) String

func (v *RTime) String() string

func (*RTime) Type

func (v *RTime) Type() Type

type String

type String struct {
	Value      string
	Literal    bool
	IsNotSet   bool
	Collection []string // collection is used for multiple header values. e.g Cookie
}

func (*String) Copy

func (v *String) Copy() Value

func (*String) IsLiteral

func (v *String) IsLiteral() bool

func (*String) String

func (v *String) String() string

func (*String) Type

func (v *String) Type() Type

type Time

type Time struct {
	Value       time.Time
	OutOfBounds bool
	IsNotSet    bool
}

func (*Time) Copy

func (v *Time) Copy() Value

func (*Time) IsLiteral

func (v *Time) IsLiteral() bool

func (*Time) String

func (v *Time) String() string

func (*Time) Type

func (v *Time) Type() Type

type Type

type Type string
const (
	NullType    Type = "NULL"
	IdentType   Type = "IDENT"
	IntegerType Type = "INTEGER"
	FloatType   Type = "FLOAT"
	StringType  Type = "STRING"
	BooleanType Type = "BOOL"
	RTimeType   Type = "RTIME"
	TimeType    Type = "TIME"
	IpType      Type = "IP"
	BackendType Type = "BACKEND"
	AclType     Type = "ACL"
)

type Value

type Value interface {
	Type() Type
	String() string
	Copy() Value
	IsLiteral() bool
}

type ValueTypes

type ValueTypes interface {
	*Ident | *String | *Integer | *Float | *Boolean | *IP | *RTime | *Time | *Backend | *Acl
}

Jump to

Keyboard shortcuts

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