typescript

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New() code.Generator

Types

type Arg

type Arg struct {
	Name string
	Type string
}

type Constant

type Constant struct {
	Name  string
	Value string
}

type Constants

type Constants []Constant

func (*Constants) Parse

func (c *Constants) Parse(prog *ast.Program) error

type CustomError

type CustomError struct {
	Name string
	Code int64
}

type CustomErrors

type CustomErrors []CustomError

func (*CustomErrors) Parse

func (c *CustomErrors) Parse(prog *ast.Program) error

type Enum

type Enum struct {
	Name string
	Keys []EnumKeyValue
}

type EnumKeyValue

type EnumKeyValue struct {
	Name  string
	Value string
}

type Enums

type Enums []Enum

func (*Enums) Parse

func (e *Enums) Parse(prog *ast.Program) error

type HttpService

type HttpService struct {
	Name    string
	Methods []Method
}

type HttpServices

type HttpServices []HttpService

func (*HttpServices) Parse

func (s *HttpServices) Parse(prog *ast.Program) error

type Method

type Method struct {
	Name        string
	ServiceName string
	Options     astutil.MethodOptions
	Type        string // normal, binary, stream, fileupload
	Args        []Arg
	Returns     []Return
}

func (Method) ArgsName

func (m Method) ArgsName() string

func (Method) HasReturn

func (m Method) HasReturn() bool

func (Method) IsBinaryStream

func (m Method) IsBinaryStream() bool

func (Method) IsFileUpload

func (m Method) IsFileUpload() bool

func (Method) IsStream

func (m Method) IsStream() bool

func (Method) NeedReturnInterface

func (m Method) NeedReturnInterface() bool

func (Method) PathValue

func (m Method) PathValue() string

func (Method) ReturnsName

func (m Method) ReturnsName() string

type Model

type Model struct {
	Name   string
	Fields ModelFields
}

type ModelField

type ModelField struct {
	Name string
	Type string
}

type ModelFields

type ModelFields []ModelField

func (*ModelFields) Parse

func (m *ModelFields) Parse(message *ast.Model) error

type Models

type Models []Model

func (*Models) Parse

func (m *Models) Parse(prog *ast.Program) error

type Return

type Return struct {
	Name string
	Type string
}

type Typescript

type Typescript struct {
	Constants    Constants
	Enums        Enums
	Models       Models
	HttpServices HttpServices
	CustomErrors CustomErrors
}

func (*Typescript) Parse

func (t *Typescript) Parse(prog *ast.Program) error

Jump to

Keyboard shortcuts

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