minimal

package
v0.0.0-...-f00125f Latest Latest
Warning

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

Go to latest
Published: Aug 10, 2019 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

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 NewGenerator

func NewGenerator(twirpVersion string, p map[string]string) *Generator

type Model

type Model struct {
	Name         string
	Primitive    bool
	Fields       []ModelField
	CanMarshal   bool
	CanUnmarshal bool
}

type ModelField

type ModelField struct {
	Name       string
	Type       string
	JSONName   string
	JSONType   string
	IsMessage  bool
	IsRepeated bool
}

type Service

type Service struct {
	Name    string
	Package string
	Methods []ServiceMethod
}

type ServiceMethod

type ServiceMethod struct {
	Name       string
	Path       string
	InputArg   string
	InputType  string
	OutputType string
}

Jump to

Keyboard shortcuts

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