node

package
v0.1.0-rc.4 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2026 License: Apache-2.0 Imports: 42 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 node orchestrates identity, config, storage, network and protocol. It is the only package that composes the base modules; it never reimplements their policies.

Index

Constants

View Source
const (
	PublishStatusPublished        = publication.StatusPublished
	PublishStatusAlreadyPublished = publication.StatusAlreadyPublished
	PublishStatusConflict         = publication.StatusConflict
	PublishStatusInvalid          = publication.StatusInvalid
	PublishStatusPartial          = publication.StatusPartial
)
View Source
const (
	OriginHuman   = storage.OriginHuman
	OriginAgent   = storage.OriginAgent
	OriginUnknown = storage.OriginUnknown
)

Local send provenance values. They are an operator model, not strong auth.

View Source
const (
	DeliveryPending   = storage.DeliveryPending
	DeliveryAcked     = storage.DeliveryAcked
	DeliveryFailed    = storage.DeliveryFailed
	DeliveryCancelled = storage.DeliveryCancelled
	DeliveryUnknown   = storage.DeliveryUnknown
	DeliveryReceived  = storage.DeliveryReceived
)

Delivery states exposed by the local API.

Variables

View Source
var (
	ErrFriendNotFound      = storage.ErrFriendNotFound
	ErrFriendNameTaken     = storage.ErrFriendNameTaken
	ErrFriendPendingOutbox = storage.ErrFriendPendingOutbox
)

Friend sentinel errors are stable API-facing aliases for the storage errors.

View Source
var (
	ErrDraftConflict = storage.ErrDraftConflict
	ErrDraftNotFound = storage.ErrDraftNotFound
	ErrDraftInvalid  = publication.ErrDraftInvalid
)
View Source
var ErrContactNotFound = errors.New("contact was not found")
View Source
var ErrFavoriteTarget = errors.New("node: favorite target is not an available public post")

ErrFavoriteTarget reports a favorite target that is not a verified public post version or not an accepted post path.

View Source
var ErrInvalidCursor = storage.ErrInvalidCursor

ErrInvalidCursor reports a malformed message or conversation cursor.

View Source
var ErrMessageNotFound = storage.ErrMessageNotFound

ErrMessageNotFound reports a missing message inside the stated Peer's retained history.

View Source
var ErrOwnContactCard = errors.New("this is your own Raminga ID")

Functions

func NewPeerCache

func NewPeerCache(store *storage.Store) network.PeerCache

NewPeerCache adapts the SQLite store to the network package's small hint cache interface. It is not a second runtime address source.

Types

type AckEvent

type AckEvent struct {
	MessageID string
	PeerID    string
	Accepted  bool
	Error     string
}

AckEvent reports an ACK observed by this node.

type AutoNATStatus

type AutoNATStatus = network.AutoNATStatus

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type BootstrapPeer

type BootstrapPeer struct {
	PeerID  string
	Addrs   []string
	Online  bool
	Paused  bool
	SavedAt time.Time
}

BootstrapPeer is one saved bootstrap role. Online is a live connection fact, not a claim that the saved address is reachable; Paused is the persistent explicit-disconnect flag, which add/remove/restart never clear.

type CachedPeer

type CachedPeer = network.CachedPeer

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type ChatEvent

type ChatEvent struct {
	MessageID  string
	FromPeerID string
	FromNodeID string
	Text       string
	Duplicate  bool
	Accepted   bool
}

ChatEvent reports an inbound chat message.

type ConnectResult

type ConnectResult struct {
	PeerID             string
	Transport          string
	Route              string
	RelayPeerID        string
	Direct             bool
	Limited            bool
	RemoteMultiaddr    string
	Reused             bool
	RequestedTransport string
	TransportChanged   bool
	Source             string
	Attempts           []network.DialAttempt
	Note               string
}

ConnectResult is the outcome of an explicit dial or a peer-ID dial.

type ConnectionEvent

type ConnectionEvent struct {
	PeerID          string
	Direction       string
	Transport       string
	Route           string
	RelayPeerID     string
	RemoteMultiaddr string
	Kind            string // "connected" or "disconnected"
	Direct          bool
	Limited         bool
}

