internal: Annotate all components with groups
This commit ensures that the compiler has to check every component against the groups they implement by explicitly annotating the appropriate interfaces.
This commit is contained in:
parent
3455f491ca
commit
890022ae64
29 changed files with 163 additions and 33 deletions
|
|
@ -16,6 +16,10 @@ type Control struct {
|
|||
Servables []component.Servable
|
||||
}
|
||||
|
||||
var (
|
||||
_ component.Installable = (*Control)(nil)
|
||||
)
|
||||
|
||||
func (control Control) Path() string {
|
||||
return filepath.Join(control.Still.Config.DeployRoot, "core", "dis")
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,10 @@ type Home struct {
|
|||
homeBytes lazy.Lazy[[]byte]
|
||||
}
|
||||
|
||||
var (
|
||||
_ component.Servable = (*Home)(nil)
|
||||
)
|
||||
|
||||
func (*Home) Routes() []string { return []string{"/"} }
|
||||
|
||||
func (home *Home) Handler(ctx context.Context, route string, io stream.IOStream) (http.Handler, error) {
|
||||
|
|
|
|||
|
|
@ -26,6 +26,11 @@ type Info struct {
|
|||
SnapshotsLog *logger.Logger
|
||||
}
|
||||
|
||||
var (
|
||||
_ component.DistilleryFetcher = (*Info)(nil)
|
||||
_ component.Servable = (*Info)(nil)
|
||||
)
|
||||
|
||||
func (*Info) Routes() []string { return []string{"/dis/"} }
|
||||
|
||||
func (info *Info) Handler(ctx context.Context, route string, io stream.IOStream) (handler http.Handler, err error) {
|
||||
|
|
|
|||
|
|
@ -15,6 +15,10 @@ type Static struct {
|
|||
component.Base
|
||||
}
|
||||
|
||||
var (
|
||||
_ component.Servable = (*Static)(nil)
|
||||
)
|
||||
|
||||
func (*Static) Routes() []string { return []string{"/static/"} }
|
||||
|
||||
//go:embed dist
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue