parser

package
v0.0.0-...-96111de Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUDParser

type CRUDParser struct{}

CRUDParser parses codes to generate a service from a resource name.

func (CRUDParser) Parse

func (p CRUDParser) Parse(path, resourceName string) (*Data, error)

Parse parses codes to return a service.

type Data

type Data struct {
	Name        string
	Endpoints   []Endpoint
	Package     string
	PackageName string
	Imports     []*Import
}

Data includes details of a service.

type DefaultParser

type DefaultParser struct{}

DefaultParser is an implementation of parser.

func (*DefaultParser) Parse

func (p *DefaultParser) Parse(path, serviceName string) (*Data, error)

Parse parses codes to return a service.

type Endpoint

type Endpoint struct {
	Name     string
	Method   string
	HTTPPath string
	Params   []Field
	Results  []Field
	Tags     map[string]string
}

Endpoint includes details of an endpoint.

type EntityParser

type EntityParser struct{}

EntityParser parses codes to retrieve details of an entity.

func (EntityParser) Parse

func (p EntityParser) Parse(path, entityName string) (*Data, error)

Parse parses codes to return details of an entity.

type Field

type Field struct {
	Name string
	Type string
}

Field presents a field in Golang. It includes name & type.

type Import

type Import struct {
	Path string
	Name string
}

Import presents an import in Golang.

type MockParser

type MockParser struct {
	mock.Mock
}

MockParser is an autogenerated mock type for the Parser type

func (*MockParser) Parse

func (_m *MockParser) Parse(path string, serviceName string) (*Data, error)

Parse provides a mock function with given fields: path, serviceName

type Parser

type Parser interface {
	Parse(path, serviceName string) (*Data, error)
}

Parser is an interface to wrap Parse method.

Jump to

Keyboard shortcuts

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