ConnectionEvent reports a connection change.

type Conversation

type Conversation struct {
	PeerID            string
	LastMessageID     string
	Direction         string
	Preview           string
	LastAt            time.Time
	DeliveryStatus    string
	Origin            string
	MessageCount      int
	UnreadCount       int
	LastReadMessageID string
	LastReadAt        time.Time
}

Conversation is one Peer's latest retained message.

type ConversationPage

type ConversationPage struct {
	Conversations []Conversation
	NextBefore    string
	HasMore       bool
	Retention     MessageRetention
	TotalUnread   int
}

ConversationPage is one keyset page of conversation summaries.

type DCUtRStatus

type DCUtRStatus = network.DCUtRStatus

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type DHTPeer

type DHTPeer = network.DHTPeer

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type DHTStatus

type DHTStatus = network.DHTStatus

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type DialAttempt

type DialAttempt = network.DialAttempt

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type DiscoveryRefreshPeer

type DiscoveryRefreshPeer struct {
	PeerID        string
	FromDiscovery bool
	FromOutbound  bool
}

DiscoveryRefreshPeer is one bounded local Feed refresh candidate.

type DiscoveryRefreshPeerPage

type DiscoveryRefreshPeerPage struct {
	Peers     []DiscoveryRefreshPeer
	Total     int
	Truncated bool
	HasMore   bool
	NextAfter string
}

DiscoveryRefreshPeerPage is one bounded local refresh candidate snapshot.

type DownloadOptions

type DownloadOptions struct {
	RecordDiscovery bool
	DiscoverySource string
}

DownloadOptions controls optional evidence recording for one download.

type DownloadProgress

type DownloadProgress struct {
	Phase    string
	Path     string
	Received int64
	Total    int64
	Direct   bool
}

type DownloadResult

type DownloadResult struct {
	PeerID    string
	Path      string
	LocalPath string
	Size      int64
	SHA256    string
	Resumed   bool
	Direct    bool
	// Discovery evidence is set only when the caller explicitly requested it.
	DiscoveryID       int64
	DiscoveryRecorded bool
	DiscoveryError    string
}

type DraftUpdate

type DraftUpdate = publication.DraftUpdate

Public draft views are aliases so the local API does not duplicate storage or publication schemas.

type Event

type Event struct {
	At         time.Time
	Chat       *ChatEvent
	Ack        *AckEvent
	Connection *ConnectionEvent
}

Event is one local-API notification.

type Favorite

type Favorite struct {
	ID        string
	PeerID    string
	Path      string
	SHA256    string
	Title     string
	CreatedAt time.Time
	Available bool
}

Favorite is one private public-post bookmark. There is deliberately no kind/message/contact field.

type FavoritePage

type FavoritePage struct {
	Favorites  []Favorite
	NextBefore string
	HasMore    bool
}

FavoritePage is one keyset page of favorites.

type Friend

type Friend struct {
	PeerID            string
	Name              string
	Addrs             []string
	Description       string
	ManuallyConnected bool
	RelayCapable      bool
	DHTCapable        bool
	Paused            bool
	FirstSeen         time.Time
	LastInteraction   time.Time
	UnreadCount       int
}

Friend is the node-facing friend view. Names/descriptions are local only.

type HumanOutboundPage

type HumanOutboundPage struct {
	Peers      []HumanOutboundPeer
	NextBefore string
	HasMore    bool
}

HumanOutboundPage is one keyset page of durable human-outbound relations.

type HumanOutboundPeer

type HumanOutboundPeer struct {
	PeerID  string
	FirstAt time.Time
	LastAt  time.Time
	// PagingRowID and PagingSnapshotID are opaque keyset positions for the
	// stable relation snapshot. They are not serialized as public relation data.
	PagingRowID      int64
	PagingSnapshotID int64
}

HumanOutboundPeer is one durable human-outbound relation.

type MarkReadResult

type MarkReadResult struct {
	PeerID            string
	LastReadMessageID string
	LastReadAt        time.Time
	UnreadCount       int
}

MarkReadResult is one monotonic human read-cursor update.

type MessagePage

