zrok/controller/share.go

23 lines
592 B
Go
Raw Normal View History

2022-07-26 22:21:49 +02:00
package controller
import (
"github.com/go-openapi/runtime/middleware"
"github.com/openziti-test-kitchen/zrok/rest_model_zrok"
"github.com/openziti-test-kitchen/zrok/rest_server_zrok/operations/service"
2022-07-26 22:21:49 +02:00
)
type shareHandler struct{}
func newShareHandler() *shareHandler {
return &shareHandler{}
}
func (h *shareHandler) Handle(params service.ShareParams, principal *rest_model_zrok.Principal) middleware.Responder {
switch params.Body.ShareMode {
case "public":
return newSharePublicHandler().Handle(params, principal)
default:
return service.NewShareInternalServerError()
2022-07-27 15:49:54 +02:00
}
2022-09-15 21:18:37 +02:00
}