Documentation
¶
Overview ¶
Package server owns locally managed znserver instances. It is shared by the command line and terminal app; neither frontend runs lifecycle shell snippets.
Index ¶
- type Instance
- type Manager
- func (m *Manager) BinaryPath(i Instance) string
- func (m *Manager) Configure(ctx context.Context, name string, changes map[string]string) (Instance, error)
- func (m *Manager) Dir(name string) string
- func (m *Manager) Install(ctx context.Context, opts Options) (Instance, error)
- func (m *Manager) List() ([]Instance, error)
- func (m *Manager) Load(name string) (Instance, error)
- func (m *Manager) LogPath(name string) string
- func (m *Manager) Logs(name string, output io.Writer) error
- func (m *Manager) Register(i Instance, makeDefault bool) error
- func (m *Manager) Rollback(ctx context.Context, name string) (Instance, error)
- func (m *Manager) Run(ctx context.Context, name string, output io.Writer) error
- func (m *Manager) Setup(ctx context.Context, opts Options) (Instance, error)
- func (m *Manager) Start(ctx context.Context, name string) error
- func (m *Manager) Status(ctx context.Context, name string) (Status, error)
- func (m *Manager) Stop(ctx context.Context, name string) error
- func (m *Manager) TokenPath(name string) string
- func (m *Manager) Update(ctx context.Context, name, version string) (Instance, error)
- type Options
- type ReleaseSource
- type Service
- type ServiceSpec
- type Status
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Instance ¶
type Instance struct {
Name string `json:"name"`
Vault string `json:"vault"`
Bind string `json:"bind"`
BasePath string `json:"basePath,omitempty"`
Version string `json:"version"`
SHA256 string `json:"sha256"`
PreviousVersion string `json:"previousVersion,omitempty"`
PreviousSHA256 string `json:"previousSha256,omitempty"`
}
type Manager ¶
type Manager struct {
Root string
Releases ReleaseSource
Service Service
Check func(context.Context, Instance) error
HealthTimeout time.Duration
}
func DefaultManager ¶
func DefaultManager() *Manager
func NewManager ¶
func (*Manager) BinaryPath ¶
func (*Manager) Configure ¶
func (m *Manager) Configure(ctx context.Context, name string, changes map[string]string) (Instance, error)
Configure changes runtime settings transactionally, retaining the same token.
func (*Manager) Install ¶
Install downloads a verified binary and creates private runtime configuration. Repeating the same installation preserves its version, credentials and vault.
func (*Manager) Register ¶
Register persists a terminal profile only after authenticated verification.
func (*Manager) Run ¶
Run is a foreground development runtime. Holding the instance lock prevents another command from replacing its executable or configuration while it runs.
type ReleaseSource ¶
type Service ¶
type Service interface {
Start(context.Context, ServiceSpec) error
Stop(context.Context, ServiceSpec) error
Active(context.Context, ServiceSpec) (bool, error)
}
Stop also disables the login service, so an intentionally stopped instance stays stopped after login or an update's temporary health check.