use sdk types/constants throughout the codebase for backend and share modes (#34)

This commit is contained in:
Michael Quigley
2023-07-17 16:21:29 -04:00
parent 141c9ae685
commit c0503ae593
10 changed files with 41 additions and 31 deletions

View File

@ -5,6 +5,7 @@ import (
"github.com/openziti/edge-api/rest_management_api_client"
"github.com/openziti/zrok/controller/store"
"github.com/openziti/zrok/controller/zrokEdgeSdk"
"github.com/openziti/zrok/sdk"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
)
@ -28,11 +29,11 @@ func (a *shareRelaxAction) HandleShare(shr *store.Share, _, _ int64, _ *Bandwidt
}
switch shr.ShareMode {
case "public":
case string(sdk.PublicShareMode):
if err := relaxPublicShare(a.str, edge, shr, trx); err != nil {
return err
}
case "private":
case string(sdk.PrivateShareMode):
if err := relaxPrivateShare(a.str, edge, shr, trx); err != nil {
return err
}