type MessagePage struct {
	Messages   []StoredMessage
	NextBefore string
	HasMore    bool
	Retention  MessageRetention
}

MessagePage is one keyset page of retained messages, newest first.

type MessageRetention

type MessageRetention struct {
	RetainedMessages int
	OldestAt         time.Time
	MaxMessages      int
}

MessageRetention describes currently retained rows, not pruned history.

type NetworkStatus

type NetworkStatus struct {
	Reachability  string
	AutoNAT       network.AutoNATStatus
	DCUtR         network.DCUtRStatus
	Relays        []network.RelayReservation
	RelayProvider network.RelayProviderStatus
	DHT           network.DHTStatus
	Resources     network.ResourceStatus
	PeerCache     []network.CachedPeer
	UPNP          bool
	NATPMP        bool
	STUN          bool
}

NetworkStatus groups G2 diagnostics. Cached addresses are never online.

type Node

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

Node is the running node orchestration.

func New

func New(opts Options) (*Node, error)

New validates dependencies and constructs the node.

func (*Node) AddBootstrapCard

func (n *Node) AddBootstrapCard(ctx context.Context, code string) (BootstrapPeer, bool, error)

AddBootstrapCard saves the addresses together as a bootstrap setting. It does not import the card into the contacts list.

func (*Node) AddBootstrapPeer

func (n *Node) AddBootstrapPeer(ctx context.Context, multiaddr string) (BootstrapPeer, bool, error)

AddBootstrapPeer persists one validated bootstrap role and applies it to the live DHT. Persistence is the save receipt; the bootstrap dial continues in the background and never turns into a false "online" result.

func (*Node) AddPeer

func (n *Node) AddPeer(ctx context.Context, multiaddr string) (network.PeerEntry, error)

AddPeer performs a manual peer add via the local API.

func (*Node) BootstrapPeers

func (n *Node) BootstrapPeers(ctx context.Context) ([]BootstrapPeer, error)

BootstrapPeers returns saved bootstrap roles with separate live online and persistent paused flags. It never dials or treats cache presence as online.

func (*Node) CancelOutbox

func (n *Node) CancelOutbox(ctx context.Context, messageID string) error

CancelOutbox cancels one pending entry; terminal entries are rejected.

func (*Node) Connect

func (n *Node) Connect(ctx context.Context, peerID, multiaddr string) (ConnectResult, error)

Connect dials a peer by explicit multiaddr or, when only a Peer ID is given, through resolved PeerStore/cache/DHT candidates.

func (*Node) ConnectContactCard

func (n *Node) ConnectContactCard(ctx context.Context, code string) (ConnectResult, error)

func (*Node) ConnectListedPeer

func (n *Node) ConnectListedPeer(ctx context.Context, peerID string, addrs []string) (ConnectResult, error)

func (*Node) ContactCard

func (n *Node) ContactCard(ctx context.Context, rawPeerID string, includeAddresses bool) (contactcard.Card, bool, error)

func (*Node) ContactCardForScopes

func (n *Node) ContactCardForScopes(ctx context.Context, rawPeerID string, scopes contactcard.AddressScopes) (contactcard.Card, contactcard.AddressScopes, error)

func (*Node) DHTFindPeer

func (n *Node) DHTFindPeer(ctx context.Context, peerID string) (network.DHTPeer, error)

DHTFindPeer performs a real DHT lookup with a cache fallback source label.

func (*Node) DHTStatus

func (n *Node) DHTStatus() network.DHTStatus

DHTStatus returns DHT diagnostics.

func (*Node) DeletePublicDraft

func (n *Node) DeletePublicDraft(ctx context.Context, id string, expectedRevision int64) (bool, error)

DeletePublicDraft removes one private draft and its assets.

func (*Node) Disconnect

func (n *Node) Disconnect(ctx context.Context, peerID string) error

Disconnect closes all connections to a peer (test-only API).

func (*Node) Download

func (n *Node) Download(ctx context.Context, peerID, remotePath string, progress func(DownloadProgress)) (DownloadResult, error)

func (*Node) DownloadPeerFile

