Documentation
¶
Index ¶
- Variables
- func Capitalize(s string) string
- func MakeCopyFunc(ctx context.Context, fsys fs.FS, tempDir string) fs.WalkDirFunc
- func SetupPlatform(t testing.TB, apiVersion string) (tempDir string)
- type ComponentHarness
- func (h *ComponentHarness) AbsBase() string
- func (h *ComponentHarness) Base() string
- func (h *ComponentHarness) Component(path string) *component.Component
- func (h *ComponentHarness) Ctx() context.Context
- func (h *ComponentHarness) Load(path string) (any, error)
- func (h *ComponentHarness) Root() string
Constants ¶
This section is empty.
Variables ¶
View Source
var Fixtures embed.FS
Functions ¶
func Capitalize ¶
Capitalize capitalizes the first letter of a UTF-8 string.
func MakeCopyFunc ¶
Types ¶
type ComponentHarness ¶
type ComponentHarness struct {
// contains filtered or unexported fields
}
func NewComponentHarness ¶
func NewComponentHarness(t testing.TB, tempDir, apiVersion string) *ComponentHarness
func (*ComponentHarness) AbsBase ¶
func (h *ComponentHarness) AbsBase() string
AbsBase returns the absolute path to the api version base.
func (*ComponentHarness) Base ¶
func (h *ComponentHarness) Base() string
Base returns the fixture base path relative to the root, for example "fixtures/v1alpha6"
func (*ComponentHarness) Component ¶
func (h *ComponentHarness) Component(path string) *component.Component
Component returns a new component with fully qualified path filepath.Join(root, base, path).
func (*ComponentHarness) Ctx ¶
func (h *ComponentHarness) Ctx() context.Context
func (*ComponentHarness) Load ¶
func (h *ComponentHarness) Load(path string) (any, error)
Load unmarshals the first document in yaml or json path relative to the harness root.
func (*ComponentHarness) Root ¶
func (h *ComponentHarness) Root() string
Click to show internal directories.
Click to hide internal directories.