feat(wopi): implement required rest api as a WOPI host

This commit is contained in:
HFO4
2023-01-09 19:37:46 +08:00
parent 4541400755
commit 1c922ac981
12 changed files with 462 additions and 19 deletions

View File

@@ -3,6 +3,7 @@ package wopi
import (
"encoding/gob"
"encoding/xml"
"net/url"
)
// Response content from discovery endpoint.
@@ -49,10 +50,21 @@ type Action struct {
Newext string `xml:"newext,attr"`
}
type Session struct {
AccessToken string
AccessTokenTTL int64
ActionURL *url.URL
}
type SessionCache struct {
AccessToken string
FileID uint
UserID uint
Action ActonType
}
func init() {
gob.Register(WopiDiscovery{})
gob.Register(Action{})
}
type Session struct {
gob.Register(SessionCache{})
}