func NewContext(b *parser.Builder, nameSystems namer.NameSystems, canonicalOrderName string) (*Context, error) {
	universe, err := b.FindTypes()
	if err != nil {
		return nil, err
	}
	c := &Context{
		Namers:   namer.NameSystems{},
		Universe: universe,
		Inputs:   b.FindPackages(),
		FileTypes: map[string]FileType{
			GolangFileType: NewGolangFile(),
		},
		builder: b,
	}
	for name, systemNamer := range nameSystems {
		c.Namers[name] = systemNamer
		if name == canonicalOrderName {
			orderer := namer.Orderer{Namer: systemNamer}
			c.Order = orderer.OrderUniverse(universe)
		}
	}
	return c, nil
}
NewContext generates a context from the given builder, naming systems, and
the naming system you wish to construct the canonical ordering from.
package generator
import (
	"bytes"
	"io"
	"k8s.io/gengo/namer"
	"k8s.io/gengo/parser"
	"k8s.io/gengo/types"
)
type Package interface {
	Name() string
	Path() string
	Filter(*Context, *types.Type) bool
	Header(filename string) []byte
	Generators(*Context) []Generator
}
type File struct {
	Name        string
	FileType    string
	PackageName string
	Header      []byte
	Imports     map[string]struct{}
	Vars        bytes.Buffer
	Consts      bytes.Buffer
	Body        bytes.Buffer
}
type FileType interface {
	AssembleFile(f *File, path string) error
	VerifyFile(f *File, path string) error
}
type Packages []Package
type Generator interface {
	Name() string
	Filter(*Context, *types.Type) bool
	Namers(*Context) namer.NameSystems
	Init(*Context, io.Writer) error
	Finalize(*Context, io.Writer) error
	PackageVars(*Context) []string
	PackageConsts(*Context) []string
	GenerateType(*Context, *types.Type, io.Writer) error
	Imports(*Context) []string
	Filename() string
	FileType() string
}
type Context struct {
	Namers namer.NameSystems
	Universe types.Universe
	Inputs []string
	Order []*types.Type
	FileTypes map[string]FileType
	Verify bool
	builder *parser.Builder
}