Add support for session restore on the linux portals backend, fixing #77

This commit is contained in:
godalming 2025-03-15 12:05:29 +00:00
parent 7a806f7b00
commit 05259f6db5
8 changed files with 70 additions and 13 deletions

View file

@ -55,14 +55,14 @@ const (
type ControllerInfo struct {
Name string
Init func() (Controller, error)
Init func(bool) (Controller, error)
priority int
}
var Controllers []ControllerInfo
func RegisterController(name string, init func() (Controller, error), priority int) {
func RegisterController(name string, init func(bool) (Controller, error), priority int) {
Controllers = append(Controllers, ControllerInfo{name, init, priority})
sort.SliceStable(Controllers, func(i, j int) bool {
return Controllers[i].priority < Controllers[j].priority