generate

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Overview

Package generate holds helper function for the code generation that we use.

Index

Constants

This section is empty.

Variables

View Source
var EmptyData = []string{
	"ANY", "AVC", "AXFR", "CDNSKEY", "CDS", "CLA", "DELEGI", "DLV", "HTTPS",
	"IXFR", "KEY", "NXNAME", "NXT", "OPT", "SIG", "SPF", "RESINFO", "WALLET",
}

EmptyData are RR that don't have rdata (or are embedding another type) and as such do not have an entry in rdata/rdata.go

View Source
var FlagDebug = flag.Bool("debug", false, "Emit the non-formatted code to standard output and do not write it to a file.")

Functions

func Ast

func Ast(file string) (f *ast.File, t *token.FileSet, err error)

Ast returns the *ast.File of file or an error.

func Fields

func Fields(file string) (map[string][]string, error)

Fields returns the export type names and the field's names. Each name is prefixed with "rr.".

func FilterTypeSpecs added in v0.5.37

func FilterTypeSpecs(typeSpecs []*ast.TypeSpec, names []string) []*ast.TypeSpec

FilterTypeSpecs filters the type specs on name.

func IsEmbedded added in v0.5.3

func IsEmbedded(strct *ast.StructType) bool

func StructTypeSpecs

func StructTypeSpecs(file string) ([]*ast.TypeSpec, error)

StructTypeSpecs returns the struct types from file that can be inspected for the struct tags.

func Types

func Types(file string) ([]string, error)

Types returns all types names from the file that are exported.

func Write

func Write(b *bytes.Buffer, out string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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