2023-07-11 21:47:13 +02:00
|
|
|
package env_core
|
|
|
|
|
2023-07-14 20:30:35 +02:00
|
|
|
import "github.com/openziti/zrok/rest_client_zrok"
|
|
|
|
|
|
|
|
// Root is the primary interface encapsulating the on-disk environment data.
|
|
|
|
type Root interface {
|
|
|
|
Metadata() *Metadata
|
|
|
|
Obliterate() error
|
|
|
|
|
|
|
|
HasConfig() (bool, error)
|
|
|
|
Config() *Config
|
|
|
|
SetConfig(cfg *Config) error
|
|
|
|
|
|
|
|
Client() (*rest_client_zrok.Zrok, error)
|
|
|
|
ApiEndpoint() (string, string)
|
|
|
|
|
|
|
|
IsEnabled() bool
|
|
|
|
Environment() *Environment
|
|
|
|
SetEnvironment(env *Environment) error
|
|
|
|
DeleteEnvironment() error
|
|
|
|
|
2023-07-17 19:51:51 +02:00
|
|
|
PublicIdentityName() string
|
|
|
|
EnvironmentIdentityName() string
|
2023-07-14 20:30:35 +02:00
|
|
|
|
|
|
|
ZitiIdentityNamed(name string) (string, error)
|
|
|
|
SaveZitiIdentityNamed(name, data string) error
|
|
|
|
DeleteZitiIdentityNamed(name string) error
|
|
|
|
}
|
|
|
|
|
2023-07-11 21:47:13 +02:00
|
|
|
type Environment struct {
|
|
|
|
Token string
|
|
|
|
ZitiIdentity string
|
|
|
|
ApiEndpoint string
|
|
|
|
}
|
|
|
|
|
|
|
|
type Config struct {
|
|
|
|
ApiEndpoint string
|
|
|
|
}
|
2023-07-12 22:18:13 +02:00
|
|
|
|
|
|
|
type Metadata struct {
|
|
|
|
V string
|
|
|
|
RootPath string
|
|
|
|
}
|