generated from TBD54566975/tbd-project-template
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: schema support for cron metadata (#1216)
- detects verbs with cron annotations - language support: - full support in go - verbs don't need `//ftl:export` when annotated with `//ftl:cron` - rudimentary and untested support in kotlin (enough to define `@Cron("* * * * *)`)
- Loading branch information
Showing
21 changed files
with
704 additions
and
391 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
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
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,35 @@ | ||
package schema | ||
|
||
import ( | ||
"fmt" | ||
|
||
"google.golang.org/protobuf/proto" | ||
|
||
schemapb "github.com/TBD54566975/ftl/backend/protos/xyz/block/ftl/v1/schema" | ||
) | ||
|
||
type MetadataCronJob struct { | ||
Pos Position `parser:"" protobuf:"1,optional"` | ||
|
||
Cron string `parser:"'+' 'cron' Whitespace @((' ' | Number | '-' | '/' | '*' | ',')+)" protobuf:"2"` | ||
} | ||
|
||
var _ Metadata = (*MetadataCronJob)(nil) | ||
|
||
func (m *MetadataCronJob) Position() Position { return m.Pos } | ||
func (m *MetadataCronJob) String() string { | ||
return fmt.Sprintf("+cron %s", m.Cron) | ||
} | ||
|
||
func (m *MetadataCronJob) schemaChildren() []Node { | ||
return nil | ||
} | ||
|
||
func (*MetadataCronJob) schemaMetadata() {} | ||
|
||
func (m *MetadataCronJob) ToProto() proto.Message { | ||
return &schemapb.MetadataCronJob{ | ||
Pos: posToProto(m.Pos), | ||
Cron: m.Cron, | ||
} | ||
} |
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
Oops, something went wrong.