Documentation
¶
Overview ¶
Package fixture loads explicitly selected test data. Paths are always relative to a caller-declared root; test names and caller source locations are ignored.
Index ¶
Constants ¶
View Source
const MaxSourceBytes int64 = 64 << 20
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Resolver ¶
type Resolver interface {
Load(context.Context, Source) (structology.Maps, error)
Read(context.Context, Source) ([]byte, error)
}
Resolver is safe for concurrent reads when its caller-supplied FS/AFS service is. Load returns fresh maps on every call. Read reads raw schema or fixture bytes.
type Source ¶
type Source struct {
// Expanded marks concrete values produced by hydration/mapping. Consumers
// must not evaluate toolbox templates in these records a second time.
Expanded bool `json:"expanded,omitempty" yaml:"expanded,omitempty"`
Kind string `json:"kind,omitempty" yaml:"kind,omitempty"`
Path string `json:"path,omitempty" yaml:"path,omitempty"`
URL string `json:"url,omitempty" yaml:"url,omitempty"`
Format string `json:"format,omitempty" yaml:"format,omitempty"`
Data []map[string]any `json:"data,omitempty" yaml:"data,omitempty"`
Value any `json:"-" yaml:"-"`
Content []byte `json:"content,omitempty" yaml:"content,omitempty"`
NullToken string `json:"nullToken,omitempty" yaml:"nullToken,omitempty"`
}
Source describes one input. Value is reserved for in-process typed slices. Use an explicit kind for an empty maps/bytes input in serialized requests.
Click to show internal directories.
Click to hide internal directories.