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

localserver

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SelectedCheckout    = serverapp.SelectedCheckout
	DiscoveredCheckouts = serverapp.DiscoveredCheckouts
)

Variables

View Source
var ErrUnavailable = errors.New("service unavailable; ownership held but control endpoint is unreachable")

Functions

func DescriptorPath

func DescriptorPath(dir string) string

func LifecyclePath

func LifecyclePath(dir string) string

func LogPath

func LogPath(dir string) string

func OpenLog

func OpenLog(dir string) (io.WriteCloser, error)

func OwnershipPath

func OwnershipPath(dir string) string

func PublishDescriptor

func PublishDescriptor(dir string, d Descriptor) error

func RemoveDescriptor

func RemoveDescriptor(dir, instanceID string) error

func Run

func Run(ctx context.Context, settings Settings, runtimeDir string, initial *ingestion.Request, reset StateReset, ready func(Status, *contextservice.Publication)) error

func RunForeground

func RunForeground(ctx context.Context, settings Settings, input Input, confirm func(Status) (bool, error), reset StateReset, ready func(Status, Published)) error

RunForeground serializes discovery, replacement and publication. Shutdown uses the authenticated control endpoint, never an unverified operating-system PID.

func RuntimeDir

func RuntimeDir() (string, error)

Types

type Client

type Client struct {
	RuntimeDirectory string
}

func NewClient

func NewClient() (*Client, error)

func (*Client) Status

func (client *Client) Status(ctx context.Context) (Status, error)

func (*Client) Stop

func (client *Client) Stop(ctx context.Context) error

type Collect

type Collect = serverapp.Collect

Collection, CollectionFailure and Published describe local collections of the selected checkouts for command entry points.

type Collection

type Collection = serverapp.Collection

Collection, CollectionFailure and Published describe local collections of the selected checkouts for command entry points.

type CollectionFailure

type CollectionFailure = serverapp.CollectionFailure

Collection, CollectionFailure and Published describe local collections of the selected checkouts for command entry points.

type Descriptor

type Descriptor struct {
	Endpoint string `json:"endpoint"`
	Token    string `json:"token"`
	Status   Status `json:"status"`
}

func ReadDescriptor

func ReadDescriptor(dir string) (Descriptor, error)

type Input

type Input struct {
	Collection Collection
	Collect    Collect
	Selection  Selection
}

Input supplies a fixed capture or checkout collection to run in the background at startup and again on explicit user request. Selection names the scope Collect gathers.

type Published

type Published = serverapp.Published

Collection, CollectionFailure and Published describe local collections of the selected checkouts for command entry points.

type Selection added in v0.2.2

type Selection = serverapp.Selection

Collection, CollectionFailure and Published describe local collections of the selected checkouts for command entry points.

type Settings

type Settings = controlapi.Settings

type StateReset

type StateReset struct {
	// Force backs up current or older state before opening.
	Force bool
	// Confirm is asked when older diffx state would otherwise be refused.
	Confirm func(*reviewstore.StateError) (bool, error)
	// Saved reports the backup of replaced state.
	Saved func(backup string)
}

StateReset is an entry point's decision to replace local state. Remote composition has none, so its incompatible state is always refused.

type Status

type Status = controlapi.Status

Jump to

Keyboard shortcuts

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