code_generation

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Generate = []interface{}{
	ec2.Instance{},
	ec2.Snapshot{},
	route53.HostedZone{},
	route53.ResourceRecordSet{},
	ec2.Volume{},
}

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