Skip to content

Commit

Permalink
updated high-level environment framework (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelquigley committed Jul 12, 2023
1 parent 8756443 commit 3dd90fd
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 22 deletions.
47 changes: 25 additions & 22 deletions environment/api.go
Original file line number Diff line number Diff line change
@@ -1,36 +1,39 @@
package environment

import (
"github.com/openziti/zrok/environment/env_v0_3"
"github.com/openziti/zrok/environment/env_core"
"github.com/openziti/zrok/rest_client_zrok"
)

type Root interface {
}

func Load() (Root, error) {
Metadata() *env_core.Metadata
IsLatest() bool
HasConfig() (bool, error)
Config() *env_core.Config
SetConfig(cfg *env_core.Config) error
Client() (*rest_client_zrok.Zrok, error)
ApiEndpoint() (string, string)
Environment() *env_core.Environment
DeleteEnvironment() error
IsEnabled() (bool, error)
ZitiIdentityFile(name string) (string, error)
SaveZitiIdentity(name, data string) error
DeleteZitiIdentity(name string) error
Obliterate() error
}

func ListRoots() ([]*env_core.Metadata, error) {
return nil, nil
}

func IsEnabled() (bool, error) {
return env_v0_3.IsEnabled()
}

func DeleteEnvironment() error {
return env_v0_3.DeleteEnvironment()
}

func HasConfig() (bool, error) {
return env_v0_3.HasConfig()
}

func ZitiIdentityFile(name string) (string, error) {
return env_v0_3.ZitiIdentityFile(name)
func LoadRoot() (Root, error) {
return nil, nil
}

func SaveZitiIdentity(name, data string) error {
return env_v0_3.SaveZitiIdentity(name, data)
func LoadRootVersion(m *env_core.Metadata) (Root, error) {
return nil, nil
}

func DeleteZitiIdentity(name string) error {
return env_v0_3.DeleteZitiIdentity(name)
func UpdateRoot(r Root) (Root, error) {
return nil, nil
}
5 changes: 5 additions & 0 deletions environment/env_core/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ type Environment struct {
type Config struct {
ApiEndpoint string
}

type Metadata struct {
V string
RootPath string
}

0 comments on commit 3dd90fd

Please sign in to comment.