code_generation

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func GenerateAllYaml

func GenerateAllYaml()

func GenerateFieldCode

func GenerateFieldCode(pkg string, file string) error

GenerateFieldCode reads a YAML file and generates go-code to capture all the fields from an AWS data structure. The YAML file was probably produced by generateYaml and then tweaked a bit. It generates an instance method which can be called from the main GetFields method to avoid hand-codeing all the things. TODO: extends to delve into included structures & arrays

Types

type Field

type Field struct {
	Name          string `yaml:"name"`
	Type          string `yaml:"type,omitempty"`
	AWSName       string `yaml:"awsname"`
	Category      string `yaml:"category"`
	Converter     string `yaml:"converter,omitempty"`
	Function      string `yaml:"function,omitempty"`
	Skip          bool   `yaml:"skip"`
	ShowByDefault bool   `yaml:"show_by_default"`
}

type Type

type Type struct {
	Type   string  `yaml:"type"`
	Fields []Field `yaml:"fields"`
}

Jump to

Keyboard shortcuts

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