Feat: add read/write lock for authn

This commit is contained in:
HFO4
2020-02-23 15:33:53 +08:00
parent 3ce4b87f2b
commit ce2a70df68
4 changed files with 31 additions and 0 deletions

View File

@ -1,7 +1,9 @@
package controllers
import (
"github.com/HFO4/cloudreve/pkg/authn"
"github.com/HFO4/cloudreve/pkg/request"
"github.com/HFO4/cloudreve/pkg/serializer"
"github.com/HFO4/cloudreve/service/admin"
"github.com/gin-gonic/gin"
"io"
@ -57,3 +59,14 @@ func AdminGetGroups(c *gin.Context) {
c.JSON(200, ErrorResponse(err))
}
}
// AdminReloadService 重新加载子服务
func AdminReloadService(c *gin.Context) {
service := c.Param("service")
switch service {
case "authn":
authn.Init()
}
c.JSON(200, serializer.Response{})
}