service-save.go 399 B

123456789101112131415161718
  1. package api
  2. import (
  3. "mesh/conf"
  4. "github.com/gin-gonic/gin"
  5. )
  6. func UploadPolicy(c *gin.Context, apictx *ApiSession) (interface{}, error) {
  7. saveType := apictx.Svc.Conf.SaveType
  8. if saveType == conf.SaveType_Obs {
  9. return ServiceObsUploadPolicy(c, apictx)
  10. }
  11. if saveType == conf.SaveType_Minio {
  12. return MinioCreateUserPolicy(c, apictx)
  13. }
  14. return nil, NewError("不支持的存储类型")
  15. }