func (n *Node) DownloadPeerFile(ctx context.Context, peerID, path string, progress func(DownloadProgress), options DownloadOptions) (DownloadResult, error)

DownloadPeerFile is the API-facing variant used by Agent tools that may explicitly record acquisition evidence.

func (*Node) DownloadWithOptions

func (n *Node) DownloadWithOptions(ctx context.Context, peerID, remotePath string, progress func(DownloadProgress), options DownloadOptions) (DownloadResult, error)

DownloadWithOptions downloads one manifest file and optionally records the successful acquisition as private discovery evidence. Only Agent tool callers opt in; a manual TUI download, a directory scan or merely listing a manifest does not become a Feed recommendation.

func (*Node) FetchManifest

func (n *Node) FetchManifest(ctx context.Context, peerID string, offset, limit int) (PeerManifest, error)

func (*Node) Friends

func (n *Node) Friends(ctx context.Context) ([]Friend, error)

Friends lists local friend rows.

func (*Node) GetPeerFriends

func (n *Node) GetPeerFriends(ctx context.Context, peerID string) (PeerFriends, error)

func (*Node) GetPeerManifest

func (n *Node) GetPeerManifest(ctx context.Context, peerID string, offset, limit int) (PeerManifest, error)

API-facing aliases use explicit Get names.

func (*Node) GetPeerProfile

func (n *Node) GetPeerProfile(ctx context.Context, peerID string) (PeerProfile, error)

func (*Node) GetPublicDraft

func (n *Node) GetPublicDraft(ctx context.Context, id string) (PublicDraft, bool, error)

GetPublicDraft returns one private draft.

func (*Node) GetPublicDraftAsset

func (n *Node) GetPublicDraftAsset(ctx context.Context, draftID, assetID string) (PublicDraftAsset, bool, error)

GetPublicDraftAsset returns one private image/avatar descriptor.

func (*Node) ImportPublicPost

func (n *Node) ImportPublicPost(ctx context.Context, rel string) (PublicDraft, error)

ImportPublicPost opens an existing local post as a private edit draft.

func (*Node) ListConversations

func (n *Node) ListConversations(ctx context.Context, before string, limit int) (ConversationPage, error)

ListConversations returns one summary per Peer from retained messages.

func (*Node) ListDiscoveries

func (n *Node) ListDiscoveries(ctx context.Context, before string, limit int, familiarOnly bool, peerID string, postCandidatesOnly bool) (PublicDiscoveryPage, error)

ListDiscoveries returns the private discovery index page. It is served only on the local API; the remote content protocol does not expose it.

func (*Node) ListDiscoveryRefreshPeers

func (n *Node) ListDiscoveryRefreshPeers(ctx context.Context, familiarOnly bool, limit int, after string) (DiscoveryRefreshPeerPage, error)

ListDiscoveryRefreshPeers returns the bounded local candidate set for an explicit Feed refresh. It reads only local SQLite facts and performs no network request.

func (*Node) ListFavorites

func (n *Node) ListFavorites(ctx context.Context, before string, limit int) (FavoritePage, error)

ListFavorites returns private public-post bookmarks and computes availability from retained discovery evidence, the local public snapshot or a verified downloaded copy. A missing target keeps the row with available=false.

func (*Node) ListFriends

func (n *Node) ListFriends(ctx context.Context) ([]Friend, error)

ListFriends is the API-facing alias for Friends.

func (*Node) ListHumanOutboundPeers

func (n *Node) ListHumanOutboundPeers(ctx context.Context, before string, limit int) (HumanOutboundPage, error)

ListHumanOutboundPeers returns the durable stage-6 relation page.

func (*Node) ListMessages

func (n *Node) ListMessages(ctx context.Context, peerID, before string, limit int) (MessagePage, error)

ListMessages returns one Peer's retained messages with a stable cursor.

func (*Node) ListOutbox

func (n *Node) ListOutbox(ctx context.Context, limit int) ([]OutboxEntry, error)

ListOutbox returns durable outbox entries newest first.

func (*Node) ListPublicDrafts

func (n *Node) ListPublicDrafts(ctx context.Context, kind, before string, limit int) ([]PublicDraft, bool, string, error)

ListPublicDrafts returns a newest-first page of private drafts.

