generators

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2021 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func AppGenerate

func AppGenerate(global *GlobalConfigType, args []string)

func ExtensionGenerate

func ExtensionGenerate(global *GlobalConfigType, args []string)

func ModuleGenerate

func ModuleGenerate(global *GlobalConfigType, args []string)

func ModuleUpdate

func ModuleUpdate(global *GlobalConfigType, args []string)

Types

type AppConfig

type AppConfig struct {
	Global     *GlobalConfigType
	Name       string   // Application name
	Version    string   // Application version (not Kraken version)
	Pprof      bool     // Build with pprof (default: false)?
	Extensions []string // List of extensions to include (url paths)
	Modules    []string // List of modules to include (url paths)
}

App generation

type CustomTypeConfig

type CustomTypeConfig struct {
	Global *GlobalConfigType `yaml:"__global,omitempty"`
	Name   string
}

type ExtensionConfig

type ExtensionConfig struct {
	// Global should not be specified on config; it will get overwritten regardless.
	Global *GlobalConfigType `yaml:""`
	// URL of package, e.g. "github.com/kraken-hpc/kraken/extensions/ipv4" (required)
	PackageUrl string `yaml:"package_url"`
	// Go package name (default: last element of PackageUrl)
	PackageName string `yaml:"package_name"`
	// Proto package name (default: camel case of PackageName)
	ProtoPackage string `yaml:"proto_name"`
	// Extension object name (required)
	// More than one extension object can be declared in the same package
	// Objects are referenced as ProtoName.Name, e.g. IPv4.IPv4OverEthernet
	Name string `yaml:"name"`
	// CustomTypes are an advanced feature and most people won't use them
	// Declaring a custom type will create a stub to develop a gogo customtype on
	// It will also include a commented example of linking a customtype in the proto
	CustomTypes []string `yaml:"custom_types"`
	// LowerName is intended for internal use only
	LowerName string `yaml:""`
}

type GlobalConfigType

type GlobalConfigType struct {
	Version string
	Log     *log.Logger
	Force   bool
}
var Global *GlobalConfigType

type ModuleConfig

type ModuleConfig struct {
	// Global should not be specified on config; it will get overwritten regardless.
	Global *GlobalConfigType `yaml:"__global,omitempty"`
	// Module name, i.e. Object name (default: CamelCase of PackageName)
	Name string `yaml:"name"`
	// Go package name (default: last element of PackageUrl)
	PackageName string `yaml:"package_name"`
	// URL of package, e.g. "github.com/kraken-hpc/kraken/modules/restapi" (required)
	PackageUrl string `yaml:"package_url"`
	// Generate code for a polling loop, implies WithConfig (default: true)
	WithPolling bool `yaml:"with_polling,omitempty"`
	// Generate code/proto for a configuration (default: true)
	WithConfig bool `yaml:"with_config,omitempty"`
	// A list of URLs we discover for.
	// Our own service, and anything mentioned in Mutations are automatic.
	Discoveries []string `yaml:"discoveries"`
	// Mutation definitions.  Key is the unique mutation name.
	Mutations map[string]*ModuleConfigMutations `yaml:"mutations"`
}

type ModuleConfigMutations

type ModuleConfigMutations struct {
	Mutates map[string]struct {
		From string
		To   string
	} `yaml:"mutates"`
	// key is Url, value is state value (string representation)
	Requires map[string]string `yaml:"requires"`
	// key is Url, value is state value (string representation)
	Excludes map[string]string `yaml:"excludes"`
	// execution context {"CHILD", "SELF", "ALL"}, default: "SELF"
	Context string `yaml:"context"`
	// execution timeout in string form, e.g. "10s", "5m". Default: 0 (no timeout)
	Timeout string `yaml:"timeout"`
	// what we discover on timeout.  Must be set of timeout != 0.
	FailTo struct {
		Url   string
		Value string
	} `yaml:"fail_to,omitempty"`
}

Directories

Path Synopsis
this file is a placeholder for imports to make sure imports needed only in templates get added to go.mod Code generated for package templates by go-bindata DO NOT EDIT.
this file is a placeholder for imports to make sure imports needed only in templates get added to go.mod Code generated for package templates by go-bindata DO NOT EDIT.

Jump to

Keyboard shortcuts

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