data

package
v0.0.0-...-ba5aec8 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 9 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 IsIDValid

func IsIDValid(u *url.URL) bool

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

func ParsePrivateKey

func ParsePrivateKey(privateKeyPemString string) (any, error)

ParsePrivateKey parses private keys.

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]) 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() []TK

Keys returns a list of keys in the map. To do so, it iterates over keys and allocates memory.

func (OrderedMap[TK, TV]) Range

func (m OrderedMap[TK, TV]) Range(f func(key TK, value TV) bool)

Range iterates over the map and calls a callback for each key/value pair. Iteration stops if the callback returns false. Range calls OrderedMap.Keys, therefore 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.

Jump to

Keyboard shortcuts

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