func (*Node) MarkConversationRead

func (n *Node) MarkConversationRead(ctx context.Context, peerID, throughMessageID string) (MarkReadResult, error)

MarkConversationRead advances the human cursor through one retained message. It is the only node path that writes read state; ListMessages and RecentMessages stay read-only.

func (*Node) Outbox

func (n *Node) Outbox(ctx context.Context, limit int) ([]OutboxEntry, OutboxStats, error)

Outbox returns the durable outbox page and accounting in one call for the local API.

func (*Node) OutboxStats

func (n *Node) OutboxStats(ctx context.Context) (OutboxStats, error)

OutboxStats returns bounded outbox accounting.

func (*Node) PausePeer

func (n *Node) PausePeer(ctx context.Context, peerID string) error

PausePeer persists a pause, stops local relay/auto-relay work and closes the current connection. It intentionally does not create a friend row.

func (*Node) Peers

func (n *Node) Peers(ctx context.Context) ([]PeerStatus, error)

Peers returns live connections plus cached hints (Online=false).

func (*Node) PreviewContactCard

func (n *Node) PreviewContactCard(ctx context.Context, code string) (contactcard.Card, string, error)

func (*Node) PublishPublicDraft

func (n *Node) PublishPublicDraft(ctx context.Context, id string, expectedRevision int64, expectedPublishedSHA, requestID string) (PublishResult, error)

PublishPublicDraft atomically commits one draft under the publication lock.

func (*Node) Published

func (n *Node) Published(ctx context.Context) (Published, error)

Published forces a fresh local scan and returns what is published, what was skipped and when friends.json was last written. It stays on the local API.

func (*Node) PutPublicDraftImage

func (n *Node) PutPublicDraftImage(ctx context.Context, draftID, role, filename string, data []byte) (PublicDraftAsset, error)

PutPublicDraftImage validates and stores an avatar/image privately.

func (*Node) RecentMessages

func (n *Node) RecentMessages(ctx context.Context, limit int) ([]StoredMessage, error)

RecentMessages returns persisted messages newest first.

func (*Node) RecoverPublication

func (n *Node) RecoverPublication(ctx context.Context) ([]string, error)

RecoverPublication runs startup staging cleanup and incomplete-version quarantine before the API serves manifests.

func (*Node) RelayProvider

func (n *Node) RelayProvider() network.RelayProviderStatus

RelayProvider returns the optional relay provider quotas.

func (*Node) RelayReservations

func (n *Node) RelayReservations() []network.RelayReservation

RelayReservations returns real Relay v2 client reservation states.

func (*Node) RemoveBootstrapPeer

func (n *Node) RemoveBootstrapPeer(ctx context.Context, peerID string) (bool, error)

RemoveBootstrapPeer removes only the role; history, addresses, contacts, other roles and the pause record are untouched. A missing role is an idempotent no-op.

func (*Node) RemoveFriend

func (n *Node) RemoveFriend(ctx context.Context, peerID string, cancelPending bool) (bool, int, error)

RemoveFriend deletes a friend row; pending outbox requires explicit cancel.

func (*Node) ResumePeer

func (n *Node) ResumePeer(ctx context.Context, pid peer.ID) error

ResumePeer clears a pause (explicit connect/chat).

func (*Node) SavePublicDraft

func (n *Node) SavePublicDraft(ctx context.Context, in DraftUpdate) (PublicDraft, error)

SavePublicDraft creates or updates a private SQLite draft only.

func (*Node) SendChat

func (n *Node) SendChat(ctx context.Context, peerIDStr, multiaddrStr, text string) (SendResult, error)

SendChat persists an outbound message, sends it and records a matching ACK. It is the legacy internal entry and records unknown provenance; shells use SendChatOrigin with an explicit human/agent origin.

func (*Node) SendChatOrigin

func (n *Node) SendChatOrigin(ctx context.Context, peerIDStr, multiaddrStr, text, origin, requestID string) (SendResult, error)

