Movatterモバイル変換


[0]ホーム

URL:


agentsocket

package
v2.29.1Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License:AGPL-3.0Imports:16Imported by:0

Details

Repository

github.com/coder/coder

Links

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrUnitManagerNotAvailable =xerrors.New("unit manager not available")

Functions

This section is empty.

Types

typeClient

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

Client provides a client for communicating with the workspace agentsocket API.

funcNewClient

func NewClient(ctxcontext.Context, opts ...Option) (*Client,error)

NewClient creates a new socket client and opens a connection to the socket.If path is not provided via WithPath or is empty, it will auto-discover thedefault socket path.

func (*Client)Close

func (c *Client) Close()error

Close closes the socket connection.

func (*Client)Ping

func (c *Client) Ping(ctxcontext.Context)error

Ping sends a ping request to the agent.

func (*Client)SyncComplete

func (c *Client) SyncComplete(ctxcontext.Context, unitNameunit.ID)error

SyncComplete marks a unit as complete in the dependency graph.

func (*Client)SyncReady

func (c *Client) SyncReady(ctxcontext.Context, unitNameunit.ID) (bool,error)

SyncReady requests whether a unit is ready to be started. That is, all dependencies are satisfied.

func (*Client)SyncStart

func (c *Client) SyncStart(ctxcontext.Context, unitNameunit.ID)error

SyncStart starts a unit in the dependency graph.

func (*Client)SyncStatus

func (c *Client) SyncStatus(ctxcontext.Context, unitNameunit.ID) (SyncStatusResponse,error)

SyncStatus gets the status of a unit and its dependencies.

func (*Client)SyncWant

func (c *Client) SyncWant(ctxcontext.Context, unitName, dependsOnunit.ID)error

SyncWant declares a dependency between units.

typeDRPCAgentSocketService

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

DRPCAgentSocketService implements the DRPC agent socket service.

func (*DRPCAgentSocketService)Ping

Ping responds to a ping request to check if the service is alive.

func (*DRPCAgentSocketService)SyncComplete

SyncComplete marks a unit as complete in the dependency graph.

func (*DRPCAgentSocketService)SyncReady

SyncReady checks whether a unit is ready to be started. That is, all dependencies are satisfied.

func (*DRPCAgentSocketService)SyncStart

SyncStart starts a unit in the dependency graph.

func (*DRPCAgentSocketService)SyncStatus

SyncStatus gets the status of a unit and lists its dependencies.

func (*DRPCAgentSocketService)SyncWant

SyncWant declares a dependency between units.

typeDependencyInfo

type DependencyInfo struct {DependsOnunit.ID     `table:"depends on,default_sort" json:"depends_on"`RequiredStatusunit.Status `table:"required status" json:"required_status"`CurrentStatusunit.Status `table:"current status" json:"current_status"`IsSatisfiedbool        `table:"satisfied" json:"is_satisfied"`}

DependencyInfo contains information about a unit dependency.

typeOption

type Option func(*options)

Option represents a configuration option for NewClient.

funcWithPath

func WithPath(pathstring)Option

WithPath sets the socket path. If not provided or empty, the client willauto-discover the default socket path.

typeServer

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

Server provides access to the DRPCAgentSocketService via a Unix domain socket.Do not invoke Server{} directly. Use NewServer() instead.

funcNewServer

func NewServer(loggerslog.Logger, opts ...Option) (*Server,error)

NewServer creates a new agent socket server.

func (*Server)Close

func (s *Server) Close()error

Close stops the server and cleans up resources.

typeSyncStatusResponse

type SyncStatusResponse struct {UnitNameunit.ID          `table:"unit,default_sort" json:"unit_name"`Statusunit.Status      `table:"status" json:"status"`IsReadybool             `table:"ready" json:"is_ready"`Dependencies []DependencyInfo `table:"dependencies" json:"dependencies"`}

SyncStatusResponse contains the status information for a unit.

Source Files

View all Source files

Directories

PathSynopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp