-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
internal/qmp-gen: generate implementations for events.
- Loading branch information
Showing
5 changed files
with
642 additions
and
40 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 |
---|---|---|
@@ -1 +1,14 @@ | ||
// EVENT {{ .Name }} | ||
// {{ .Name }} -> {{ .Name.Go }} (event) | ||
|
||
{{- if (.Data.Fields API).HasInterfaceField API }} | ||
{{ abort "Events with union/alternate fields are not supported (to implement, steal from structtype's template)" }} | ||
{{- end }} | ||
|
||
// {{ .Name.Go }} implements the "{{ .Name }}" event. | ||
type {{ .Name.Go }} struct { | ||
{{- range .Data.Fields API }} | ||
{{ render . }} | ||
{{- end }} | ||
} | ||
|
||
func ({{ .Name.Go }}) isEvent() {} |
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.