-
Notifications
You must be signed in to change notification settings - Fork 4
/
pkgfn.go
32 lines (30 loc) · 1.29 KB
/
pkgfn.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
package encore
// Meta returns metadata about the running application.
//
// Meta will never return nil.
func Meta() (_ *AppMetadata) {
// Encore will provide an implementation to this function at runtime, we do not expose
// the implementation in the API contract as it is an implementation detail, which may change
// between releases.
//
// The current implementation of this function can be found here:
// https://github.com/encoredev/encore/blob/v1.18.0/runtime/pkgfn.go#L16-L18
doPanic("encore apps must be run using the encore command")
return
}
// CurrentRequest returns the Request that is currently being handled by the calling goroutine
//
// It is safe for concurrent use and will return a new Request on each evocation, so can be mutated by the
// calling code without impacting future calls.
//
// CurrentRequest never returns nil.
func CurrentRequest() (_ *Request) {
// Encore will provide an implementation to this function at runtime, we do not expose
// the implementation in the API contract as it is an implementation detail, which may change
// between releases.
//
// The current implementation of this function can be found here:
// https://github.com/encoredev/encore/blob/v1.18.0/runtime/pkgfn.go#L26-L28
doPanic("encore apps must be run using the encore command")
return
}