rpc

package
v0.0.88 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2025 License: BSD-3-Clause Imports: 3 Imported by: 2

Documentation

Index

Constants

View Source
const CollectionVarName = "routes"

Variables

This section is empty.

Functions

func BuildFromCategories added in v0.0.87

func BuildFromCategories(categories []CategorySpecificOptions) string

func GenerateTypeScript added in v0.0.14

func GenerateTypeScript(opts Opts) error

Types

type ActionType added in v0.0.50

type ActionType = string
const (
	ActionTypeQuery    ActionType = "query"
	ActionTypeMutation ActionType = "mutation"
)

type AdHocType added in v0.0.36

type AdHocType = tsgen.AdHocType

type BaseOptions added in v0.0.87

type BaseOptions struct {
	CollectionVarName    string
	DiscriminatorStr     string
	CategoryPropertyName string
}

type CategorySpecificOptions added in v0.0.87

type CategorySpecificOptions struct {
	BaseOptions
	CategoryValue        string
	ItemTypeNameSingular string
	ItemTypeNamePlural   string
	KeyUnionTypeName     string
	InputUnionTypeName   string
	OutputUnionTypeName  string
	SkipInput            bool
	SkipOutput           bool
}

type Opts

type Opts struct {
	// Path, including filename, where the resulting TypeScript file will be written
	OutPath           string
	RouteDefs         []RouteDef
	AdHocTypes        []*AdHocType
	ExportRoutesArray bool
	ExtraTSCode       string
}

type RouteDef

type RouteDef = struct {
	Key        string
	ActionType ActionType
	Input      any
	Output     any
}

Jump to

Keyboard shortcuts

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