-
Notifications
You must be signed in to change notification settings - Fork 384
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ENC-973] Recognise service structs as service creators (#473)
This commit makes it so if a service struct is defined, Encore will recongise that package as the root of a service - even if no API's exist. This is to allow services which perform background tasks to poll for events.
- Loading branch information
Showing
2 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Verify that a service struct forces the creation of a service | ||
# even if it has no API's defined. | ||
|
||
parse | ||
stdout 'svc foobar ' | ||
|
||
-- foobar/svc.go -- | ||
package foobar | ||
|
||
import ( | ||
"context" | ||
) | ||
|
||
//encore:service | ||
type Service struct {} |