Help us shape the future of Go! Take the 2026 Go Developer Survey

control

package
v0.1.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package control coordinates graceful shutdown between servef processes.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDirectory

func DefaultDirectory() (string, error)

DefaultDirectory returns the per-user directory for control records.

Types

type Instance

type Instance struct {
	// contains filtered or unexported fields
}

Instance is a registered servef process.

func (*Instance) Close

func (i *Instance) Close() error

Close removes this instance's control record.

func (*Instance) Handler

func (i *Instance) Handler(next http.Handler) http.Handler

Handler wraps next with authenticated status and shutdown handling.

func (*Instance) StopRequested

func (i *Instance) StopRequested() <-chan struct{}

StopRequested reports authenticated shutdown requests.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry stores private control records for running servef processes.

func NewRegistry

func NewRegistry(directory string) Registry

NewRegistry constructs a registry rooted at directory.

func (Registry) Lookup

func (r Registry) Lookup(host string, port int) (Remote, error)

Lookup returns the registered process for host and port.

func (Registry) Register

func (r Registry) Register(host string, port int) (*Instance, error)

Register creates a private control record for a running server.

type Remote

type Remote struct {
	// contains filtered or unexported fields
}

Remote is a registered servef process controlled over HTTP.

func (Remote) Running

func (r Remote) Running(ctx context.Context) bool

Running reports whether the registered process responds as servef.

func (Remote) Stop

func (r Remote) Stop(ctx context.Context) error

Stop asks the registered process to shut down gracefully.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL