data

package
v0.20.6 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package data implements generic data structures and deletion of old data.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DecodeEd25519PrivateKey added in v0.19.0

func DecodeEd25519PrivateKey(key string) (ed25519.PrivateKey, error)

DecodeEd25519PrivateKey decodes an Ed25519 private key encoded by EncodeEd25519PrivateKey.

func DecodeEd25519PublicKey added in v0.19.0

func DecodeEd25519PublicKey(key string) (ed25519.PublicKey, error)

DecodeEd25519PublicKey decodes an Ed25519 public key encoded by EncodeEd25519PublicKey.

func EncodeEd25519PrivateKey added in v0.19.0

func EncodeEd25519PrivateKey(key ed25519.PrivateKey) string

EncodeEd25519PrivateKey encodes an Ed25519 private key.

func EncodeEd25519PublicKey added in v0.19.0

func EncodeEd25519PublicKey(key ed25519.PublicKey) string

EncodeEd25519PublicKey encodes an Ed25519 public key.

func IsIDValid

func IsIDValid(u *url.URL) bool

IsIDValid determines whether or not a URL can be a valid actor, object or activity ID.

Types

type GarbageCollector

type GarbageCollector struct {
	Domain string
	Config *cfg.Config
	DB     *sql.DB
}

func (*GarbageCollector) Run

func (gc *GarbageCollector) Run(ctx context.Context) error

Collect deletes old data.

type OrderedMap

type OrderedMap[TK comparable, TV any] map[TK]valueAndIndex[TV]

OrderedMap is a map that maintains insertion order. Listing of keys (using OrderedMap.Keys) iterates over keys and allocates memory.

func (OrderedMap[TK, TV]) All

func (m OrderedMap[TK, TV]) All() iter.Seq2[TK, TV]

All iterates over key/value pairs in the map. All calls OrderedMap.Keys, therefore it allocates memory.

func (OrderedMap[TK, TV]) CollectKeys

func (m OrderedMap[TK, TV]) CollectKeys() []TK

CollectKeys returns a new slice of keys in the map.

func (OrderedMap[TK, TV]) Contains

func (m OrderedMap[TK, TV]) Contains(key TK) bool

Contains determines if the map contains a key.

func (OrderedMap[TK, TV]) Keys

func (m OrderedMap[TK, TV]) Keys() iter.Seq[TK]

Keys iterates over keys in the map. It allocates memory.

func (OrderedMap[TK, TV]) Store

func (m OrderedMap[TK, TV]) Store(key TK, value TV)

Store adds a key/value pair to the map if the map doesn't contain it already.

func (OrderedMap[TK, TV]) Values

func (m OrderedMap[TK, TV]) Values() iter.Seq[TV]

Values iterates over values in the map. Values calls OrderedMap.Keys, therefore it allocates memory.

Jump to

Keyboard shortcuts

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