otx

package
v0.0.0-...-44e38f9 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Overview

Package otx provides context.Context access methods for xo/ox.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addr

func Addr(ctx context.Context, name string) *netip.Addr

Addr returns the netip.Addr variable from the context.

func AddrPort

func AddrPort(ctx context.Context, name string) *netip.AddrPort

AddrPort returns the netip.AddrPort variable from the context.

func Any

func Any(ctx context.Context, name string) (ox.Value, bool)

Any returns a variable, its set status, and if it was defined from the context.

func BigFloat

func BigFloat(ctx context.Context, name string) *big.Float

BigFloat returns the big.Float variable from the context.

func BigInt

func BigInt(ctx context.Context, name string) *big.Int

BigInt returns the big.Int variable from the context.

func BigRat

func BigRat(ctx context.Context, name string) *big.Rat

BigRat returns the big.Rat variable from the context.

func Bool

func Bool(ctx context.Context, name string) bool

Bool returns the bool variable from the context.

func Byte

func Byte(ctx context.Context, name string) byte

Byte returns the byte variable from the context.

func Bytes

func Bytes(ctx context.Context, name string) []byte

Bytes returns a variable as []byte from the context.

func CIDR

func CIDR(ctx context.Context, name string) *netip.Prefix

CIDR returns the netip.Prefix variable from the context.

func Complex128

func Complex128(ctx context.Context, name string) complex128

Complex128 returns the complex128 variable from the context.

func Complex64

func Complex64(ctx context.Context, name string) complex64

Complex64 returns the complex64 variable from the context.

func Count

func Count(ctx context.Context, name string) int

Count returns the count variable from the context.

func Duration

func Duration(ctx context.Context, name string) time.Duration

Duration returns the time.Duration variable from the context.

func Float32

func Float32(ctx context.Context, name string) float32

Float32 returns the float32 variable from the context.

func Float64

func Float64(ctx context.Context, name string) float64

Float64 returns the float64 variable from the context.

func Get

func Get[T any](ctx context.Context, name string) T

Get returns a variable.

func Int

func Int(ctx context.Context, name string) int

Int returns the int variable from the context.

func Int16

func Int16(ctx context.Context, name string) int16

Int16 returns the int16 variable from the context.

func Int32

func Int32(ctx context.Context, name string) int32

Int32 returns the int32 variable from the context.

func Int64

func Int64(ctx context.Context, name string) int64

Int64 returns the int64 variable from the context.

func Map

func Map[K cmp.Ordered, T any](ctx context.Context, name string) map[K]T

Map returns the map variable from the context.

func Path

func Path(ctx context.Context, name string) string

Path returns the path variable from the context.

func Rune

func Rune(ctx context.Context, name string) rune

Rune returns the rune variable from the context.

func Runes

func Runes(ctx context.Context, name string) []rune

Runes returns a variable as []rune from the context.

func Slice

func Slice[E any](ctx context.Context, name string) []E

Slice returns the slice variable from the context as a slice of type E.

func String

func String(ctx context.Context, name string) string

String returns the string variable from the context.

func Time

func Time(ctx context.Context, name string) ox.FormattedTime

Time returns the ox.Time variable from the context.

func TimeTime

func TimeTime(ctx context.Context, name string) time.Time

TimeTime returns the time.Time variable from the context.

func URL

func URL(ctx context.Context, name string) *url.URL

URL returns the url.URL variable from the context.

func Uint

func Uint(ctx context.Context, name string) uint

Uint returns the uint variable from the context.

func Uint16

func Uint16(ctx context.Context, name string) uint16

Uint16 returns the uint16 variable from the context.

func Uint32

func Uint32(ctx context.Context, name string) uint32

Uint32 returns the uint32 variable from the context.

func Uint64

func Uint64(ctx context.Context, name string) uint64

Uint64 returns the uint64 variable from the context.

func Uint8

func Uint8(ctx context.Context, name string) uint8

Uint8 returns the uint8 variable from the context.

func Vars

func Vars(ctx context.Context) (ox.Vars, bool)

Vars returns all variables from the context.

Types

This section is empty.

Jump to

Keyboard shortcuts

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