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

@ -4,6 +4,7 @@ import (
"github.com/jmoiron/sqlx"
"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"
)
@ -33,11 +34,11 @@ func (a *environmentRelaxAction) HandleEnvironment(env *store.Environment, rxByt
for _, shr := range shrs {
if !shr.Deleted {
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
}