devcontrol

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: AGPL-3.0 Imports: 18 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package devcontrol defines the native-independent development control client and typed adapter contract. The listener and dispatcher require devcontrol.

Index

Constants

This section is empty.

Variables

View Source
var ErrDisabled = errors.New("development control is not compiled into this binary")

Functions

This section is empty.

Types

type Adapters

type Adapters struct {
	Inspect  func(context.Context) (devcontract.InstanceDescriptor, error)
	Plugins  Plugins
	Dev      Dev
	Settings Settings
}

type Client

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

func NewClient

func NewClient(endpoint string, token []byte, workspaceID, generation string) (*Client, error)

func (*Client) Call

func (c *Client) Call(ctx context.Context, operation string, params any) (devcontract.Response, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Wait

func (c *Client) Wait(ctx context.Context, operationID string, timeout time.Duration) (devcontract.Response, error)

type Config

type Config struct {
	Descriptor devcontract.InstanceDescriptor
	Discovery  *devsession.DiscoveryStore
	Adapters   Adapters
}

type DependenciesParams

type DependenciesParams struct {
	ID         string `json:"id"`
	Generation string `json:"generation"`
	Enabled    bool   `json:"enabled"`
}

type Dev

type Dev interface {
	Start(context.Context, string) (DevState, error)
	Stop(context.Context, string) error
	Restart(context.Context, string) (DevState, error)
	Rebuild(context.Context, string, string) (DevState, error)
	SetDependencyWatching(context.Context, string, string, bool) error
	Status(string) (DevState, error)
	Logs(string, int, int, bool) (LogPage, error)
	WaitReady(context.Context, string, string) (DevState, error)
}

Dev owns actual lifecycle transitions; a successful Start/Rebuild waits for the generation's capability-aware readiness, not merely a spawned process.

type DevState

type DevState struct {
	devcontract.PluginState
	Ready   bool   `json:"ready"`
	ViteURL string `json:"viteURL,omitempty"`
	HMRURL  string `json:"hmrURL,omitempty"`
}

type EmptyParams

type EmptyParams struct{}

type LogEntry

type LogEntry struct {
	Timestamp string `json:"timestamp"`
	Source    string `json:"source"`
	Level     string `json:"level"`
	Message   string `json:"message"`
}

type LogPage

type LogPage struct {
	Entries    []LogEntry `json:"entries"`
	NextCursor int        `json:"nextCursor"`
	Truncated  bool       `json:"truncated"`
}

type LogsParams

type LogsParams struct {
	ID            string `json:"id"`
	Cursor        int    `json:"cursor"`
	Limit         int    `json:"limit"`
	IncludeOutput bool   `json:"includeOutput,omitempty"`
}

type OperationParams

type OperationParams struct {
	OperationID string `json:"operationID"`
	TimeoutMS   int    `json:"timeoutMS,omitempty"`
}

type PathParams

type PathParams struct {
	Path string `json:"path"`
}

type PluginParams

type PluginParams struct {
	ID string `json:"id"`
}

type Plugins

type Plugins interface {
	ListPlugins() []sdktypes.PluginInfo
	GetPlugin(string) (sdktypes.PluginInfo, error)
	InstallPluginFromPath(string) (*config.PluginMeta, error)
	InstallPluginVersion(string, string) (*config.PluginMeta, error)
	UninstallPlugin(string) (sdktypes.PluginInfo, error)
	InstallDevPluginFromPath(string) (sdktypes.PluginInfo, error)
	UnlinkDevPlugin(string) (sdktypes.PluginInfo, error)
}

Plugins is the canonical noninteractive manager subset. No dialog APIs.

type RebuildParams

type RebuildParams struct {
	ID         string `json:"id"`
	Generation string `json:"generation"`
}

type Server

type Server struct{}

Server is inert in ordinary/release builds. No listener, dispatcher, auth implementation or host adapter is linked without the explicit devcontrol tag.

func Start

func Start(context.Context, Config) (*Server, error)

func (*Server) Close

func (*Server) Close(context.Context) error

func (*Server) Endpoint

func (*Server) Endpoint() string

func (*Server) Refresh

type SettingsParams

type SettingsParams struct {
	Scope    string                     `json:"scope"`
	PluginID string                     `json:"pluginID,omitempty"`
	ID       string                     `json:"id,omitempty"`
	Value    json.RawMessage            `json:"value,omitempty"`
	Values   map[string]json.RawMessage `json:"values,omitempty"`
}

type VersionParams

type VersionParams struct {
	ID      string `json:"id"`
	Version string `json:"version"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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