ast

package
v0.0.0-...-42f6de0 Latest Latest
Warning

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

Go to latest
Published: May 29, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Primitives = []string{"string", "bool", "int32", "int64", "float32", "float64", "byte", "uuid", "timestamp"}

Functions

func IsPrimitive

func IsPrimitive(name string) bool

Types

type Alias

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

type Enum

type Enum struct {
	Name   string   `json:"name"`
	Values []string `json:"values"`
}

type Field

type Field struct {
	Name     string `json:"name"`
	Type     Type   `json:"type"`
	Optional bool   `json:"optional"`
}

func (*Field) UnmarshalJSON

func (v *Field) UnmarshalJSON(b []byte) error

type File

type File struct {
	Name     string         `json:"name"`
	Options  []*Option[any] `json:"options,omitempty"`
	Messages []*Message     `json:"messages,omitempty"`
	Unions   []*Union       `json:"unions,omitempty"`
	Enums    []*Enum        `json:"enums,omitempty"`
	Services []*Service     `json:"services,omitempty"`
	Aliases  []*Alias       `json:"aliases,omitempty"`
}

type ListType

type ListType struct {
	ElementType *ScalarType `json:"element"`
}

func (ListType) MarshalJSON

func (v ListType) MarshalJSON() ([]byte, error)

type MapType

type MapType struct {
	KeyType   *ScalarType `json:"key"`
	ValueType *ScalarType `json:"value"`
}

func (MapType) MarshalJSON

func (v MapType) MarshalJSON() ([]byte, error)

type Member

type Member struct {
	Name string     `json:"name"`
	Type ScalarType `json:"type"`
}

type Message

type Message struct {
	Name   string   `json:"name"`
	Fields []*Field `json:"fields"`
}

type Option

type Option[T any] struct {
	Name  string `json:"name"`
	Value T      `json:"value"`
}

type Rpc

type Rpc struct {
	Name     string `json:"name"`
	Request  string `json:"request"`
	Response string `json:"response"`
}

type ScalarType

type ScalarType struct {
	Name string `json:"name"`
}

func (ScalarType) MarshalJSON

func (v ScalarType) MarshalJSON() ([]byte, error)

type Service

type Service struct {
	Name string `json:"name"`
	Rpcs []*Rpc `json:"rpcs"`
}

type Type

type Type interface {
	// contains filtered or unexported methods
}

func UnmarshalTypeJSON

func UnmarshalTypeJSON(b []byte) (Type, error)

type Union

type Union struct {
	Name    string    `json:"name"`
	Members []*Member `json:"fields"`
}

Jump to

Keyboard shortcuts

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