Help us shape the future of Go! Take the 2026 Go Developer Survey

awgparam

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Oct 8, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package awgparam implements the scalar-or-range values used by the pinned AmneziaWG configuration contract.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type U16Range

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

U16Range is an inclusive scalar-or-range value with uint16 endpoints. Its zero value is the scalar zero. The type is comparable so it can be used directly in reconciliation and drift comparisons.

func NewU16Range

func NewU16Range(low, high uint16) (U16Range, error)

NewU16Range constructs an inclusive uint16 range.

func ParseU16Range

func ParseU16Range(text string) (U16Range, error)

ParseU16Range parses the canonical N or N-M syntax without accepting signs, whitespace, alternate bases, or endpoints outside uint16.

func ScalarU16

func ScalarU16(value uint16) U16Range

ScalarU16 constructs a scalar uint16 range.

func (U16Range) High

func (r U16Range) High() uint16

High returns the inclusive upper endpoint.

func (U16Range) IsZero

func (r U16Range) IsZero() bool

IsZero reports whether both endpoints are zero.

func (U16Range) Low

func (r U16Range) Low() uint16

Low returns the inclusive lower endpoint.

func (U16Range) MarshalJSON

func (r U16Range) MarshalJSON() ([]byte, error)

MarshalJSON encodes a scalar as a JSON number and a true range as a string.

func (U16Range) Overlaps

func (r U16Range) Overlaps(other U16Range) bool

Overlaps reports whether two closed intervals intersect.

func (*U16Range) Scan

func (r *U16Range) Scan(src any) error

Scan implements sql.Scanner. It accepts legacy SQLite integers and the canonical text representation. NULL and empty text map to the zero value.

func (U16Range) String

func (r U16Range) String() string

String returns canonical N or N-M syntax.

func (*U16Range) UnmarshalJSON

func (r *U16Range) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts a JSON integer or a quoted canonical scalar/range.

func (U16Range) Value

func (r U16Range) Value() (driver.Value, error)

Value implements driver.Valuer using canonical text. The zero value is stored as empty text so it matches the canonical unset database default.

type U32Range

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

U32Range is an inclusive scalar-or-range value with uint32 endpoints. Its zero value is the scalar zero. The type is comparable so it can be used directly in reconciliation and drift comparisons.

func NewU32Range

func NewU32Range(low, high uint32) (U32Range, error)

NewU32Range constructs an inclusive uint32 range.

func ParseU32Range

func ParseU32Range(text string) (U32Range, error)

ParseU32Range parses the canonical N or N-M syntax without accepting signs, whitespace, alternate bases, or endpoints outside uint32.

func ScalarU32

func ScalarU32(value uint32) U32Range

ScalarU32 constructs a scalar uint32 range.

func (U32Range) High

func (r U32Range) High() uint32

High returns the inclusive upper endpoint.

func (U32Range) IsZero

func (r U32Range) IsZero() bool

IsZero reports whether both endpoints are zero.

func (U32Range) Low

func (r U32Range) Low() uint32

Low returns the inclusive lower endpoint.

func (U32Range) MarshalJSON

func (r U32Range) MarshalJSON() ([]byte, error)

MarshalJSON encodes a scalar as a JSON number and a true range as a string.

func (U32Range) Overlaps

func (r U32Range) Overlaps(other U32Range) bool

Overlaps reports whether two closed intervals intersect.

func (*U32Range) Scan

func (r *U32Range) Scan(src any) error

Scan implements sql.Scanner. It accepts legacy SQLite integers and the canonical text representation. NULL and empty text map to the zero value.

func (U32Range) String

func (r U32Range) String() string

String returns canonical N or N-M syntax.

func (*U32Range) UnmarshalJSON

func (r *U32Range) UnmarshalJSON(data []byte) error

UnmarshalJSON accepts a JSON integer or a quoted canonical scalar/range.

func (U32Range) Value

func (r U32Range) Value() (driver.Value, error)

Value implements driver.Valuer using canonical text. The zero value is stored as empty text so it matches the canonical unset database default.

Jump to

Keyboard shortcuts

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