-
Notifications
You must be signed in to change notification settings - Fork 320
/
apiframework.go
36 lines (29 loc) · 1.08 KB
/
apiframework.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
package apiframework
import (
"encr.dev/pkg/option"
"encr.dev/v2/internals/pkginfo"
"encr.dev/v2/parser/apis/api"
"encr.dev/v2/parser/apis/authhandler"
"encr.dev/v2/parser/apis/middleware"
"encr.dev/v2/parser/apis/servicestruct"
)
// AppDesc describes an Encore Framework-based application.
type AppDesc struct {
// GlobalMiddleware is the list of application-global middleware.
GlobalMiddleware []*middleware.Middleware
// AuthHandler defines the application's auth handler, if any.
AuthHandler option.Option[*authhandler.AuthHandler]
}
// ServiceDesc describes an Encore Framework-based service.
//
// For code that deals with general services, use *service.Service instead of this type.
type ServiceDesc struct {
// Middleware are the service-specific middleware
Middleware []*middleware.Middleware
// RootPkg is the root package of the service.
RootPkg *pkginfo.Package
// Endpoints are the endpoints defined in this service.
Endpoints []*api.Endpoint
// ServiceStruct defines the service's service struct, if any.
ServiceStruct option.Option[*servicestruct.ServiceStruct]
}