Documentation ¶
Index ¶
- func CreatePackageIndex(files []*plugin.CodeGeneratorResponse_File) (*plugin.CodeGeneratorResponse_File, error)
- func CreatePackageJSON(projectName string) *plugin.CodeGeneratorResponse_File
- func CreateTSConfig() *plugin.CodeGeneratorResponse_File
- func RuntimeLibrary() *plugin.CodeGeneratorResponse_File
- type APIContext
- type Enum
- type EnumOption
- type Generator
- type Import
- type Imports
- type Model
- type ModelField
- type Service
- type ServiceMethod
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreatePackageIndex ¶
func CreatePackageIndex(files []*plugin.CodeGeneratorResponse_File) (*plugin.CodeGeneratorResponse_File, error)
func CreatePackageJSON ¶
func CreatePackageJSON(projectName string) *plugin.CodeGeneratorResponse_File
func CreateTSConfig ¶
func CreateTSConfig() *plugin.CodeGeneratorResponse_File
func RuntimeLibrary ¶
func RuntimeLibrary() *plugin.CodeGeneratorResponse_File
Types ¶
type APIContext ¶
type APIContext struct { Models []*Model Services []*Service Enums []*Enum Imports Imports TwirpPrefix string // contains filtered or unexported fields }
func NewAPIContext ¶
func NewAPIContext(twirpVersion string) APIContext
func (*APIContext) AddEnum ¶
func (ctx *APIContext) AddEnum(e *Enum)
func (*APIContext) AddModel ¶
func (ctx *APIContext) AddModel(m *Model)
func (*APIContext) ApplyMarshalFlags ¶
func (ctx *APIContext) ApplyMarshalFlags()
ApplyMarshalFlags will inspect the CanMarshal and CanUnmarshal flags for models where the flags are enabled and recursively set the same values on all the models that are field types.
func (*APIContext) PopulateImports ¶
func (ctx *APIContext) PopulateImports()
type Enum ¶
type Enum struct { Name string Options []EnumOption Filename string }
type EnumOption ¶
type EnumOption struct { Key string Value interface{} }
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
func (*Generator) Generate ¶
func (g *Generator) Generate(d *descriptor.FileDescriptorProto) ([]*plugin.CodeGeneratorResponse_File, error)
type ModelField ¶
type Service ¶
type Service struct { Name string Package string Methods []ServiceMethod }
Click to show internal directories.
Click to hide internal directories.