mirror of
https://github.com/openziti/zrok.git
synced 2024-12-22 23:02:52 +01:00
updated high-level environment framework (#369)
This commit is contained in:
parent
875644398f
commit
3dd90fd15d
@ -1,36 +1,39 @@
|
|||||||
package environment
|
package environment
|
||||||
|
|
||||||
import (
|
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 {
|
type Root interface {
|
||||||
|
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 Load() (Root, error) {
|
func ListRoots() ([]*env_core.Metadata, error) {
|
||||||
return nil, nil
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func IsEnabled() (bool, error) {
|
func LoadRoot() (Root, error) {
|
||||||
return env_v0_3.IsEnabled()
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func DeleteEnvironment() error {
|
func LoadRootVersion(m *env_core.Metadata) (Root, error) {
|
||||||
return env_v0_3.DeleteEnvironment()
|
return nil, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func HasConfig() (bool, error) {
|
func UpdateRoot(r Root) (Root, error) {
|
||||||
return env_v0_3.HasConfig()
|
return nil, nil
|
||||||
}
|
|
||||||
|
|
||||||
func ZitiIdentityFile(name string) (string, error) {
|
|
||||||
return env_v0_3.ZitiIdentityFile(name)
|
|
||||||
}
|
|
||||||
|
|
||||||
func SaveZitiIdentity(name, data string) error {
|
|
||||||
return env_v0_3.SaveZitiIdentity(name, data)
|
|
||||||
}
|
|
||||||
|
|
||||||
func DeleteZitiIdentity(name string) error {
|
|
||||||
return env_v0_3.DeleteZitiIdentity(name)
|
|
||||||
}
|
}
|
||||||
|
@ -9,3 +9,8 @@ type Environment struct {
|
|||||||
type Config struct {
|
type Config struct {
|
||||||
ApiEndpoint string
|
ApiEndpoint string
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Metadata struct {
|
||||||
|
V string
|
||||||
|
RootPath string
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user