Versions in this module Expand all Collapse all v1 v1.0.8 Oct 29, 2021 v1.0.7 Jul 21, 2021 v1.0.6 Jul 7, 2021 v1.0.5 Jun 29, 2021 v1.0.4 Jun 25, 2021 v1.0.3 Jun 24, 2021 v1.0.1 Jun 21, 2021 Changes in this version + func EqualDoc(spec1, spec2 Spec) bool + func NewTextExpr(v string) *defaultExpr + type Api struct + Import []*ImportExpr + Info *InfoExpr + LinePrefix string + Service []*Service + Syntax *SyntaxExpr + Type []TypeExpr + func (a *Api) Equal(v interface{}) bool + func (a *Api) Format() error + type ApiVisitor struct + func NewApiVisitor(options ...VisitorOption) *ApiVisitor + func (v *ApiVisitor) VisitAnonymousFiled(ctx *api.AnonymousFiledContext) interface{} + func (v *ApiVisitor) VisitApi(ctx *api.ApiContext) interface{} + func (v *ApiVisitor) VisitArrayType(ctx *api.ArrayTypeContext) interface{} + func (v *ApiVisitor) VisitAtDoc(ctx *api.AtDocContext) interface{} + func (v *ApiVisitor) VisitAtHandler(ctx *api.AtHandlerContext) interface{} + func (v *ApiVisitor) VisitAtServer(ctx *api.AtServerContext) interface{} + func (v *ApiVisitor) VisitBody(ctx *api.BodyContext) interface{} + func (v *ApiVisitor) VisitDataType(ctx *api.DataTypeContext) interface{} + func (v *ApiVisitor) VisitField(ctx *api.FieldContext) interface{} + func (v *ApiVisitor) VisitImportBlock(ctx *api.ImportBlockContext) interface{} + func (v *ApiVisitor) VisitImportBlockValue(ctx *api.ImportBlockValueContext) interface{} + func (v *ApiVisitor) VisitImportLit(ctx *api.ImportLitContext) interface{} + func (v *ApiVisitor) VisitImportSpec(ctx *api.ImportSpecContext) interface{} + func (v *ApiVisitor) VisitImportValue(ctx *api.ImportValueContext) interface{} + func (v *ApiVisitor) VisitInfoSpec(ctx *api.InfoSpecContext) interface{} + func (v *ApiVisitor) VisitKvLit(ctx *api.KvLitContext) interface{} + func (v *ApiVisitor) VisitMapType(ctx *api.MapTypeContext) interface{} + func (v *ApiVisitor) VisitNormalField(ctx *api.NormalFieldContext) interface{} + func (v *ApiVisitor) VisitPointerType(ctx *api.PointerTypeContext) interface{} + func (v *ApiVisitor) VisitReplybody(ctx *api.ReplybodyContext) interface{} + func (v *ApiVisitor) VisitRoute(ctx *api.RouteContext) interface{} + func (v *ApiVisitor) VisitServiceApi(ctx *api.ServiceApiContext) interface{} + func (v *ApiVisitor) VisitServiceRoute(ctx *api.ServiceRouteContext) interface{} + func (v *ApiVisitor) VisitServiceSpec(ctx *api.ServiceSpecContext) interface{} + func (v *ApiVisitor) VisitSpec(ctx *api.SpecContext) interface{} + func (v *ApiVisitor) VisitSyntaxLit(ctx *api.SyntaxLitContext) interface{} + func (v *ApiVisitor) VisitTypeAlias(ctx *api.TypeAliasContext) interface{} + func (v *ApiVisitor) VisitTypeBlock(ctx *api.TypeBlockContext) interface{} + func (v *ApiVisitor) VisitTypeBlockAlias(ctx *api.TypeBlockAliasContext) interface{} + func (v *ApiVisitor) VisitTypeBlockBody(ctx *api.TypeBlockBodyContext) interface{} + func (v *ApiVisitor) VisitTypeBlockStruct(ctx *api.TypeBlockStructContext) interface{} + func (v *ApiVisitor) VisitTypeLit(ctx *api.TypeLitContext) interface{} + func (v *ApiVisitor) VisitTypeLitBody(ctx *api.TypeLitBodyContext) interface{} + func (v *ApiVisitor) VisitTypeSpec(ctx *api.TypeSpecContext) interface{} + func (v *ApiVisitor) VisitTypeStruct(ctx *api.TypeStructContext) interface{} + type Array struct + ArrayExpr Expr + LBrack Expr + Literal DataType + RBrack Expr + func (a *Array) Equal(dt DataType) bool + func (a *Array) Expr() Expr + func (a *Array) Format() error + func (a *Array) IsNotNil() bool + type AtDoc struct + AtDocToken Expr + Kv []*KvExpr + LineDoc Expr + Lp Expr + Rp Expr + func (a *AtDoc) Equal(v interface{}) bool + func (a *AtDoc) Format() error + type AtHandler struct + AtHandlerToken Expr + CommentExpr Expr + DocExpr []Expr + Name Expr + func (a *AtHandler) Comment() Expr + func (a *AtHandler) Doc() []Expr + func (a *AtHandler) Equal(v interface{}) bool + func (a *AtHandler) Format() error + type AtServer struct + AtServerToken Expr + Kv KV + Lp Expr + Rp Expr + func (a *AtServer) Equal(v interface{}) bool + func (a *AtServer) Format() error + type Body struct + Lp Expr + Name DataType + Rp Expr + func (b *Body) Equal(v interface{}) bool + func (b *Body) Format() error + type DataType interface + Equal func(dt DataType) bool + Expr func() Expr + Format func() error + IsNotNil func() bool + type Expr interface + Column func() int + Equal func(expr Expr) bool + IsNotNil func() bool + Line func() int + Prefix func() string + SetText func(text string) + Start func() int + Stop func() int + Text func() string + type ImportExpr struct + CommentExpr Expr + DocExpr []Expr + Import Expr + Value Expr + func (i *ImportExpr) Comment() Expr + func (i *ImportExpr) Doc() []Expr + func (i *ImportExpr) Equal(v interface{}) bool + func (i *ImportExpr) Format() error + type InfoExpr struct + Info Expr + Kvs []*KvExpr + Lp Expr + Rp Expr + func (i *InfoExpr) Equal(v interface{}) bool + func (i *InfoExpr) Format() error + type Interface struct + Literal Expr + func (i *Interface) Equal(dt DataType) bool + func (i *Interface) Expr() Expr + func (i *Interface) Format() error + func (i *Interface) IsNotNil() bool + type KV []*KvExpr + func (kv KV) Get(key string) Expr + type KvExpr struct + CommentExpr Expr + DocExpr []Expr + Key Expr + Value Expr + func (k *KvExpr) Comment() Expr + func (k *KvExpr) Doc() []Expr + func (k *KvExpr) Equal(v interface{}) bool + func (k *KvExpr) Format() error + type Literal struct + Literal Expr + func (l *Literal) Equal(dt DataType) bool + func (l *Literal) Expr() Expr + func (l *Literal) Format() error + func (l *Literal) IsNotNil() bool + type Map struct + Key Expr + LBrack Expr + Map Expr + MapExpr Expr + RBrack Expr + Value DataType + func (m *Map) Equal(dt DataType) bool + func (m *Map) Expr() Expr + func (m *Map) Format() error + func (m *Map) IsNotNil() bool + type Parser struct + func NewParser(options ...ParserOption) *Parser + func (p *Parser) Accept(fn func(p *api.ApiParserParser, visitor *ApiVisitor) interface{}, ...) (v interface{}, err error) + func (p *Parser) Parse(filename string) (*Api, error) + func (p *Parser) ParseContent(content string) (*Api, error) + func (p *Parser) SyntaxError(_ antlr.Recognizer, _ interface{}, line, column int, msg string, ...) + type ParserOption func(p *Parser) + func WithParserDebug() ParserOption + func WithParserPrefix(prefix string) ParserOption + type PlaceHolder struct + var Holder PlaceHolder + type Pointer struct + Name Expr + PointerExpr Expr + Star Expr + func (p *Pointer) Equal(dt DataType) bool + func (p *Pointer) Expr() Expr + func (p *Pointer) Format() error + func (p *Pointer) IsNotNil() bool + type Route struct + CommentExpr Expr + DocExpr []Expr + Method Expr + Path Expr + Reply *Body + Req *Body + ReturnToken Expr + func (r *Route) Comment() Expr + func (r *Route) Doc() []Expr + func (r *Route) Equal(v interface{}) bool + func (r *Route) Format() error + type Service struct + AtServer *AtServer + ServiceApi *ServiceApi + func (s *Service) Equal(v interface{}) bool + func (s *Service) Format() error + type ServiceApi struct + Lbrace Expr + Name Expr + Rbrace Expr + ServiceRoute []*ServiceRoute + ServiceToken Expr + func (a *ServiceApi) Equal(v interface{}) bool + func (a *ServiceApi) Format() error + type ServiceRoute struct + AtDoc *AtDoc + AtHandler *AtHandler + AtServer *AtServer + Route *Route + func (s *ServiceRoute) Equal(v interface{}) bool + func (s *ServiceRoute) Format() error + func (s *ServiceRoute) GetHandler() Expr + type Spec interface + Comment func() Expr + Doc func() []Expr + Equal func(v interface{}) bool + Format func() error + type SyntaxExpr struct + Assign Expr + CommentExpr Expr + DocExpr []Expr + Syntax Expr + Version Expr + func (s *SyntaxExpr) Comment() Expr + func (s *SyntaxExpr) Doc() []Expr + func (s *SyntaxExpr) Equal(v interface{}) bool + func (s *SyntaxExpr) Format() error + type Time struct + Literal Expr + func (t *Time) Equal(dt DataType) bool + func (t *Time) Expr() Expr + func (t *Time) Format() error + func (t *Time) IsNotNil() bool + type TokenStream interface + GetParser func() antlr.Parser + GetStart func() antlr.Token + GetStop func() antlr.Token + type TypeAlias struct + Assign Expr + CommentExpr Expr + DataType DataType + DocExpr []Expr + Name Expr + func (a *TypeAlias) Comment() Expr + func (a *TypeAlias) Doc() []Expr + func (a *TypeAlias) Equal(v interface{}) bool + func (a *TypeAlias) Format() error + func (a *TypeAlias) NameExpr() Expr + type TypeExpr interface + Doc func() []Expr + Equal func(v interface{}) bool + Format func() error + NameExpr func() Expr + type TypeField struct + CommentExpr Expr + DataType DataType + DocExpr []Expr + IsAnonymous bool + Name Expr + Tag Expr + func (t *TypeField) Comment() Expr + func (t *TypeField) Doc() []Expr + func (t *TypeField) Equal(v interface{}) bool + func (t *TypeField) Format() error + type TypeStruct struct + DocExpr []Expr + Fields []*TypeField + LBrace Expr + Name Expr + RBrace Expr + Struct Expr + func (s *TypeStruct) Doc() []Expr + func (s *TypeStruct) Equal(dt interface{}) bool + func (s *TypeStruct) Format() error + func (s *TypeStruct) NameExpr() Expr + type VisitorOption func(v *ApiVisitor) + func WithVisitorDebug() VisitorOption + func WithVisitorPrefix(prefix string) VisitorOption