tsrpc

package module
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

README

ts-rpc

typescript RPC

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTSSource added in v1.0.1

func GetTSSource(config TSConfig) string

Types

type TSConfig

type TSConfig struct {
	Url string
}

type TSConst

type TSConst struct {
	Name  string
	Value string
}

type TSDec

type TSDec struct {
	Name       string
	Value      string
	SourceInfo string
}

type TSEndpoint

type TSEndpoint struct {
	Name     string
	Path     string
	Method   string
	Request  string
	Response string
	Source   string
	File     string
	Line     int
}

func ParseEndpoint

func ParseEndpoint(source string, file string, line int) TSEndpoint

func (*TSEndpoint) ToTs

func (e *TSEndpoint) ToTs(pkg string) string

func (*TSEndpoint) VerifyTypes

func (e *TSEndpoint) VerifyTypes(info TSInfo, p string)

type TSEnum

type TSEnum struct {
	Name string
	Info []TSEnumInfo
}

type TSEnumInfo

type TSEnumInfo struct {
	Key   string
	Value string
}

type TSInfo

type TSInfo struct {
	Packages map[string]TSInfoPakage
}

func (*TSInfo) Populate

func (i *TSInfo) Populate()

type TSInfoPakage

type TSInfoPakage struct {
	// contains filtered or unexported fields
}

type TSModule

type TSModule struct {
	Structs   map[string]string
	Types     map[string]string
	Enums     map[string]string
	Consts    map[string]string
	GTypes    map[string]string
	Endpoints map[string]string
}

type TSModuleInfo

type TSModuleInfo struct {
	// contains filtered or unexported fields
}

/ exporter

type TSSField

type TSSField struct {
	Name       string
	Type       string
	TsType     string
	Json       TSTagJson
	Ts         TSTagTs
	DependOn   bool
	SourceInfo string
}

type TSSouces

type TSSouces struct {
	Pakages map[string]TSModule
	Errors  []string
}

func (*TSSouces) AddDependencies

func (ts *TSSouces) AddDependencies(info TSInfo, p string, s string, dependencies []string)

func (*TSSouces) Populate

func (ts *TSSouces) Populate(info TSInfo)

type TSSourceFile

type TSSourceFile struct {
	Source string
	Name   string
	Lines  []TSSourceLine
	Len    int
}

type TSSourceLine

type TSSourceLine struct {
	Pos    int
	End    int
	Line   int
	Source string
}

type TSStruct

type TSStruct struct {
	Name       string
	Typescript bool
	Fields     []TSSField
	SourceInfo string
}

type TSTagJson

type TSTagJson struct {
	Name      string
	Ignore    bool
	OmitEmpty bool
}

type TSTagTs

type TSTagTs struct {
	Type   string
	Expand bool
}

type TSType

type TSType struct {
	Name       string
	Type       string
	TsType     string
	Typescript bool

	SourceInfo string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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