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

codexshared

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2026 License: GPL-3.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dial

func Dial(ctx context.Context, path string) (*websocket.Conn, error)

func Proxy

func Proxy(ctx context.Context, down, up *websocket.Conn, prepare func(*Message) (func(*Message), error), observe func(Message))

func SocketDir

func SocketDir(dataDir string) string

func UserAgentVersion

func UserAgentVersion(userAgent string) string

Types

type Client

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

func Connect

func Connect(ctx context.Context, path string, info ClientInfo, observe func(Message)) (*Client, error)

func (*Client) Call

func (c *Client) Call(ctx context.Context, method string, params any) (json.RawMessage, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Connected

func (c *Client) Connected() bool

func (*Client) Done

func (c *Client) Done() <-chan struct{}

func (*Client) Respond

func (c *Client) Respond(ctx context.Context, id json.RawMessage, result any) error

func (*Client) ServerVersion

func (c *Client) ServerVersion() string

type ClientInfo

type ClientInfo struct {
	Name    string `json:"name"`
	Version string `json:"version"`
}

type Message

type Message struct {
	ID     json.RawMessage `json:"id,omitempty"`
	Method string          `json:"method,omitempty"`
	Params json.RawMessage `json:"params,omitempty"`
	Result json.RawMessage `json:"result,omitempty"`
	Error  json.RawMessage `json:"error,omitempty"`
}

type RPCError

type RPCError struct {
	Method string
	Reply  json.RawMessage
}

func (*RPCError) Error

func (e *RPCError) Error() string

Jump to

Keyboard shortcuts

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