internal

package
v0.0.6 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertProvides

func AssertProvides[T comparable](t testing.TB, p cfg.Provider[T], expected T)

AssertProvides calls t.Fatal if p.Provide doesn't return expected.

func WriteTempFile

func WriteTempFile(dir, data string) (string, error)

WriteTempFile creates a new temporary file under dir with the contents of data. The file name is returned.

Types

type MapProvider

type MapProvider map[string]any

func (MapProvider) Bool

func (m MapProvider) Bool(section string, keys ...string) cfg.Provider[bool]

func (MapProvider) Duration

func (m MapProvider) Duration(section string, keys ...string) cfg.Provider[time.Duration]

func (MapProvider) Float64

func (m MapProvider) Float64(section string, keys ...string) cfg.Provider[float64]

func (MapProvider) Get

func (m MapProvider) Get(key string, keys ...string) (any, error)

func (MapProvider) Int

func (m MapProvider) Int(section string, keys ...string) cfg.Provider[int]

func (MapProvider) Int64

func (m MapProvider) Int64(section string, keys ...string) cfg.Provider[int64]

func (MapProvider) String

func (m MapProvider) String(section string, keys ...string) cfg.Provider[string]

func (MapProvider) Uint64

func (m MapProvider) Uint64(section string, keys ...string) cfg.Provider[uint64]

type UnexpectedTypeError

type UnexpectedTypeError struct {
	Expected, Provided reflect.Type
}

func NewUnexpectedTypeError

func NewUnexpectedTypeError(expectedVal, providedVal interface{}) *UnexpectedTypeError

func (*UnexpectedTypeError) Error

func (e *UnexpectedTypeError) Error() string

Jump to

Keyboard shortcuts

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