Documentation
¶
Overview ¶
Package generator provides an interface for generating files from code.
This package defines the Generator interface implemented by specific distribution generators (kind, k3d, kustomization, yaml) for generating configuration files from Go structs.
Key functionality:
- Generator[T, Options]: Generic interface for content generation
- Generate: Transform model into string representation
Subpackages:
- k3d: K3d YAML configuration generator
- kind: Kind YAML configuration generator
- kustomization: Kustomization YAML generator
- yaml: Generic YAML generator using reflection
Index ¶
- type Generator
- type MockGenerator
- type MockGenerator_Expecter
- type MockGenerator_Generate_Call
- func (_c *MockGenerator_Generate_Call[T, Options]) Return(s string, err error) *MockGenerator_Generate_Call[T, Options]
- func (_c *MockGenerator_Generate_Call[T, Options]) Run(run func(model T, opts Options)) *MockGenerator_Generate_Call[T, Options]
- func (_c *MockGenerator_Generate_Call[T, Options]) RunAndReturn(run func(model T, opts Options) (string, error)) *MockGenerator_Generate_Call[T, Options]
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
Generator is implemented by specific distribution generators (kind, k3d, kustomization). The Options type parameter allows each implementation to define its own options structure.
type MockGenerator ¶
MockGenerator is an autogenerated mock type for the Generator type
func NewMockGenerator ¶
func NewMockGenerator[T any, Options any](t interface { mock.TestingT Cleanup(func()) }) *MockGenerator[T, Options]
NewMockGenerator creates a new instance of MockGenerator. It also registers a testing interface on the mock and a cleanup function to assert the mocks expectations. The first argument is typically a *testing.T value.
func (*MockGenerator[T, Options]) EXPECT ¶
func (_m *MockGenerator[T, Options]) EXPECT() *MockGenerator_Expecter[T, Options]
func (*MockGenerator[T, Options]) Generate ¶
func (_mock *MockGenerator[T, Options]) Generate(model T, opts Options) (string, error)
Generate provides a mock function for the type MockGenerator
type MockGenerator_Expecter ¶
type MockGenerator_Expecter[T any, Options any] struct { // contains filtered or unexported fields }
func (*MockGenerator_Expecter[T, Options]) Generate ¶
func (_e *MockGenerator_Expecter[T, Options]) Generate(model interface{}, opts interface{}) *MockGenerator_Generate_Call[T, Options]
Generate is a helper method to define mock.On call
- model T
- opts Options
type MockGenerator_Generate_Call ¶
MockGenerator_Generate_Call is a *mock.Call that shadows Run/Return methods with type explicit version for method 'Generate'
func (*MockGenerator_Generate_Call[T, Options]) Return ¶
func (_c *MockGenerator_Generate_Call[T, Options]) Return(s string, err error) *MockGenerator_Generate_Call[T, Options]
func (*MockGenerator_Generate_Call[T, Options]) Run ¶
func (_c *MockGenerator_Generate_Call[T, Options]) Run(run func(model T, opts Options)) *MockGenerator_Generate_Call[T, Options]
func (*MockGenerator_Generate_Call[T, Options]) RunAndReturn ¶
func (_c *MockGenerator_Generate_Call[T, Options]) RunAndReturn(run func(model T, opts Options) (string, error)) *MockGenerator_Generate_Call[T, Options]
Directories
¶
| Path | Synopsis |
|---|---|
|
Package k3dgenerator provides utilities for generating K3d cluster configurations.
|
Package k3dgenerator provides utilities for generating K3d cluster configurations. |
|
Package kindgenerator provides utilities for generating Kind cluster configurations.
|
Package kindgenerator provides utilities for generating Kind cluster configurations. |
|
Package kustomizationgenerator provides utilities for generating kustomization.yaml files.
|
Package kustomizationgenerator provides utilities for generating kustomization.yaml files. |
|
Package talosgenerator provides a generator for TalosInDocker project scaffolding.
|
Package talosgenerator provides a generator for TalosInDocker project scaffolding. |
|
Package yamlgenerator provides YAML generation functionality for arbitrary models.
|
Package yamlgenerator provides YAML generation functionality for arbitrary models. |