environment -> env_v0_3 (#369)

This commit is contained in:
Michael Quigley 2023-07-11 14:59:02 -04:00
parent e26ef1ba1a
commit c468c7ace9
No known key found for this signature in database
GPG Key ID: 9B60314A9DD20A62
33 changed files with 75 additions and 75 deletions

View File

@ -8,7 +8,7 @@ import (
"github.com/openziti/zrok/endpoints/proxy"
"github.com/openziti/zrok/endpoints/tcpTunnel"
"github.com/openziti/zrok/endpoints/udpTunnel"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_client_zrok"
"github.com/openziti/zrok/rest_client_zrok/share"
"github.com/openziti/zrok/rest_model_zrok"
@ -48,7 +48,7 @@ func newAccessPrivateCommand() *accessPrivateCommand {
func (cmd *accessPrivateCommand) run(_ *cobra.Command, args []string) {
shrToken := args[0]
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
tui.Error("error loading environment", err)
}

View File

@ -1,9 +1,9 @@
package main
import (
"github.com/openziti/zrok/environment/env_v0_3"
"os"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/rest_client_zrok/admin"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/openziti/zrok/tui"
@ -35,7 +35,7 @@ func (cmd *adminCreateFrontendCommand) run(_ *cobra.Command, args []string) {
publicName := args[1]
urlTemplate := args[2]
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}

View File

@ -2,8 +2,8 @@ package main
import (
"fmt"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_client_zrok/admin"
"github.com/openziti/zrok/environment"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"os"
@ -32,7 +32,7 @@ func newAdminCreateIdentity() *adminCreateIdentity {
func (cmd *adminCreateIdentity) run(_ *cobra.Command, args []string) {
name := args[0]
zif, err := environment.ZitiIdentityFile(name)
zif, err := env_v0_3.ZitiIdentityFile(name)
if err != nil {
panic(err)
}
@ -41,7 +41,7 @@ func (cmd *adminCreateIdentity) run(_ *cobra.Command, args []string) {
os.Exit(1)
}
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}
@ -59,7 +59,7 @@ func (cmd *adminCreateIdentity) run(_ *cobra.Command, args []string) {
panic(err)
}
if err := environment.SaveZitiIdentity(name, resp.Payload.Cfg); err != nil {
if err := env_v0_3.SaveZitiIdentity(name, resp.Payload.Cfg); err != nil {
panic(err)
}

View File

@ -1,9 +1,9 @@
package main
import (
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_client_zrok/admin"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/openziti/zrok/environment"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
@ -30,7 +30,7 @@ func newAdminDeleteFrontendCommand() *adminDeleteFrontendCommand {
func (cmd *adminDeleteFrontendCommand) run(_ *cobra.Command, args []string) {
feToken := args[0]
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}

View File

@ -3,7 +3,7 @@ package main
import (
"fmt"
"github.com/jaevor/go-nanoid"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_client_zrok/admin"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/sirupsen/logrus"
@ -43,7 +43,7 @@ func (cmd *adminGenerateCommand) run(_ *cobra.Command, args []string) {
}
}
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
logrus.Error("error loading environment", err)
}

View File

@ -3,8 +3,8 @@ package main
import (
"fmt"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_client_zrok/admin"
"github.com/openziti/zrok/environment"
"github.com/spf13/cobra"
"os"
"time"
@ -31,7 +31,7 @@ func newAdminListFrontendsCommand() *adminListFrontendsCommand {
}
func (cmd *adminListFrontendsCommand) run(_ *cobra.Command, _ []string) {
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}

View File

@ -1,9 +1,9 @@
package main
import (
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_client_zrok/admin"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/openziti/zrok/environment"
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
)
@ -38,7 +38,7 @@ func (cmd *adminUpdateFrontendCommand) run(_ *cobra.Command, args []string) {
panic("must specify at least one of public name or url template")
}
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}

View File

@ -2,7 +2,7 @@ package main
import (
"fmt"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/spf13/cobra"
)
@ -28,7 +28,7 @@ func newConfigGetCommand() *configGetCommand {
func (cmd *configGetCommand) run(_ *cobra.Command, args []string) {
configName := args[0]
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}

View File

@ -2,10 +2,10 @@ package main
import (
"fmt"
"github.com/openziti/zrok/environment/env_v0_3"
"net/url"
"os"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/tui"
"github.com/spf13/cobra"
)
@ -33,7 +33,7 @@ func (cmd *configSetCommand) run(_ *cobra.Command, args []string) {
configName := args[0]
value := args[1]
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}
@ -42,7 +42,7 @@ func (cmd *configSetCommand) run(_ *cobra.Command, args []string) {
switch configName {
case "apiEndpoint":
if zrd.Cfg == nil {
zrd.Cfg = &environment.Config{}
zrd.Cfg = &env_v0_3.Config{}
}
ok, err := isFullyValidUrl(value)
if err != nil {

View File

@ -2,8 +2,8 @@ package main
import (
"fmt"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/tui"
"github.com/openziti/zrok/environment"
"github.com/spf13/cobra"
"os"
)
@ -30,7 +30,7 @@ func newConfigUnsetCommand() *configUnsetCommand {
func (cmd *configUnsetCommand) run(_ *cobra.Command, args []string) {
configName := args[0]
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}

View File

@ -2,7 +2,7 @@ package main
import (
"fmt"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/tui"
"github.com/spf13/cobra"
)
@ -27,7 +27,7 @@ func newConsoleCommand() *consoleCommand {
}
func (cmd *consoleCommand) run(_ *cobra.Command, _ []string) {
env, err := environment.Load()
env, err := env_v0_3.Load()
if err != nil {
tui.Error("unable to load environment", err)
}

View File

@ -3,7 +3,7 @@ package main
import (
"fmt"
httpTransport "github.com/go-openapi/runtime/client"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
restEnvironment "github.com/openziti/zrok/rest_client_zrok/environment"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/openziti/zrok/tui"
@ -31,7 +31,7 @@ func newDisableCommand() *disableCommand {
}
func (cmd *disableCommand) run(_ *cobra.Command, _ []string) {
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
if !panicInstead {
tui.Error("unable to load environment", err)
@ -59,13 +59,13 @@ func (cmd *disableCommand) run(_ *cobra.Command, _ []string) {
if err != nil {
logrus.Warnf("share cleanup failed (%v); will clean up local environment", err)
}
if err := environment.DeleteEnvironment(); err != nil {
if err := env_v0_3.DeleteEnvironment(); err != nil {
if !panicInstead {
tui.Error("error removing zrok environment", err)
}
panic(err)
}
if err := environment.DeleteZitiIdentity("backend"); err != nil {
if err := env_v0_3.DeleteZitiIdentity("backend"); err != nil {
if !panicInstead {
tui.Error("error removing zrok backend identity", err)
}

View File

@ -2,6 +2,7 @@ package main
import (
"fmt"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/sirupsen/logrus"
"os"
user2 "os/user"
@ -10,7 +11,6 @@ import (
"github.com/charmbracelet/bubbles/spinner"
tea "github.com/charmbracelet/bubbletea"
httptransport "github.com/go-openapi/runtime/client"
"github.com/openziti/zrok/environment"
restEnvironment "github.com/openziti/zrok/rest_client_zrok/environment"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/openziti/zrok/tui"
@ -42,7 +42,7 @@ func newEnableCommand() *enableCommand {
}
func (cmd *enableCommand) run(_ *cobra.Command, args []string) {
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}
@ -117,7 +117,7 @@ func (cmd *enableCommand) run(_ *cobra.Command, args []string) {
prg.Send("writing the environment details...")
}
apiEndpoint, _ := zrd.ApiEndpoint()
zrd.Env = &environment.Environment{Token: token, ZId: resp.Payload.Identity, ApiEndpoint: apiEndpoint}
zrd.Env = &env_v0_3.Environment{Token: token, ZId: resp.Payload.Identity, ApiEndpoint: apiEndpoint}
if err := zrd.Save(); err != nil {
if !cmd.headless && prg != nil {
prg.Send(fmt.Sprintf("there was an error saving the new environment: %v", err))
@ -131,7 +131,7 @@ func (cmd *enableCommand) run(_ *cobra.Command, args []string) {
}
os.Exit(1)
}
if err := environment.SaveZitiIdentity("backend", resp.Payload.Cfg); err != nil {
if err := env_v0_3.SaveZitiIdentity("backend", resp.Payload.Cfg); err != nil {
if !cmd.headless && prg != nil {
prg.Send(fmt.Sprintf("there was an error writing the environment: %v", err))
prg.Quit()

View File

@ -2,13 +2,13 @@ package main
import (
"fmt"
"github.com/openziti/zrok/environment/env_v0_3"
"os"
"strings"
"github.com/charmbracelet/bubbles/textinput"
tea "github.com/charmbracelet/bubbletea"
"github.com/charmbracelet/lipgloss"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/rest_client_zrok/account"
"github.com/openziti/zrok/rest_client_zrok/metadata"
"github.com/openziti/zrok/rest_model_zrok"
@ -42,7 +42,7 @@ func newInviteCommand() *inviteCommand {
}
func (cmd *inviteCommand) run(_ *cobra.Command, _ []string) {
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
tui.Error("error loading environment", err)
}

View File

@ -2,7 +2,7 @@ package main
import (
httptransport "github.com/go-openapi/runtime/client"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_client_zrok/share"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/openziti/zrok/tui"
@ -31,7 +31,7 @@ func newReleaseCommand() *releaseCommand {
func (cmd *releaseCommand) run(_ *cobra.Command, args []string) {
shrToken := args[0]
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
if !panicInstead {
tui.Error("unable to load environment", err)

View File

@ -2,7 +2,7 @@ package main
import (
httptransport "github.com/go-openapi/runtime/client"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/openziti/zrok/rest_client_zrok/share"
"github.com/openziti/zrok/rest_model_zrok"
@ -60,7 +60,7 @@ func (cmd *reserveCommand) run(_ *cobra.Command, args []string) {
target = args[1]
}
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
if !panicInstead {
tui.Error("error loading environment", err)

View File

@ -9,7 +9,7 @@ import (
"github.com/openziti/zrok/endpoints/proxy"
"github.com/openziti/zrok/endpoints/tcpTunnel"
"github.com/openziti/zrok/endpoints/udpTunnel"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/openziti/zrok/rest_client_zrok"
"github.com/openziti/zrok/rest_client_zrok/share"
@ -78,7 +78,7 @@ func (cmd *sharePrivateCommand) run(_ *cobra.Command, args []string) {
tui.Error(fmt.Sprintf("invalid backend mode '%v'; expected {proxy, web, tcpTunnel}", cmd.backendMode), nil)
}
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
if !panicInstead {
tui.Error("unable to load environment", err)
@ -90,7 +90,7 @@ func (cmd *sharePrivateCommand) run(_ *cobra.Command, args []string) {
tui.Error("unable to load environment; did you 'zrok enable'?", nil)
}
zif, err := environment.ZitiIdentityFile("backend")
zif, err := env_v0_3.ZitiIdentityFile("backend")
if err != nil {
if !panicInstead {
tui.Error("unable to load ziti identity configuration", err)

View File

@ -7,7 +7,7 @@ import (
httptransport "github.com/go-openapi/runtime/client"
"github.com/openziti/zrok/endpoints"
"github.com/openziti/zrok/endpoints/proxy"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/openziti/zrok/rest_client_zrok"
"github.com/openziti/zrok/rest_client_zrok/share"
@ -72,7 +72,7 @@ func (cmd *sharePublicCommand) run(_ *cobra.Command, args []string) {
tui.Error(fmt.Sprintf("invalid backend mode '%v'; expected {proxy, web}", cmd.backendMode), nil)
}
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
if !panicInstead {
tui.Error("unable to load environment", err)
@ -84,7 +84,7 @@ func (cmd *sharePublicCommand) run(_ *cobra.Command, args []string) {
tui.Error("unable to load environment; did you 'zrok enable'?", nil)
}
zif, err := environment.ZitiIdentityFile("backend")
zif, err := env_v0_3.ZitiIdentityFile("backend")
if err != nil {
if !panicInstead {
tui.Error("unable to load ziti identity configuration", err)

View File

@ -6,7 +6,7 @@ import (
httptransport "github.com/go-openapi/runtime/client"
"github.com/openziti/zrok/endpoints"
"github.com/openziti/zrok/endpoints/proxy"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_client_zrok/metadata"
"github.com/openziti/zrok/rest_client_zrok/share"
"github.com/openziti/zrok/rest_model_zrok"
@ -44,7 +44,7 @@ func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
shrToken := args[0]
var target string
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
if !panicInstead {
tui.Error("error loading environment", err)
@ -78,7 +78,7 @@ func (cmd *shareReservedCommand) run(_ *cobra.Command, args []string) {
target = resp.Payload.BackendProxyEndpoint
}
zif, err := environment.ZitiIdentityFile("backend")
zif, err := env_v0_3.ZitiIdentityFile("backend")
if err != nil {
if !panicInstead {
tui.Error("unable to load ziti identity configuration", err)

View File

@ -3,7 +3,7 @@ package main
import (
"fmt"
"github.com/jedib0t/go-pretty/v6/table"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/tui"
"github.com/spf13/cobra"
"os"
@ -34,7 +34,7 @@ func newStatusCommand() *statusCommand {
func (cmd *statusCommand) run(_ *cobra.Command, _ []string) {
_, _ = fmt.Fprintf(os.Stderr, "\n")
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
tui.Error("error loading environment", err)
}

View File

@ -8,7 +8,7 @@ import (
httptransport "github.com/go-openapi/runtime/client"
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/sdk-golang/ziti/edge"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/openziti/zrok/rest_client_zrok"
"github.com/openziti/zrok/rest_client_zrok/share"
@ -105,7 +105,7 @@ func (cmd *testLoopPublicCommand) run(_ *cobra.Command, _ []string) {
type looper struct {
id int
cmd *testLoopPublicCommand
env *environment.Environment
env *env_v0_3.Environment
done chan struct{}
listener edge.Listener
zif string
@ -175,7 +175,7 @@ func (l *looper) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func (l *looper) startup() {
logrus.Infof("starting #%d", l.id)
zrd, err := environment.Load()
zrd, err := env_v0_3.Load()
if err != nil {
panic(err)
}
@ -185,7 +185,7 @@ func (l *looper) startup() {
}
l.env = zrd.Env
l.zif, err = environment.ZitiIdentityFile("backend")
l.zif, err = env_v0_3.ZitiIdentityFile("backend")
if err != nil {
panic(err)
}

View File

@ -14,7 +14,7 @@ import (
zrok_config "github.com/openziti/zrok/controller/config"
"github.com/openziti/zrok/controller/store"
"github.com/openziti/zrok/controller/zrokEdgeSdk"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@ -133,7 +133,7 @@ func assertZrokProxyConfigType(edge *rest_management_api_client.ZitiEdgeManageme
}
func getIdentityId(identityName string) (string, error) {
zif, err := environment.ZitiIdentityFile(identityName)
zif, err := env_v0_3.ZitiIdentityFile(identityName)
if err != nil {
return "", errors.Wrapf(err, "error opening identity '%v' from environment", identityName)
}
@ -195,7 +195,7 @@ func bootstrapIdentity(name string, edge *rest_management_api_client.ZitiEdgeMan
if err != nil {
return "", errors.Wrapf(err, "error encoding identity config '%v'", name)
}
if err := environment.SaveZitiIdentity(name, out.String()); err != nil {
if err := env_v0_3.SaveZitiIdentity(name, out.String()); err != nil {
return "", errors.Wrapf(err, "error saving identity config '%v'", name)
}
return zId, nil

View File

@ -6,7 +6,7 @@ import (
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/zrok/endpoints"
"github.com/openziti/zrok/endpoints/publicProxy/notFoundUi"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/openziti/zrok/util"
"github.com/pkg/errors"
@ -40,7 +40,7 @@ type Frontend struct {
}
func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
zCfgPath, err := environment.ZitiIdentityFile(cfg.IdentityName)
zCfgPath, err := env_v0_3.ZitiIdentityFile(cfg.IdentityName)
if err != nil {
return nil, errors.Wrapf(err, "error getting ziti identity '%v' from environment", cfg.IdentityName)
}

View File

@ -7,7 +7,7 @@ import (
"github.com/openziti/zrok/endpoints"
"github.com/openziti/zrok/endpoints/publicProxy/healthUi"
"github.com/openziti/zrok/endpoints/publicProxy/notFoundUi"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/openziti/zrok/util"
"github.com/pkg/errors"
@ -26,7 +26,7 @@ type httpFrontend struct {
}
func NewHTTP(cfg *Config) (*httpFrontend, error) {
zCfgPath, err := environment.ZitiIdentityFile(cfg.Identity)
zCfgPath, err := env_v0_3.ZitiIdentityFile(cfg.Identity)
if err != nil {
return nil, errors.Wrapf(err, "error getting ziti identity '%v' from environment", cfg.Identity)
}

View File

@ -3,7 +3,7 @@ package tcpTunnel
import (
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/zrok/endpoints"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@ -29,7 +29,7 @@ func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
if err != nil {
return nil, errors.Wrapf(err, "error resolving tcp address '%v'", cfg.BindAddress)
}
zCfgPath, err := environment.ZitiIdentityFile(cfg.IdentityName)
zCfgPath, err := env_v0_3.ZitiIdentityFile(cfg.IdentityName)
if err != nil {
return nil, errors.Wrapf(err, "error getting ziti identity '%v' from environment", cfg.IdentityName)
}

View File

@ -3,7 +3,7 @@ package udpTunnel
import (
"github.com/openziti/sdk-golang/ziti"
"github.com/openziti/zrok/endpoints"
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/model"
"github.com/pkg/errors"
"github.com/sirupsen/logrus"
@ -99,7 +99,7 @@ func NewFrontend(cfg *FrontendConfig) (*Frontend, error) {
if err != nil {
return nil, errors.Wrapf(err, "error resolving udp address '%v'", cfg.BindAddress)
}
zCfgPath, err := environment.ZitiIdentityFile(cfg.IdentityName)
zCfgPath, err := env_v0_3.ZitiIdentityFile(cfg.IdentityName)
if err != nil {
return nil, errors.Wrapf(err, "error getting ziti identity '%v' from environment", cfg.IdentityName)
}

View File

@ -1,4 +1,4 @@
package environment
package env_v0_3
import (
"github.com/go-openapi/runtime"

View File

@ -1,4 +1,4 @@
package environment
package env_v0_3
import (
"encoding/json"

View File

@ -1,4 +1,4 @@
package environment
package env_v0_3
import (
"encoding/json"

View File

@ -1,4 +1,4 @@
package environment
package env_v0_3
import (
"github.com/pkg/errors"

View File

@ -1,4 +1,4 @@
package environment
package env_v0_3
import (
"fmt"

View File

@ -1,4 +1,4 @@
package environment
package env_v0_3
import (
"encoding/json"

View File

@ -1,7 +1,7 @@
package sdk
import (
"github.com/openziti/zrok/environment"
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/rest_model_zrok"
"github.com/pkg/errors"
)
@ -29,14 +29,14 @@ func newPublicShare(request *ShareRequest) (*Share, error) {
return nil, nil
}
func loadEnvironment(request *ShareRequest) (*environment.Root, error) {
env, err := environment.Load()
func loadEnvironment(request *ShareRequest) (*env_v0_3.Root, error) {
env, err := env_v0_3.Load()
if err != nil {
return nil, errors.Wrap(err, "error loading environment")
}
return env, nil
}
func createShare(zrd *environment.Root, req *rest_model_zrok.ShareRequest) (*Share, error) {
func createShare(zrd *env_v0_3.Root, req *rest_model_zrok.ShareRequest) (*Share, error) {
return nil, nil
}