codegen

package
v27.2.0 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2020 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(references *References, gen *Generator) error

Types

type Generator

type Generator struct {
	// contains filtered or unexported fields
}

Generator holds a buffer of the output that will be generated.

func (*Generator) Format

func (g *Generator) Format() ([]byte, error)

Format returns the formated contents of the Generator's buffer.

func (*Generator) PrettyPrint

func (g *Generator) PrettyPrint(data interface{})

PrettyPrint pretty-prints arbitrary data.

There are special rules for some composite types to ensure we have verbose output, but simple types such as strings and numbers are printed using the built-in `%#v` format filter.

func (*Generator) Print

func (g *Generator) Print(a ...interface{})

Print prints the given a to the buffer.

func (*Generator) Printf

func (g *Generator) Printf(format string, args ...interface{})

Printf prints the given format+args to the buffer.

func (*Generator) String

func (g *Generator) String() string

String returns a string representation of the Generator's buffer.

func (*Generator) Write

func (g *Generator) Write(p []byte) (n int, err error)

Write writes arbitrary bytes to the buffer. This meets the requirements for the io.Writer interface.

type Reference

type Reference struct {
	Content  json.RawMessage `json:"content"`
	Filename string          `json:"filename"`
}

An element in `generated/references.json`

type References

type References struct {
	// contains filtered or unexported fields
}

References represents `generated/references.json`

func LoadReferences

func LoadReferences() (*References, error)

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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