client

package
v0.0.0-...-4cbcc9d Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: MIT Imports: 10 Imported by: ? 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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	HandleFunc          rpc.HandlerFunc
	SpawnOnMaxReconnect bool
	OnReconnect         func(int, error) bool
	OnSpawnDaemon       func()
	// contains filtered or unexported fields
}

func Connect

func Connect(addr string, clientType types.ClientType, handlerFunc ...rpc.HandlerFunc) *Client

func NewClient

func NewClient(ctx context.Context, addr string, clientType types.ClientType, handlerFunc ...rpc.HandlerFunc) *Client

func (*Client) Call

func (c *Client) Call(method types.Method, params any, result any) error

func (*Client) Close

func (c *Client) Close() error

func (*Client) Collect

func (c *Client) Collect(errCode int, command, workingDir, errMsg string) (*types.CollectResponse, error)

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) DeleteDocument

func (c *Client) DeleteDocument(filepath string) error

func (*Client) GenerateParticipantId

func (c *Client) GenerateParticipantId() (string, error)

func (*Client) GetDataDirPath

func (c *Client) GetDataDirPath() (string, error)

func (*Client) Handle

func (c *Client) Handle(ctx context.Context, conn *jsonrpc2.Conn, r *jsonrpc2.Request)

func (*Client) Handshake

func (c *Client) Handshake() (*types.ServerInfo, error)

func (*Client) IsConnected

func (c *Client) IsConnected() bool

func (*Client) Notify

func (c *Client) Notify(method types.Method, params any) error

func (*Client) ResetLogger

func (c *Client) ResetLogger() error

func (*Client) ResolveDocument

func (c *Client) ResolveDocument(filepath string, content string) error

func (*Client) RetrieveDocument

func (c *Client) RetrieveDocument(filepath string) (string, error)

func (*Client) RetrieveParticipantId

func (c *Client) RetrieveParticipantId() (string, error)

func (*Client) SetConn

func (c *Client) SetConn(conn net.Conn)

func (*Client) SetDataDirPath

func (c *Client) SetDataDirPath(newPath string) error

func (*Client) SetId

func (c *Client) SetId(id int)

func (*Client) Shutdown

func (c *Client) Shutdown() error

func (*Client) SupportedFileExts

func (c *Client) SupportedFileExts() []string

func (*Client) UpdateDocument

func (c *Client) UpdateDocument(filepath string, content string) error

type ConnectionState

type ConnectionState int
const (
	NotConnectedState ConnectionState = 0
	ShutdownState     ConnectionState = iota
	ConnectedState    ConnectionState = iota
	InitializedState  ConnectionState = iota
)

type MaxConnRetriesReachedError

type MaxConnRetriesReachedError struct {
	Err error
}

func (*MaxConnRetriesReachedError) Error

Jump to

Keyboard shortcuts

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