parser

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

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

Go to latest
Published: Jul 6, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package parser provides a pseudo parser that parses arikawa api files and maps them to Methods. It does not actually parse the api files, but rather utilizes the output generated by go's built-in parser, hence pseudo parser.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Name    string
	Methods []Method
}

type Method

type Method struct {
	Name       string
	Params     []Param
	ReturnType *Type

	Multipart                          bool
	QueryParam, JSONParam, ReasonParam string

	HTTPMethod   string
	EndpointExpr ast.Expr
}

type Param

type Param struct {
	Name string
	Type Type
}

type Parser

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

func New

func New(apiPath string) (*Parser, error)

func (*Parser) Parse

func (p *Parser) Parse() ([]File, error)

type Type

type Type struct {
	Slice    uint8
	Variadic bool
	ElemPtr  bool
	Package  string
	Name     string
}

Jump to

Keyboard shortcuts

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