convert

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2022 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModuleToImportName

func ModuleToImportName(module string) (string, error)

ModuleToImportName converts a module name into the corresponding skycfg go package name.

func ObjsToStar

func ObjsToStar(objs []runtime.Object, config Config) (string, error)

ObjsToStar converts a slice of Kubernetes objects into a starlark string.

func PkgToModule

func PkgToModule(pkgName string) (string, error)

PkgToModule converts a go package into the corresponding skycfg module name.

func YamlStrToStar

func YamlStrToStar(yamlStrs []string, config Config) (string, error)

YamlStrToStar converts a YAML string into a starlark representation.

func YamlToStar

func YamlToStar(filePaths []string, config Config) (string, error)

YamlToStar converts a YAML file into a starlark representation.

Types

type Arg

type Arg struct {
	Name         string
	DefaultValue interface{}
	Required     bool
}

Arg includes the details of an argument for the starlark entrypoint.

func (Arg) DefaultValueStr

func (a Arg) DefaultValueStr() string

DefaultValueStr gets the default value for this argument.

func (Arg) RequiredStatement

func (a Arg) RequiredStatement() string

RequiredStatement returns a statement that ensures that this argument is set.

type Config

type Config struct {
	Entrypoint string
	Args       []Arg
	// contains filtered or unexported fields
}

Config stores the configuration associated with a YAML to starlark conversion.

func (Config) SubVariable

func (c Config) SubVariable(value string) string

SubVariable determines which variable (if any) a raw string should be replaced with.

Jump to

Keyboard shortcuts

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