SendChatOrigin persists an outbound message with local provenance and an optional idempotency key, sends it and records a matching ACK. Transport/ACK failures are returned in SendResult with Acked=false, not as a local RPC error; only invalid input and local persistence errors are errors. A non-empty requestID maps to one deterministic message ID per Peer: replaying it returns the persisted state and never creates or sends a second message.

func (*Node) SetFavorite

func (n *Node) SetFavorite(ctx context.Context, peerID, publicPath, digest, title string, favorite bool) (Favorite, bool, error)

SetFavorite validates one public-post target and idempotently stores or clears its bookmark. It never stores message/contact favorites.

func (*Node) SetFriendDescription

func (n *Node) SetFriendDescription(ctx context.Context, peerID, description string) (Friend, error)

SetFriendDescription replaces a description for an existing friend.

func (*Node) SetFriendName

func (n *Node) SetFriendName(ctx context.Context, peerID, name string) (Friend, error)

SetFriendName replaces a name for an existing friend. An empty name clears the local label; non-empty names keep the existing syntax/uniqueness rules in storage. This never changes any remotely published profile.

func (*Node) Start

func (n *Node) Start(ctx context.Context) error

Start launches the network subsystems, then registers the chat protocol and connection notifiee.

func (*Node) Status

func (n *Node) Status(ctx context.Context) (Status, error)

Status returns a point-in-time view. Cached peer hints are listed with Online=false; they are never reported as reachable.

func (*Node) Stop

func (n *Node) Stop(context.Context) error

Stop unregisters notifications and closes the network and storage.

func (*Node) Subscribe

func (n *Node) Subscribe(ctx context.Context) (<-chan Event, func(), error)

Subscribe returns a buffered event channel and a cancel function.

func (*Node) SyncFriends

func (n *Node) SyncFriends(ctx context.Context) (bool, error)

SyncFriends regenerates public/friends.json immediately.

func (*Node) ViewFriends

func (n *Node) ViewFriends(ctx context.Context, peerID string) (PeerFriends, error)

func (*Node) ViewProfile

func (n *Node) ViewProfile(ctx context.Context, peerID string) (PeerProfile, error)

type Options

type Options struct {
	DataDir    string
	Version    string
	Config     config.Config
	Identity   *identity.Identity
	Store      *storage.Store
	Network    *network.Network
	Logger     *slog.Logger
	TestAPI    bool
	Supervised bool
}

Options constructs a Node. The Node takes ownership of Store and Network and closes them on Stop; the caller keeps ownership of Identity and its lock.

type OutboxEntry

type OutboxEntry struct {
	MessageID     string
	PeerID        string
	Text          string
	Multiaddr     string
	Status        string
	Attempts      int
	Bytes         int
	LastError     string
	CreatedAt     time.Time
	ExpiresAt     time.Time
	NextAttemptAt time.Time
	UpdatedAt     time.Time
}

OutboxEntry is one durable unacknowledged outbound message.

type OutboxStats

type OutboxStats struct {
	Pending      int
	Acked        int
	Failed       int
	Cancelled    int
	PendingBytes int64
}

OutboxStats is the bounded outbox accounting view.

type PeerEntry

type PeerEntry = network.PeerEntry

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type PeerFriend

type PeerFriend struct {
	Name        string
	PeerID      string
	Addrs       []string
	Description string
}

type PeerFriends

type PeerFriends struct {
	PeerID  string
	Friends []PeerFriend
	Limited bool
}

type PeerManifest

type PeerManifest struct {
	Version   int
	PeerID    string
	Generated time.Time
	Entries   []content.Entry
	Total     int
	Limited   bool
}

type PeerProfile

type PeerProfile struct {
	PeerID string
	Name   string
	Text   string
	Files  []string
	Found  bool
	// Profile is the structured v2 public profile (or legacy fallback fields).
	Profile PublicProfile
}

type PeerStatus

type PeerStatus struct {
	PeerID      string
	Addrs       []string
	Sources     []string
	Direction   string
	Transport   string
	Route       string
	RelayPeerID string
	Direct      bool
	Limited     bool
	Paused      bool
	Online      bool
	OpenedAt    time.Time
}

PeerStatus is one current connection or cached hint.

type PublicDiscovery

