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 Generator
- 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 TwirpPrefix string // contains filtered or unexported fields }
func NewAPIContext ¶
func NewAPIContext(twirpVersion string) APIContext
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.
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 Model ¶
type Model struct { Name string Primitive bool Fields []ModelField CanMarshal bool CanUnmarshal bool }
type ModelField ¶
type Service ¶
type Service struct { Name string Package string Methods []ServiceMethod }
Click to show internal directories.
Click to hide internal directories.