timeline

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: GPL-3.0 Imports: 5 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 timeline is a channel's decrypted message timeline on its private collaboration page (design §8 协作页, the generic part): one plaintext record per message, received or sent, that the page lists by time.

A record names the message and nothing about the party's machinery: no host, login, cursor or local id (design §3.6). Its key is fixed by the message's place on the relay — the channel, the direction and the relay seq of that direction — so a message has one key wherever and however often it is written, and the write is create-only: a key already there is the same message, written before, and is left as it is.

Index

Constants

View Source
const (
	In  = "in"
	Out = "out"
)

The two directions: a message this party received, one it sent.

View Source
const Schema = "peer-timeline@1"

Schema is the K7 schema id of a timeline record.

Variables

This section is empty.

Functions

func Key

func Key(channel, dir string, seq int64) string

Key is a message's record key: "tl.<channel>.<dir>.<seq>", the seq zero-padded to 8 so the keys of a direction list in seq order.

func Prefix

func Prefix(channel string) string

Prefix is the key prefix of one channel's records, both directions.

Types

type File

type File struct {
	Name   string `json:"name"`
	Size   int64  `json:"size"`
	SHA256 string `json:"sha256"`
	Mime   string `json:"mime,omitempty"`
}

File is a doc or file message's body on the timeline: what the descriptor says about the content, never the key that opens it or where its blob is.

type Record

type Record struct {
	ID   string    `json:"id"`
	Dir  string    `json:"dir"`
	Kind string    `json:"kind"`
	From string    `json:"from"`
	To   string    `json:"to"`
	At   time.Time `json:"at"`
	// Body is the text for every kind but doc, file and card; the
	// attachment's descriptor without its key and blob for doc and file;
	// {"event":"card"} for a card.
	Body json.RawMessage `json:"body"`
}

Record is one message on the timeline, in this field order.

func Of

func Of(dir string, m *session.Message) (*Record, error)

Of is the record of message m in direction dir.

Jump to

Keyboard shortcuts

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