type PublicDiscovery struct {
	ID        int64
	PeerID    string
	Path      string
	SHA256    string
	SizeBytes int64
	FetchedAt time.Time
	Source    string
	Sources   []string
}

PublicDiscovery is one successful Agent acquisition from a remote public manifest, with the exact path, hash, time and local acquisition source.

type PublicDiscoveryPage

type PublicDiscoveryPage struct {
	Discoveries []PublicDiscovery
	NextBefore  string
	HasMore     bool
}

PublicDiscoveryPage is one keyset page of discovery evidence.

type PublicDraft

type PublicDraft = storage.PublicDraft

Public draft views are aliases so the local API does not duplicate storage or publication schemas.

type PublicDraftAsset

type PublicDraftAsset = storage.PublicDraftAsset

Public draft views are aliases so the local API does not duplicate storage or publication schemas.

type PublicProfile

type PublicProfile struct {
	AgentName              string
	AgentDescription       string
	AgentInterests         []string
	AgentConversationStyle string
	HumanName              string
	HumanBioMarkdown       string
	AvatarPath             string
	AvatarSHA256           string
	AvatarMime             string
	HumanAvatarPath        string
	HumanAvatarSHA256      string
	HumanAvatarMime        string
	SourcePath             string
	LegacyFallback         bool
	Warning                string
}

PublicProfile is the structured public profile view returned with GetPeerProfile. The legacy Name/Text fields remain populated separately.

type PublishFile

type PublishFile = publication.PublishFile

Public draft views are aliases so the local API does not duplicate storage or publication schemas.

type PublishResult

type PublishResult = publication.PublishResult

Public draft views are aliases so the local API does not duplicate storage or publication schemas.

type Published

type Published struct {
	Files       []PublishedFile
	Skipped     []PublishedSkip
	GeneratedAt time.Time
	// FriendsSyncedAt is the mtime of friends.json, i.e. when its contents last
	// changed, not the last time friends were synced.
	FriendsSyncedAt time.Time
}

Published is the local-only /published view. It is never served over the remote content HTTP routes.

type PublishedFile

type PublishedFile struct {
	Path string
	Size int64
}

PublishedFile is one file in the local public manifest.

type PublishedSkip

type PublishedSkip struct {
	Path   string
	Reason string
}

PublishedSkip is one local path omitted from the public manifest.

type RelayProviderStatus

type RelayProviderStatus = network.RelayProviderStatus

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type RelayReservation

type RelayReservation = network.RelayReservation

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type ResourceStatus

type ResourceStatus = network.ResourceStatus

G2 public type aliases keep the local API dependent on node, not on network internals directly.

type SendResult

type SendResult struct {
	MessageID       string
	Acked           bool
	AckMessageID    string
	ACKID           string
	Route           string
	Transport       string
	RelayPeerID     string
	RemoteMultiaddr string
	Reused          bool
	Source          string
	Attempts        []network.DialAttempt
	Note            string
	Error           string
	OutboxStatus    string
	DeliveryStatus  string
	Replayed        bool
	RequestID       string
}

SendResult is the outcome of one SendChat call. Acked is true only when a matching ACK was received and its ACK state was persisted. DeliveryStatus is the durable history state and outlives the outbox row.

type Status

type Status struct {
	PeerID            string
	NodeID            string
	ListenAddrs       []string
	AdvertisedAddrs   []string
	Version           string
	ProtocolVersion   string
	StartedAt         time.Time
	Peers             []PeerStatus
	Connections       []network.ConnInfo
	TestAPI           bool
	Supervised        bool
	DataDir           string
	GoVersion         string
	Network           NetworkStatus
	ContentWarnings   []string
	MaxChatTextBytes  int
	MaxStoredMessages int
}

Status is a point-in-time view of the running node.

type StoredMessage

type StoredMessage struct {
	MessageID         string
	PeerID            string
	Direction         string
	Text              string
	Acked             bool
	CreatedAt         time.Time
	AckedAt           time.Time
	Origin            string
	DeliveryStatus    string
	DeliveryError     string
	DeliveryUpdatedAt time.Time
	ClientRequestID   string
}

StoredMessage is a persisted message view.

Jump to

Keyboard shortcuts

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