tlparser

package
v1.0.0-beta1 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseCode

func ParseCode(reader io.Reader, schema *Schema) error

Types

type Arg

type Arg struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Type        string `json:"type"`
}

type Constructor

type Constructor struct {
	Name        string `json:"name"`
	Description string `json:"description"`
	Args        []*Arg `json:"args"`
	ResultType  string `json:"result_type"`
}

type Function

type Function struct {
	Name          string       `json:"name"`
	Description   string       `json:"description"`
	Args          []*Arg       `json:"args"`
	ResultType    string       `json:"result_type"`
	IsSynchronous bool         `json:"is_synchronous"`
	Type          FunctionType `json:"type"`
}

type FunctionType

type FunctionType int
const (
	FUNCTION_TYPE_UNKNOWN FunctionType = iota
	FUNCTION_TYPE_COMMON
	FUNCTION_TYPE_USER
	FUNCTION_TYPE_BOT
)

type Schema

type Schema struct {
	Constructors []*Constructor `json:"constructors"`
	Types        []*Type        `json:"types"`
	Functions    []*Function    `json:"functions"`
}

func Parse

func Parse(reader io.Reader) (*Schema, error)

type Type

type Type struct {
	Name        string `json:"name"`
	Description string `json:"description"`
}

Jump to

Keyboard shortcuts

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