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 ¶
- func IsDaemonNotRunning(err error) bool
- type Client
- func (c *Client) Close()
- func (c *Client) Connect(ctx context.Context, peerID, multiaddr string) (*apiv1.ConnectResponse, error)
- func (c *Client) ConnectListedPeer(ctx context.Context, peerID string, addrs []string) (*apiv1.ConnectListedPeerResponse, error)
- func (c *Client) DhtAddPeer(ctx context.Context, multiaddr string) (*apiv1.DhtAddPeerResponse, error)
- func (c *Client) DhtFindPeer(ctx context.Context, peerID string) (*apiv1.DhtFindPeerResponse, error)
- func (c *Client) DhtStatus(ctx context.Context) (*apiv1.DhtStatusResponse, error)
- func (c *Client) DisconnectPeer(ctx context.Context, peerID string) (*apiv1.DisconnectPeerResponse, error)
- func (c *Client) DownloadPeerFile(ctx context.Context, peerID, path string) (*connect.ServerStreamForClient[apiv1.DownloadPeerFileResponse], error)
- func (c *Client) DownloadPeerFileWithEvidence(ctx context.Context, peerID, path, source string) (*connect.ServerStreamForClient[apiv1.DownloadPeerFileResponse], error)
- func (c *Client) Events(ctx context.Context) (*connect.ServerStreamForClient[apiv1.EventsResponse], error)
- func (c *Client) GetPeerFriends(ctx context.Context, peerID string) (*apiv1.GetPeerFriendsResponse, error)
- func (c *Client) GetPeerManifest(ctx context.Context, peerID string, offset, limit int32) (*apiv1.GetPeerManifestResponse, error)
- func (c *Client) GetPeerProfile(ctx context.Context, peerID string) (*apiv1.GetPeerProfileResponse, error)
- func (c *Client) ListConversations(ctx context.Context, before string, limit uint32) (*apiv1.ListConversationsResponse, error)
- func (c *Client) ListDiscoveries(ctx context.Context, before string, limit int32, familiarOnly bool) (*apiv1.ListDiscoveriesResponse, error)
- func (c *Client) ListFriends(ctx context.Context) (*apiv1.ListFriendsResponse, error)
- func (c *Client) ListHumanOutboundPeers(ctx context.Context, before string, limit uint32) (*apiv1.ListHumanOutboundPeersResponse, error)
- func (c *Client) ListMessages(ctx context.Context, peerID, before string, limit uint32) (*apiv1.ListMessagesResponse, error)
- func (c *Client) OutboxCancel(ctx context.Context, messageID string) (*apiv1.OutboxCancelResponse, error)
- func (c *Client) OutboxList(ctx context.Context, limit uint32) (*apiv1.OutboxListResponse, error)
- func (c *Client) Peers(ctx context.Context, includeCached bool) (*apiv1.PeersResponse, error)
- func (c *Client) Published(ctx context.Context) (*apiv1.PublishedResponse, error)
- func (c *Client) RecentMessages(ctx context.Context, limit uint32) (*apiv1.RecentMessagesResponse, error)
- func (c *Client) RelayStatus(ctx context.Context) (*apiv1.RelayStatusResponse, error)
- func (c *Client) RemoveFriend(ctx context.Context, peerID string, cancelPending bool) (*apiv1.RemoveFriendResponse, error)
- func (c *Client) SendChat(ctx context.Context, peerID, multiaddr, text string) (*apiv1.SendChatResponse, error)
- func (c *Client) SendChatFromAgent(ctx context.Context, peerID, multiaddr, text string) (*apiv1.SendChatResponse, error)
- func (c *Client) SetFriendDescription(ctx context.Context, peerID, description string) (*apiv1.SetFriendDescriptionResponse, error)
- func (c *Client) SetFriendName(ctx context.Context, peerID, name string) (*apiv1.SetFriendNameResponse, error)
- func (c *Client) Shutdown(ctx context.Context) (*apiv1.ShutdownResponse, error)
- func (c *Client) Status(ctx context.Context) (*apiv1.StatusResponse, error)
- func (c *Client) SyncFriends(ctx context.Context) (*apiv1.SyncFriendsResponse, error)
- func (c *Client) TestDisconnectPeer(ctx context.Context, peerID string) (*apiv1.TestDisconnectPeerResponse, error)
- func (c *Client) TestPing(ctx context.Context, echo string) (*apiv1.TestPingResponse, error)
- type DaemonNotRunningError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsDaemonNotRunning ¶
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 ¶
New opens the explicitly selected local API transport. The protected TCP discovery file is authoritative when present; there is no automatic fallback to the Unix socket if it is stale or unreachable. When RAMINGA_API_TCP is set, a missing TCP endpoint is an error rather than a UDS fallback.
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 (*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) 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) DownloadPeerFileWithEvidence ¶
func (c *Client) DownloadPeerFileWithEvidence(ctx context.Context, peerID, path, source string) (*connect.ServerStreamForClient[apiv1.DownloadPeerFileResponse], error)
DownloadPeerFileWithEvidence is used only by the Agent content tool. It asks the daemon to persist the successful acquisition as discovery evidence.
func (*Client) Events ¶
func (c *Client) Events(ctx context.Context) (*connect.ServerStreamForClient[apiv1.EventsResponse], error)
Events opens the server-streaming Events call.
func (*Client) GetPeerFriends ¶
func (*Client) GetPeerManifest ¶
func (*Client) GetPeerProfile ¶
func (*Client) ListConversations ¶
func (c *Client) ListConversations(ctx context.Context, before string, limit uint32) (*apiv1.ListConversationsResponse, error)
ListConversations calls the per-Peer summary query.
func (*Client) ListDiscoveries ¶
func (c *Client) ListDiscoveries(ctx context.Context, before string, limit int32, familiarOnly bool) (*apiv1.ListDiscoveriesResponse, error)
ListDiscoveries reads the private acquisition index with its opaque cursor.
func (*Client) ListFriends ¶
ListFriends lists local friend rows.
func (*Client) ListHumanOutboundPeers ¶
func (c *Client) ListHumanOutboundPeers(ctx context.Context, before string, limit uint32) (*apiv1.ListHumanOutboundPeersResponse, error)
ListHumanOutboundPeers calls the durable stage-6 relation query.
func (*Client) ListMessages ¶
func (c *Client) ListMessages(ctx context.Context, peerID, before string, limit uint32) (*apiv1.ListMessagesResponse, error)
ListMessages calls the stable per-Peer message query.
func (*Client) OutboxCancel ¶
func (c *Client) OutboxCancel(ctx context.Context, messageID string) (*apiv1.OutboxCancelResponse, error)
OutboxCancel cancels one pending outbox entry.
func (*Client) OutboxList ¶
OutboxList lists durable unacknowledged outbound messages.
func (*Client) RecentMessages ¶
func (c *Client) RecentMessages(ctx context.Context, limit uint32) (*apiv1.RecentMessagesResponse, error)
RecentMessages calls RecentMessages.
func (*Client) RelayStatus ¶
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. The value is always sent explicitly, so an empty string is distinguishable from omission.
func (*Client) SetFriendName ¶
func (c *Client) SetFriendName(ctx context.Context, peerID, name string) (*apiv1.SetFriendNameResponse, error)
SetFriendName replaces one existing friend's local name. The value is always sent explicitly, so an empty string is distinguishable from an omitted edit.
func (*Client) SyncFriends ¶
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.
type DaemonNotRunningError ¶
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