Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Go module settings
Module Namespace `json:"module" yaml:"module"`
// Map of target names to target settings
Targets map[string]*Target `json:"targets" yaml:"targets"`
// Map of go module names to TypeScript mapping settings
Mappings TypeScriptMappings `json:"mappings" yaml:"mappings"`
// When true, appends .js extension to relative TypeScript import paths.
// Required for TypeScript projects using moduleResolution 'nodenext' or 'node16'.
TSImportJsExtension bool `json:"tsImportJsExtension" yaml:"tsImportJsExtension"`
}
func LoadConfigFile ¶
type Mapping ¶
type Mapping struct {
// Internal go package name
GoPackage string `json:"-" yaml:"-"`
// TypeScript output filename
Out string `json:"out" yaml:"out"`
// List of go types to generate
Structs []string `json:"structs" yaml:"structs"`
// List of go types to generate
Scalars []string `json:"scalars" yaml:"scalars"`
// Optional TypeScript module name
TypeScriptModule string `json:"module" yaml:"module"`
}
type Target ¶
type Target struct {
// Go package name
Package string `json:"package" yaml:"package"`
// Map of default routes to service names
Services map[string]string `json:"services" yaml:"services"`
// TypeScript module name
TypeScriptModule string `json:"module" yaml:"module"`
// TypeScript output filename
Out string `json:"out" yaml:"out"`
// List of go rpc services to generate
GoRPC []string `json:"gorpc" yaml:"gorpc"`
// List of ts rpc services to generate
TSRPC []string `json:"tsrpc" yaml:"tsrpc"`
// Skip generating go rpc client
SkipTSRPCClient bool `json:"skipTSRPCClient" yaml:"skipTSRPCClient"`
}
type TypeScriptMappings ¶
Click to show internal directories.
Click to hide internal directories.