controlapi

package
v0.2.3 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Overview

Package controlapi implements the private, authenticated CLI-to-local-server API.

Index

Constants

View Source
const ProtocolVersion = 5

Variables

This section is empty.

Functions

func New

func New(token string, status func() (Status, error), shutdown func()) http.Handler

Types

type Client

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

func NewClient

func NewClient(endpoint, token string) *Client

func (*Client) Shutdown

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

func (*Client) Status

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

type Problem

type Problem struct {
	Type   string `json:"type"`
	Title  string `json:"title"`
	Status int    `json:"status"`
	Code   string `json:"code,omitempty"`
	Detail string `json:"detail"`
}

Problem is a local server rejection, distinct from an interrupted transport.

func (*Problem) Error

func (problem *Problem) Error() string

type Settings

type Settings = config.ServerSettings

type Status

type Status struct {
	State           string   `json:"state"`
	InstanceID      string   `json:"instanceId"`
	StateID         string   `json:"stateId"`
	PID             int      `json:"pid"`
	Version         string   `json:"version"`
	ProtocolVersion int      `json:"protocolVersion"`
	URL             string   `json:"url"`
	BrowserURL      string   `json:"browserUrl"`
	Settings        Settings `json:"settings"`
	Observations    int      `json:"observations"`
}

Jump to

Keyboard shortcuts

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