expr

package
v0.0.0-...-a706973 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Root = &RootExpr{
	HTTPEndpoints: map[string]map[string]*HTTPEndpointExpr{},
}

Root is the design root expression.

Functions

This section is empty.

Types

type HTTPEndpointExpr

type HTTPEndpointExpr struct {
	// MethodExpr is the underlying method expression.
	MethodExpr *expr.MethodExpr
	// Service is the parent service.
	Service *expr.HTTPServiceExpr
	// OptionalBody indicates that the HTTP request body is optional.
	OptionalBody bool
}

HTTPEndpointExpr describes a HTTP endpoint.

func (*HTTPEndpointExpr) EvalName

func (e *HTTPEndpointExpr) EvalName() string

EvalName returns the generic expression name used in error messages.

func (*HTTPEndpointExpr) Name

func (e *HTTPEndpointExpr) Name() string

Name of HTTP endpoint

func (*HTTPEndpointExpr) Validate

func (e *HTTPEndpointExpr) Validate() *eval.ValidationErrors

Validate validates the endpoint expression.

type RootExpr

type RootExpr struct {
	// HTTPEndpoints lists all the service endpoints indexed by service and method strings.
	HTTPEndpoints map[string]map[string]*HTTPEndpointExpr
}

RootExpr keeps track of the optional bodies defined in the design.

func (*RootExpr) DependsOn

func (r *RootExpr) DependsOn() []eval.Root

DependsOn tells the eval engine to run the goa DSL first.

func (*RootExpr) EvalName

func (r *RootExpr) EvalName() string

EvalName returns the name used in error messages.

func (*RootExpr) Packages

func (r *RootExpr) Packages() []string

Packages returns the import path to the Go packages that make up the DSL. This is used to skip frames that point to files in these packages when computing the location of errors.

func (*RootExpr) WalkSets

func (r *RootExpr) WalkSets(walk eval.SetWalker)

WalkSets iterates over the API-level and service-level optional body definitions.

Jump to

Keyboard shortcuts

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