client

package
v0.1.0-rc.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 12 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 client is a Connect-RPC client for the local Raminga API. It is used by the CLI and e2e runner; it never opens go-libp2p directly.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsDaemonNotRunning

func IsDaemonNotRunning(err error) bool

IsDaemonNotRunning reports whether err is the actionable local-daemon error.

Types

type Client

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

Client talks to one local daemon over its UDS.

func New

func New(dataDir string) (*Client, error)

New reads the 0600 token in dataDir and builds a UDS-only client.

func (*Client) Close

func (c *Client) Close()

Close closes idle UDS connections.

func (*Client) Connect

func (c *Client) Connect(ctx context.Context, peerID, multiaddr string) (*apiv1.ConnectResponse, error)

Connect calls Connect. At least one of peerID and multiaddr must be set.

func (*Client) ConnectListedPeer

func (c *Client) ConnectListedPeer(ctx context.Context, peerID string, addrs []string) (*apiv1.ConnectListedPeerResponse, error)

func (*Client) DhtAddPeer

func (c *Client) DhtAddPeer(ctx context.Context, multiaddr string) (*apiv1.DhtAddPeerResponse, error)

DhtAddPeer calls DhtAddPeer.

func (*Client) DhtFindPeer

func (c *Client) DhtFindPeer(ctx context.Context, peerID string) (*apiv1.DhtFindPeerResponse, error)

DhtFindPeer calls DhtFindPeer.

func (*Client) DhtStatus

func (c *Client) DhtStatus(ctx context.Context) (*apiv1.DhtStatusResponse, error)

DhtStatus calls DhtStatus.

func (*Client) DisconnectPeer

func (c *Client) DisconnectPeer(ctx context.Context, peerID string) (*apiv1.DisconnectPeerResponse, error)

DisconnectPeer closes all connections to a peer through the normal API.

func (*Client) DownloadPeerFile

func (c *Client) DownloadPeerFile(ctx context.Context, peerID, path string) (*connect.ServerStreamForClient[apiv1.DownloadPeerFileResponse], error)

func (*Client) Events

Events opens the server-streaming Events call.

func (*Client) GetPeerFriends

func (c *Client) GetPeerFriends(ctx context.Context, peerID string) (*apiv1.GetPeerFriendsResponse, error)

func (*Client) GetPeerManifest

func (c *Client) GetPeerManifest(ctx context.Context, peerID string, offset, limit int32) (*apiv1.GetPeerManifestResponse, error)

func (*Client) GetPeerProfile

func (c *Client) GetPeerProfile(ctx context.Context, peerID string) (*apiv1.GetPeerProfileResponse, error)

func (*Client) ListFriends

func (c *Client) ListFriends(ctx context.Context) (*apiv1.ListFriendsResponse, error)

ListFriends lists local friend rows.

func (*Client) OutboxCancel

func (c *Client) OutboxCancel(ctx context.Context, messageID string) (*apiv1.OutboxCancelResponse, error)

OutboxCancel cancels one pending outbox entry.

func (*Client) OutboxList

func (c *Client) OutboxList(ctx context.Context, limit uint32) (*apiv1.OutboxListResponse, error)

OutboxList lists durable unacknowledged outbound messages.

func (*Client) Peers

func (c *Client) Peers(ctx context.Context, includeCached bool) (*apiv1.PeersResponse, error)

Peers calls Peers.

func (*Client) Published

func (c *Client) Published(ctx context.Context) (*apiv1.PublishedResponse, error)

Published lists the local public manifest after a forced scan.

func (*Client) RecentMessages

func (c *Client) RecentMessages(ctx context.Context, limit uint32) (*apiv1.RecentMessagesResponse, error)

RecentMessages calls RecentMessages.

func (*Client) RelayStatus

func (c *Client) RelayStatus(ctx context.Context) (*apiv1.RelayStatusResponse, error)

RelayStatus calls RelayStatus.

func (*Client) RemoveFriend

func (c *Client) RemoveFriend(ctx context.Context, peerID string, cancelPending bool) (*apiv1.RemoveFriendResponse, error)

RemoveFriend deletes a friend row; pending outbox requires cancelPending.

func (*Client) SendChat

func (c *Client) SendChat(ctx context.Context, peerID, multiaddr, text string) (*apiv1.SendChatResponse, error)

SendChat calls SendChat for a human-initiated TUI/CLI send. It deliberately leaves agent_origin unset, so daemon-side agent safety checks do not apply.

func (*Client) SendChatFromAgent

func (c *Client) SendChatFromAgent(ctx context.Context, peerID, multiaddr, text string) (*apiv1.SendChatResponse, error)

SendChatFromAgent calls SendChat with agent_origin set. Every Agent shell must use this method (or set the field directly), so the daemon can reject private-data leaks and excessive automated sends.

func (*Client) SetFriendDescription

func (c *Client) SetFriendDescription(ctx context.Context, peerID, description string) (*apiv1.SetFriendDescriptionResponse, error)

SetFriendDescription replaces one existing friend's description.

func (*Client) SetFriendName

func (c *Client) SetFriendName(ctx context.Context, peerID, name string) (*apiv1.SetFriendNameResponse, error)

SetFriendName replaces one existing friend's local name.

func (*Client) Shutdown

func (c *Client) Shutdown(ctx context.Context) (*apiv1.ShutdownResponse, error)

Shutdown asks the daemon to stop gracefully.

func (*Client) Status

func (c *Client) Status(ctx context.Context) (*apiv1.StatusResponse, error)

Status calls Status.

func (*Client) SyncFriends

func (c *Client) SyncFriends(ctx context.Context) (*apiv1.SyncFriendsResponse, error)

SyncFriends regenerates public/friends.json immediately.

func (*Client) TestDisconnectPeer

func (c *Client) TestDisconnectPeer(ctx context.Context, peerID string) (*apiv1.TestDisconnectPeerResponse, error)

TestDisconnectPeer calls the test-only disconnect RPC.

func (*Client) TestPing

func (c *Client) TestPing(ctx context.Context, echo string) (*apiv1.TestPingResponse, error)

TestPing calls the test-only TestPing RPC.

type DaemonNotRunningError

type DaemonNotRunningError struct {
	DataDir string
	Err     error
}

DaemonNotRunningError adds the actionable "start the daemon" hint while preserving the original dial/token error through Unwrap.

func (*DaemonNotRunningError) Error

func (e *DaemonNotRunningError) Error() string

func (*DaemonNotRunningError) Unwrap

func (e *DaemonNotRunningError) Unwrap() error

Jump to

Keyboard shortcuts

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