engine: resources: Add some compile time checks for groupers

These can "break" silently and not autogroup if we change the resource
and it no longer fulfills the interface. Add this compile time check to
prevent that.
This commit is contained in:
James Shubin
2025-05-25 03:47:47 -04:00
parent b868a60f69
commit 74f36c5d73
5 changed files with 10 additions and 0 deletions

View File

@@ -52,6 +52,8 @@ func init() {
engine.RegisterResource(httpServerFileKind, func() engine.Res { return &HTTPServerFileRes{} })
}
var _ HTTPServerGroupableRes = &HTTPServerFileRes{} // compile time check
// HTTPServerFileRes is a file that exists within an http server. The name is
// used as the public path of the file, unless the filename field is specified,
// and in that case it is used instead. The way this works is that it autogroups