config

package
v2.16.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2026 License: MIT Imports: 7 Imported by: 0

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

func LoadConfigFile(file string) (conf *Config, err error)

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 Namespace

type Namespace struct {
	// Go module name
	Name string `json:"name" yaml:"name"`
	// Go module path
	Path string `json:"path" yaml:"path"`
	// Internally loaded mod file
	ModFile *modfile.File `json:"-" yaml:"-"`
}

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"`
}

func (*Target) IsGoRPC

func (t *Target) IsGoRPC(service string) bool

func (*Target) IsTSRPC

func (t *Target) IsTSRPC(service string) bool

type TypeScriptMappings

type TypeScriptMappings map[string]*Mapping

Jump to

Keyboard shortcuts

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