est

package
v0.14.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2021 License: MPL-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package est provides the Encore Syntax Tree (EST).

It is an Encore-specific syntax tree that represents the higher-level representation of the application that Encore understands.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessType

type AccessType string
const (
	Public  AccessType = "public"
	Private AccessType = "private"
	// Auth is like public but requires authentication.
	Auth AccessType = "auth"
)

type Application

type Application struct {
	ModulePath  string
	Packages    []*Package
	Services    []*Service
	Decls       []*schema.Decl
	AuthHandler *AuthHandler
}

type AuthHandler

type AuthHandler struct {
	Svc      *Service
	Name     string
	Doc      string
	Func     *ast.FuncDecl
	File     *File
	AuthData *Param // or nil
}

type File

type File struct {
	Name       string   // file name ("foo.go")
	Pkg        *Package // package it belongs to
	Path       string   // filesystem path
	AST        *ast.File
	Token      *token.File
	Contents   []byte
	References map[ast.Node]*Node
}

type Node

type Node struct {
	Type NodeType
	// If Type == RPCDefNode or RPCCallNode,
	// RPC is the RPC being defined or called.
	RPC *RPC
	// If Type == SQLDBNode or RLogNode,
	// Func is the func name being called.
	Func string
}

type NodeType

type NodeType int
const (
	RPCDefNode NodeType = iota + 1
	RPCCallNode
	SQLDBNode
	RLogNode
	SecretsNode
)

type Package

type Package struct {
	AST        *ast.Package
	Name       string
	Doc        string
	ImportPath string // import path
	RelPath    string // import path relative to app root
	Dir        string // filesystem path
	Files      []*File
	Service    *Service // the service this package belongs to, if any
	Secrets    []string
}

type Param

type Param struct {
	IsPtr bool
	Decl  *schema.Decl
}

type RPC

type RPC struct {
	Svc      *Service
	Name     string
	Doc      string
	Func     *ast.FuncDecl
	File     *File
	Access   AccessType
	Raw      bool
	Request  *Param // request data; nil for Raw RPCs
	Response *Param // response data; nil for Raw RPCs
}

type Service

type Service struct {
	Name string
	Root *Package
	Pkgs []*Package
	RPCs []*RPC
}

A Service is a Go package that defines one or more RPCs. Its name is defined by the Go package name. A Service may not be a located in a child directory of another service.

Jump to

Keyboard shortcuts

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