generate

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNilShapePointer indicates an unexpected nil Shape pointer
	ErrNilShapePointer = errors.New("found nil Shape pointer")
)

Functions

This section is empty.

Types

type Generator

type Generator struct {
	SDKAPI *ackmodel.SDKAPI
	// contains filtered or unexported fields
}

Generator contains the ACK model for the generator to process and apply templates against

func New

func New(
	SDKAPI *ackmodel.SDKAPI,
	apiVersion string,
	configPath string,
	defaultConfig ackgenconfig.Config,
) (*Generator, error)

New returns a new Generator struct for a supplied API model. Optionally, pass a file path to a generator config file that can be used to instruct the code generator how to handle the API properly

func (*Generator) ApplyShapeIgnoreRules added in v0.0.2

func (g *Generator) ApplyShapeIgnoreRules()

ApplyShapeIgnoreRules removes the ignored shapes and fields from the API object so that they are not considered in any of the calculations of code generator.

func (*Generator) GetCRDs

func (g *Generator) GetCRDs() ([]*ackmodel.CRD, error)

GetCRDs returns a slice of `ackmodel.CRD` structs that describe the top-level resources discovered by the code generator for an AWS service API

func (*Generator) GetEnumDefs

func (g *Generator) GetEnumDefs() ([]*ackmodel.EnumDef, error)

GetEnumDefs returns a slice of pointers to `ackmodel.EnumDef` structs which represent string fields whose value is constrained to one or more specific string values.

func (*Generator) GetTypeDefs

func (g *Generator) GetTypeDefs() ([]*ackmodel.TypeDef, map[string]string, error)

GetTypeDefs returns a slice of `ackmodel.TypeDef` pointers and a map of package import information

func (*Generator) IsShapeUsedInCRDs

func (g *Generator) IsShapeUsedInCRDs(shapeName string) bool

IsShapeUsedInCRDs returns true if the supplied shape name is a member of amy CRD's payloads or those payloads sub-member shapes

func (*Generator) MetaVars added in v0.0.2

func (g *Generator) MetaVars() templateset.MetaVars

MetaVars returns a MetaVars struct populated with metadata about the AWS service API

func (*Generator) RemoveIgnoredOperations

func (g *Generator) RemoveIgnoredOperations(ops *ackmodel.Ops)

RemoveIgnoredOperations updates Ops argument by setting those operations to nil that are configured to be ignored in generator config for the AWS service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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