templates

package
v0.13.3 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetBackendPluginSecurePackageFiles

func GetBackendPluginSecurePackageFiles() (map[string][]byte, error)

GetBackendPluginSecurePackageFiles returns go files for the `secure` package in the backend plugin, as a map of <filename> (without "secure" in path) => contents

func WriteBackendPluginHandler

func WriteBackendPluginHandler(metadata BackendPluginHandlerTemplateMetadata, out io.Writer) error

WriteBackendPluginHandler executes the Backend Plugin Handler template, and writes out the generated go code to out

func WriteBackendPluginMain

func WriteBackendPluginMain(metadata BackendPluginRouterTemplateMetadata, out io.Writer) error

WriteBackendPluginMain executes the Backend Plugin Main template, and writes out the generated go code to out

func WriteBackendPluginRouter

func WriteBackendPluginRouter(metadata BackendPluginRouterTemplateMetadata, out io.Writer) error

WriteBackendPluginRouter executes the Backend Plugin Router template, and writes out the generated go code to out

func WriteLineageGo

func WriteLineageGo(metadata LineageMetadata, out io.Writer) error

WriteLineageGo executes the lineage go template, and writes out the generated go code to out

func WriteOperatorConfig added in v0.11.0

func WriteOperatorConfig(out io.Writer) error

func WriteOperatorKubeConfig

func WriteOperatorKubeConfig(out io.Writer) error

func WriteOperatorMain

func WriteOperatorMain(metadata OperatorMainMetadata, out io.Writer) error

func WriteOperatorTelemetry added in v0.11.0

func WriteOperatorTelemetry(out io.Writer) error

func WriteResourceObject

func WriteResourceObject(metadata ResourceObjectTemplateMetadata, out io.Writer) error

WriteResourceObject executes the Resource Object template, and writes out the generated go code to out

func WriteSchema

func WriteSchema(metadata SchemaMetadata, out io.Writer) error

WriteSchema executes the Resource Schema template, and writes out the generated go code to out

func WriteWatcher

func WriteWatcher(metadata WatcherMetadata, out io.Writer) error

func WriteWrappedType

func WriteWrappedType(metadata WrappedTypeMetadata, out io.Writer) error

WriteWrappedType executes the wrappedtype go template, and writes out the generated go code to out

Types

type BackendPluginHandlerTemplateMetadata

type BackendPluginHandlerTemplateMetadata struct {
	kindsys.CustomProperties
	Repo           string
	APICodegenPath string
	TypeName       string
	IsResource     bool
}

BackendPluginHandlerTemplateMetadata is the metadata required by the Backend Plugin Handler template

type BackendPluginRouterTemplateMetadata

type BackendPluginRouterTemplateMetadata struct {
	Repo           string
	APICodegenPath string
	Resources      []kindsys.CustomProperties
	PluginID       string
}

BackendPluginRouterTemplateMetadata is the metadata required by the Backend Plugin Router template

type LineageMetadata

type LineageMetadata struct {
	Package           string
	TypeName          string
	CUEFile           string
	CUESelector       string
	SchemaPackagePath string
	SchemaPackageName string
	Subresources      []SubresourceMetadata
}

LineageMetadata is the metadata required by the lineage go code template

type ObjectMetadataField

type ObjectMetadataField struct {
	JSONName  string
	FieldName string
}

type OperatorMainMetadata

type OperatorMainMetadata struct {
	PackageName    string
	Repo           string
	CodegenPath    string
	WatcherPackage string
	Resources      []kindsys.CustomProperties
}

type ResourceObjectTemplateMetadata

type ResourceObjectTemplateMetadata struct {
	Package              string
	TypeName             string
	SpecTypeName         string
	ObjectTypeName       string
	ObjectShortName      string
	Subresources         []SubresourceMetadata
	CustomMetadataFields []ObjectMetadataField
}

ResourceObjectTemplateMetadata is the metadata required by the Resource Object template

type SchemaMetadata

type SchemaMetadata struct {
	Package string
	Group   string
	Version string
	Kind    string
	Plural  string
	Scope   string
}

SchemaMetadata is the metadata required by the Resource Schema template

type SubresourceMetadata

type SubresourceMetadata struct {
	TypeName string
	JSONName string
	Comment  string
}

SubresourceMetadata is subresource information used in templates

type WatcherMetadata

type WatcherMetadata struct {
	kindsys.CustomProperties
	PackageName string
	Repo        string
	CodegenPath string
}

type WrappedTypeMetadata

type WrappedTypeMetadata struct {
	Package     string
	TypeName    string
	CUEFile     string
	CUESelector string
}

WrappedTypeMetadata is the metadata required by the wrappedtype go code template

Jump to

Keyboard shortcuts

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