kopia lustrzana https://codeberg.org/nmkj/audon
adding permission update
rodzic
76f4d0f5b7
commit
7771d4d762
19
room.go
19
room.go
|
@ -14,10 +14,15 @@ import (
|
||||||
"go.mongodb.org/mongo-driver/mongo"
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
)
|
)
|
||||||
|
|
||||||
type TokenMessage struct {
|
type (
|
||||||
RtcURL string `json:"rtc"`
|
TokenResponse struct {
|
||||||
Token string `json:"token"`
|
RtcURL string `json:"rtc"`
|
||||||
}
|
Token string `json:"token"`
|
||||||
|
}
|
||||||
|
|
||||||
|
PermissionRequest struct {
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
// handler for POST to /api/room
|
// handler for POST to /api/room
|
||||||
func createRoomHandler(c echo.Context) error {
|
func createRoomHandler(c echo.Context) error {
|
||||||
|
@ -99,7 +104,7 @@ func joinRoomHandler(c echo.Context) (err error) {
|
||||||
return echo.NewHTTPError(http.StatusInternalServerError)
|
return echo.NewHTTPError(http.StatusInternalServerError)
|
||||||
}
|
}
|
||||||
|
|
||||||
resp := &TokenMessage{
|
resp := &TokenResponse{
|
||||||
RtcURL: mainConfig.Livekit.URL.String(),
|
RtcURL: mainConfig.Livekit.URL.String(),
|
||||||
Token: token,
|
Token: token,
|
||||||
}
|
}
|
||||||
|
@ -146,6 +151,10 @@ func closeRoomHandler(c echo.Context) error {
|
||||||
return c.NoContent(http.StatusOK)
|
return c.NoContent(http.StatusOK)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func updatePermissionHandler(c echo.Context) error {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
func getRoomToken(room *Room, identity string, canTalk bool) (string, error) {
|
func getRoomToken(room *Room, identity string, canTalk bool) (string, error) {
|
||||||
at := auth.NewAccessToken(mainConfig.Livekit.APIKey, mainConfig.Livekit.APISecret)
|
at := auth.NewAccessToken(mainConfig.Livekit.APIKey, mainConfig.Livekit.APISecret)
|
||||||
grant := &auth.VideoGrant{
|
grant := &auth.VideoGrant{
|
||||||
|
|
Ładowanie…
Reference in New Issue