fields

package
v0.0.0-...-ed256f0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func As

func As[T any](v any) (out T, ok bool)

func Atoi

func Atoi[I SubInt64](i I) string

func Cast

func Cast[T any](v any) (out T)

func FormatFloat

func FormatFloat[F constraints.Float](f F) string

func NewListValue

func NewListValue(items ...any) *structpb.ListValue

func NewValue

func NewValue(a any) *structpb.Value

func ParseFloat

func ParseFloat[F constraints.Float](s string) (F, error)

Types

type Provider

type Provider[T any] func() T

Provider is a singleton wrapper that is only instantiated once. It's the same as sync.OnceValue but without the additional overhead of supporting concurrent calls.

func NewProvider

func NewProvider[T any](t Provider[T]) Provider[T]

NewProvider constructs a new Provider.

type SubInt64

type SubInt64 interface {
	constraints.Signed |
		~uint | ~uint8 | ~uint16 | ~uint32
}

SubInt64 is basically constraints.Integer but excludes any types that don't fit into int64.

Jump to

Keyboard shortcuts

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