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 ¶
const ( In = "in" Out = "out" )
The two directions: a message this party received, one it sent.
const Schema = "peer-timeline@1"
Schema is the K7 schema id of a timeline record.
Variables ¶
This section is empty.
Functions ¶
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. An encrypted body is its envelope string.
Body json.RawMessage `json:"body"`
// E2E marks a body encrypted to the party's published keys (internal/e2e).
E2E bool `json:"e2e,omitempty"`
}
Record is one message on the timeline, in this field order.