synth

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertWorkloadCRToYAML

func ConvertWorkloadCRToYAML(workload *openchoreov1alpha1.Workload) ([]byte, error)

ConvertWorkloadCRToYAML converts a Workload CR to clean YAML bytes with proper field ordering

func ConvertWorkloadDescriptorToWorkloadCR

func ConvertWorkloadDescriptorToWorkloadCR(descriptorPath string, params api.CreateWorkloadParams) (*openchoreov1alpha1.Workload, error)

ConvertWorkloadDescriptorToWorkloadCR converts a workload.yaml descriptor to a Workload CR

func CreateBasicWorkload

func CreateBasicWorkload(params api.CreateWorkloadParams) (*openchoreov1alpha1.Workload, error)

CreateBasicWorkload creates a basic Workload CR without reading from a descriptor file

Types

type ConversionParams

type ConversionParams struct {
	OrganizationName string
	ProjectName      string
	ComponentName    string
	ImageURL         string
}

ConversionParams holds the parameters needed for workload conversion

type WorkloadDescriptor

type WorkloadDescriptor struct {
	APIVersion     string                          `yaml:"apiVersion"`
	Metadata       WorkloadDescriptorMetadata      `yaml:"metadata"`
	Endpoints      []WorkloadDescriptorEndpoint    `yaml:"endpoints,omitempty"`
	Connections    []WorkloadDescriptorConnection  `yaml:"connections,omitempty"`
	Configurations WorkloadDescriptorConfiguration `yaml:"configurations,omitempty"`
}

WorkloadDescriptor represents the structure of a workload.yaml file This is the developer-maintained descriptor alongside source code

type WorkloadDescriptorConfiguration added in v0.4.0

type WorkloadDescriptorConfiguration struct {
	Env   []WorkloadDescriptorEnvVar  `yaml:"env,omitempty"`
	Files []WorkloadDescriptorFileVar `yaml:"files,omitempty"`
}

WorkloadDescriptorConfiguration represents the configurations section in workload.yaml

type WorkloadDescriptorConnection

type WorkloadDescriptorConnection struct {
	Name   string                             `yaml:"name"`
	Type   string                             `yaml:"type"`
	Params map[string]string                  `yaml:"params,omitempty"`
	Inject WorkloadDescriptorConnectionInject `yaml:"inject"`
}

type WorkloadDescriptorConnectionEnvVar

type WorkloadDescriptorConnectionEnvVar struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type WorkloadDescriptorConnectionInject

type WorkloadDescriptorConnectionInject struct {
	Env []WorkloadDescriptorConnectionEnvVar `yaml:"env"`
}

type WorkloadDescriptorEndpoint

type WorkloadDescriptorEndpoint struct {
	Name       string `yaml:"name"`
	Port       int32  `yaml:"port"`
	Type       string `yaml:"type"`
	SchemaFile string `yaml:"schemaFile,omitempty"`
	Context    string `yaml:"context,omitempty"`
}

type WorkloadDescriptorEnvVar added in v0.4.0

type WorkloadDescriptorEnvVar struct {
	Name      string                          `yaml:"name"`
	Value     string                          `yaml:"value,omitempty"`
	ValueFrom *WorkloadDescriptorEnvVarSource `yaml:"valueFrom,omitempty"`
}

WorkloadDescriptorEnvVar represents an environment variable in the descriptor

type WorkloadDescriptorEnvVarSource added in v0.4.0

type WorkloadDescriptorEnvVarSource struct {
	SecretKeyRef *WorkloadDescriptorSecretKeyRef `yaml:"secretKeyRef,omitempty"`
	Path         string                          `yaml:"path,omitempty"`
}

WorkloadDescriptorEnvVarSource represents the source for an environment variable value

type WorkloadDescriptorFileVar added in v0.4.0

type WorkloadDescriptorFileVar struct {
	Name      string                          `yaml:"name"`
	MountPath string                          `yaml:"mountPath"`
	Value     string                          `yaml:"value,omitempty"`
	ValueFrom *WorkloadDescriptorEnvVarSource `yaml:"valueFrom,omitempty"`
}

WorkloadDescriptorFileVar represents a file configuration in the descriptor

type WorkloadDescriptorMetadata

type WorkloadDescriptorMetadata struct {
	Name string `yaml:"name"`
}

type WorkloadDescriptorSecretKeyRef added in v0.4.0

type WorkloadDescriptorSecretKeyRef struct {
	Name string `yaml:"name"`
	Key  string `yaml:"key"`
}

WorkloadDescriptorSecretKeyRef represents a reference to a secret key

Jump to

Keyboard shortcuts

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