app

package
v1.41.9 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 License: MPL-2.0 Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Desc

type Desc struct {
	Errs *perr.List

	BuildInfo  parsectx.BuildInfo
	MainModule *pkginfo.Module
	Parse      *parser.Result
	Services   []*Service
	Gateways   []*Gateway

	// Framework describes API Framework-specific application-global data.
	Framework option.Option[*apiframework.AppDesc]

	// ResourceUsageOutsideServices describes resources that are used outside of a service.
	ResourceUsageOutsideServices map[resource.Resource][]usage.Usage
}

Desc describes an Encore application.

func ValidateAndDescribe

func ValidateAndDescribe(pc *parsectx.Context, result *parser.Result) *Desc

ValidateAndDescribe validates the application and computes the application description.

func (*Desc) MatchingGlobalMiddleware added in v1.16.0

func (d *Desc) MatchingGlobalMiddleware(ep *api.Endpoint) []*middleware.Middleware

MatchingGlobalMiddleware reports which global middleware applies to the given RPC, and the order they apply in.

func (*Desc) MatchingMiddleware

func (d *Desc) MatchingMiddleware(ep *api.Endpoint) []*middleware.Middleware

MatchingMiddleware reports which middleware applies to the given RPC, and the order they apply in.

func (*Desc) ServiceForPath

func (d *Desc) ServiceForPath(path paths.FS) (*Service, bool)

ServiceForPath returns the service a given folder path belongs to, if any.

type Gateway added in v1.33.0

type Gateway struct {
	// EncoreName is the encore-name of the gateway.
	EncoreName string
}

Gateway describes an Encore gateway.

type Service

type Service struct {
	// Name is the name of the service.
	Name string

	// Num is the 1-based service number in the application.
	Num int

	// FSRoot is the root directory of the service.
	FSRoot paths.FS

	// Framework contains API Framework-specific data for this service.
	Framework option.Option[*apiframework.ServiceDesc]

	// ResourceBinds describes the infra resources bound within the service.
	ResourceBinds map[resource.Resource][]resource.Bind

	// ResourceUsage describes the infra resources the service accesses and how.
	ResourceUsage map[resource.Resource][]usage.Usage
}

Service describes an Encore service.

func (*Service) ContainsPackage

func (s *Service) ContainsPackage(pkg *pkginfo.Package) bool

ContainsPackage reports whether the service contains the given package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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