contained

package
v0.0.23 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrIncompatibleInterface = errors.New("could not decode interface into Value")

Functions

func TestRuneFromIFace

func TestRuneFromIFace(t *testing.T)

Types

type TypeInfo added in v0.0.18

type TypeInfo[T comparable] struct {
	Description string

	FromIFace func(iFace interface{}) (T, error)

	// FromInstance updates a T from an instance of itself.
	// This is particularly usefule for paths - when the user sets a scalar.Default of `~`,
	// we want to expand that into /path/to/home the same way we would
	// when updating from a string in the CLI
	FromInstance func(T) (T, error)

	FromString func(string) (T, error)

	// Initalized to the Empty value, but used for updating stuff in the container type
	Empty func() T
}

func Addr added in v0.0.18

func Addr() TypeInfo[netip.Addr]

func AddrPort added in v0.0.18

func AddrPort() TypeInfo[netip.AddrPort]

func Bool

func Bool() TypeInfo[bool]

func Duration

func Duration() TypeInfo[time.Duration]

func Int

func Int() TypeInfo[int]

func Path

func Path() TypeInfo[string]

func Rune

func Rune() TypeInfo[rune]

func String

func String() TypeInfo[string]

Jump to

Keyboard shortcuts

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