Versions in this module Expand all Collapse all v0 v0.6.0 Sep 29, 2026 Changes in this version + const RoleHeld + const RoleIssued + const RolePresented + var InboxSys = []string + func AckOutbox(q Q, peer, id string, now time.Time) (th, t string, found bool, err error) + func AddAddr(q Q, peer, addr, source string, now time.Time) error + func Append(q Q, r *Record) (inserted bool, err error) + func BumpSeen(q Q, peer, th, id string, now time.Time) error + func DeleteMirrored(q Q, sharer, th, of string) (int64, error) + func DropRef(q Q, peer, ref string) error + func DropThread(q Q, peer, th string) error + func Enqueue(q Q, r *OutboxRow) error + func EnsurePeer(q Q, key string, now time.Time) error + func HasLog(q Q, peer, dir, id string) (bool, error) + func IsPrivate(q Q, peer, th string) (bool, error) + func PruneSeen(q Q, peer string, seen map[string]string, now time.Time) (int64, error) + func PutBlob(q Q, b *Blob) error + func PutGrant(q Q, g *GrantRow) error + func SetAcked(q Q, peer, id string) error + func SetPrivate(q Q, peer, th string, now time.Time) (bool, error) + func SetThreadState(q Q, peer, th string, mine bool, state, note string, now time.Time) error + func Terminal(state string) bool + func TouchPeer(q Q, key, name, about string, caps []string, now time.Time) error + func TouchThread(q Q, peer, th, subject, origin string, now time.Time) error + type Addr struct + Added time.Time + Addr string + LastErr string + LastOK time.Time + Source string + func Addrs(q Q, peer string) ([]Addr, error) + type Blob struct + Dir string + Mime string + Name string + NextN int + Path string + Peer string + Received int64 + Ref string + Size int64 + Status string + Th string + Updated time.Time + func GetBlob(q Q, peer, dir, ref string) (*Blob, error) + type Filter struct + AfterSeq int64 + Dirs []string + Inbox bool + Last bool + Limit int + Mirrors bool + Peer string + Th string + Types []string + UnreadOnly bool + type GrantQuery struct + Audience string + Iss string + Role string + Sub string + ValidAt time.Time + type GrantRow struct + Audience string + Caps []string + Created time.Time + Exp time.Time + Hash string + Iss string + Raw []byte + Role string + Sub string + type MirroredThread struct + Lines int + Of string + Sharer string + Subject string + Th string + Updated time.Time + type OutboxRow struct + Created time.Time + ID string + Line []byte + Peer string + Ref string + Seq int64 + T string + Th string + type Peer struct + About string + Addrs []Addr + Alias string + Caps []string + FirstSeen time.Time + Key string + LastSeen time.Time + Name string + Parked bool + func GetPeer(q Q, key string) (*Peer, error) + type PresenceRow struct + Doc []byte + Hops int + Name string + Origin string + Received time.Time + Seq int64 + TS time.Time + Via string + type Q interface + Exec func(query string, args ...any) (sql.Result, error) + Query func(query string, args ...any) (*sql.Rows, error) + QueryRow func(query string, args ...any) *sql.Row + type Record struct + Acked bool + At time.Time + Dir string + ID string + Line []byte + Meta map[string]any + Peer string + Read bool + Seq int64 + T string + Th string + type Store struct + func Open(path string) (*Store, error) + func (s *Store) AddrResult(peer, addr string, dialErr error, now time.Time) error + func (s *Store) Blobs(peer string) ([]*Blob, error) + func (s *Store) Close() error + func (s *Store) DB() Q + func (s *Store) DeleteGrant(hash string) (int64, error) + func (s *Store) ExpireOutbox(cutoff time.Time) (int64, error) + func (s *Store) ExpirePresence(cutoff time.Time) ([]*PresenceRow, error) + func (s *Store) GetKV(k string) (string, bool, error) + func (s *Store) Grants(gq GrantQuery) ([]*GrantRow, error) + func (s *Store) MarkRead(seqs []int64) error + func (s *Store) MaxOwnID() (string, error) + func (s *Store) MaxSeq() (int64, error) + func (s *Store) MirroredThreads() ([]MirroredThread, error) + func (s *Store) OpenThreads(peer string, cutoff time.Time) (int, error) + func (s *Store) OutboxAfter(peer string, after int64, limit int) ([]OutboxRow, error) + func (s *Store) OutboxCount(peer string) (int, error) + func (s *Store) Peers() ([]*Peer, error) + func (s *Store) PeersWithOutbox() ([]string, error) + func (s *Store) PresenceSince(cutoff time.Time) ([]*PresenceRow, error) + func (s *Store) PutPresence(r *PresenceRow) (stored, isNew bool, err error) + func (s *Store) Query(f Filter) ([]Record, error) + func (s *Store) SeenMap(peer string, cutoff time.Time) (map[string]string, error) + func (s *Store) SetAlias(key, alias string) error + func (s *Store) SetKV(k, v string) error + func (s *Store) SetMeta(seq int64, add map[string]any) error + func (s *Store) SetParked(key string, parked bool) error + func (s *Store) Threads(peer, th string) ([]*Thread, error) + func (s *Store) TrimPresence(max int) error + func (s *Store) Tx(fn func(q Q) error) error + type Thread struct + Created time.Time + MyNote string + MySince time.Time + MyState string + Origin string + Peer string + Subject string + Th string + TheirNote string + TheirSince time.Time + TheirState string + Unread int + Updated time.Time + func GetThread(q Q, peer, th string) (*Thread, error) + func (t *Thread) Open() bool