parse

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2019 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAmqpEncodeDecodeParser added in v0.5.0

func NewAmqpEncodeDecodeParser(path string, publisherNames []string, subscriberNames []string) *amqpEncodeDecodeParser

func NewEndpointsParser

func NewEndpointsParser(path string, serviceIface *types.Interface) *endpointsParser

func NewImplementationParser

func NewImplementationParser(path string, serviceInterface *types.Interface) *implementationParser

func NewTransportEncodeDecodeParser

func NewTransportEncodeDecodeParser(path string, serviceIface *types.Interface) *transportEncodeDecodeParser

func NewTransportRequestResponseParser

func NewTransportRequestResponseParser(path string, serviceIface *types.Interface) *transportRequestResponseParser

Types

type Service

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

func NewServiceParser

func NewServiceParser(path string) *Service

func (*Service) FindInterface

func (p *Service) FindInterface(interfaceName string) (iface types.Interface, err error)

FindInterface searches for an interface with the given name

func (*Service) HasFunction

func (p *Service) HasFunction(name string) bool

HasFunction checks whether the file has a function with the given name

func (*Service) HasMethod

func (p *Service) HasMethod(name string) bool

HasMethod checks whether the file has a method with the given name

func (*Service) ParseFile

func (p *Service) ParseFile() (err error)

ParseFile will use go-astra to parse the service-File

func (*Service) ValidateInterface

func (s *Service) ValidateInterface() (err error)

ValidateInterface will check if the interface meets Godin's requirements:

+ every method must have at least one comment line + first parameter must be 'context.Context' + last return parameter must be ' error' + all results must be named + if a custom type is used, it MUST be defined in the same File

Jump to

Keyboard shortcuts

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