expr

package
v3.0.9 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Root = &RootExpr{
	Description: map[eval.Expression]*I18nExpr{},
	Example:     map[eval.Expression]*I18nExpr{},
	Title:       map[eval.Expression]*I18nExpr{},
}

Root is the design root expression.

Functions

This section is empty.

Types

type I18nExpr

type I18nExpr struct {
	// Origin is the origin string.
	Trans []Translateable
	// Parent expression, ServiceExpr or APIExpr.
	Parent eval.Expression
}

I18nExpr describes a CORS policy.

func (*I18nExpr) EvalName

func (i18n *I18nExpr) EvalName() string

EvalName returns the generic expression name used in error messages.

func (*I18nExpr) Messages

func (i18n *I18nExpr) Messages(locale string) []string

func (*I18nExpr) Validate

func (i18n *I18nExpr) Validate() *eval.ValidationErrors

Validate ensures the origin expression is valid.

type RootExpr

type RootExpr struct {
	// APIOrigins lists all the CORS definitions indexed by origin string
	// at the API level.
	Description map[eval.Expression]*I18nExpr
	Example     map[eval.Expression]*I18nExpr
	Title       map[eval.Expression]*I18nExpr
}

RootExpr keeps track of the CORS origins 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 I18n definitions.

type Translateable

type Translateable = func(locale string) string

Jump to

Keyboard shortcuts

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