mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-18 04:13:10 -06:00
31 lines
582 B
Go
31 lines
582 B
Go
package version
|
|
|
|
import (
|
|
"errors"
|
|
|
|
"github.com/matrix-org/dendrite/roomserver/state"
|
|
)
|
|
|
|
type RoomVersionID int
|
|
|
|
const (
|
|
RoomVersionV1 RoomVersionID = iota + 1
|
|
)
|
|
|
|
type RoomVersionDescription struct {
|
|
Stable bool
|
|
StateResolution state.StateResolutionVersion
|
|
}
|
|
|
|
func GetRoomVersionDescription(version RoomVersionID) (RoomVersionDescription, error) {
|
|
switch version {
|
|
case RoomVersionV1:
|
|
return RoomVersionDescription{
|
|
Stable: true,
|
|
StateResolution: state.StateResolutionV1,
|
|
}, nil
|
|
default:
|
|
return nil, errors.New("unsupported room version")
|
|
}
|
|
}
|