Documentation
¶
Index ¶
- Constants
- func DecodeJSONL[T any](plaintext []byte, out *[]T) error
- func DecryptShard(ciphertext []byte, identityPath string) ([]byte, error)
- func DecryptShardFile(cfg Config, shard ShardEntry) ([]byte, error)
- func EncodeJSONL(rows any) ([]byte, int, error)
- func EncryptShard(plaintext []byte, recipients []string) ([]byte, string, error)
- func EnsureIdentity(path string) (string, error)
- func EquivalentManifest(a, b Manifest) bool
- func RecipientFromIdentity(path string) (string, error)
- func RemoveStaleShards(repo string, shards []ShardEntry) error
- func ResolveShardPath(repo, rel string) (string, error)
- func SHA256Hex(data []byte) string
- func WriteManifest(repo string, manifest Manifest) error
- type Config
- type DecodedShard
- type Manifest
- type Shard
- type ShardEntry
Constants ¶
View Source
const FormatVersion = 1
Variables ¶
This section is empty.
Functions ¶
func DecodeJSONL ¶
func DecryptShardFile ¶
func DecryptShardFile(cfg Config, shard ShardEntry) ([]byte, error)
func EncryptShard ¶
func EnsureIdentity ¶
func EquivalentManifest ¶
func RecipientFromIdentity ¶
func RemoveStaleShards ¶
func RemoveStaleShards(repo string, shards []ShardEntry) error
func ResolveShardPath ¶
func WriteManifest ¶
Types ¶
type DecodedShard ¶
type DecodedShard struct {
Entry ShardEntry
Plaintext []byte
}
func ReadSnapshot ¶
func ReadSnapshot(cfg Config, manifest Manifest) ([]DecodedShard, error)
type Manifest ¶
type Manifest struct {
Format int `json:"format"`
Encrypted bool `json:"encrypted"`
Exported time.Time `json:"exported"`
Recipients []string `json:"recipients,omitempty"`
Counts map[string]int `json:"counts"`
Shards []ShardEntry `json:"shards"`
}
func ReadManifest ¶
func WriteSnapshot ¶
type ShardEntry ¶
type ShardEntry struct {
Table string `json:"table"`
Path string `json:"path"`
Rows int `json:"rows"`
SHA256 string `json:"sha256"`
Bytes int64 `json:"bytes"`
}
func WriteShard ¶
Click to show internal directories.
Click to hide internal directories.