kv

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func KeyAccountAccessToken

func KeyAccountAccessToken(i int64) string

KeyAccountAccessToken returns the kv key which holds a user's access token.

func KeyFediActor

func KeyFediActor(a string) string

KeyFediActor returns the kv key which holds cached actor.

func KeyFediHostMeta

func KeyFediHostMeta(d string) string

KeyFediHostMeta returns the kv key which holds cached host meta.

func KeyFediNodeInfo

func KeyFediNodeInfo(d string) string

KeyFediNodeInfo returns the kv key which holds cached nodeinfo.

func KeyInstanceOAuth

func KeyInstanceOAuth(i int64) string

KeyInstanceOAuth returns the kv key which holds an instance's oauth tokens.

func KeyMetricsDeliverError added in v0.4.0

func KeyMetricsDeliverError(t time.Time) string

KeyMetricsDeliverError returns the kv key which holds the number of delivery errors to an instance.

func KeyMetricsDeliverErrorTotal added in v0.4.0

func KeyMetricsDeliverErrorTotal(t time.Time) string

KeyMetricsDeliverErrorTotal returns the kv key which holds the number of delivery errors

func KeyMetricsDeliverSuccess added in v0.4.0

func KeyMetricsDeliverSuccess(t time.Time) string

KeyMetricsDeliverSuccess returns the kv key which holds the number of delivery successes to an instance.

func KeyMetricsDeliverSuccessTotal added in v0.4.0

func KeyMetricsDeliverSuccessTotal(t time.Time) string

KeyMetricsDeliverSuccessTotal returns the kv key which holds the number of delivery successes to an instance.

func KeyMetricsReceived added in v0.4.0

func KeyMetricsReceived(t time.Time) string

KeyMetricsReceived returns the kv key which holds the number of receives from an instance.

func KeyMetricsReceivedTotal added in v0.4.0

func KeyMetricsReceivedTotal(t time.Time) string

KeyMetricsReceivedTotal returns the kv key which holds the number of receives.

func KeySession

func KeySession() string

KeySession returns the base kv key prefix.

Types

type EncryptionError

type EncryptionError struct {
	// contains filtered or unexported fields
}

EncryptionError is returned when a an encryption error occurs.

func (*EncryptionError) Error

func (e *EncryptionError) Error() string

Error returns the error message as a string.

type Error

type Error error

Error represents a database specific error.

var (
	// ErrNil is returned when the kv value is nil.
	ErrNil Error = fmt.Errorf("nil")
)

func NewEncryptionError

func NewEncryptionError(msg string) Error

NewEncryptionError wraps a message in an EncryptionError object.

type KV

type KV interface {
	fedihelper.KV
	Metrics
}

KV represents a key value store.

type Metrics added in v0.4.2

type Metrics interface {
	IncMetricsDeliverError(ctx context.Context, instanceID int64, timestamp time.Time) Error
	IncMetricsDeliverErrorTotal(ctx context.Context, timestamp time.Time) Error
	IncMetricsDeliverSuccess(ctx context.Context, instanceID int64, timestamp time.Time) Error
	IncMetricsDeliverSuccessTotal(ctx context.Context, timestamp time.Time) Error
	IncMetricsReceived(ctx context.Context, instanceID int64, timestamp time.Time) Error
	IncMetricsReceivedTotal(ctx context.Context, timestamp time.Time) Error

	MGetMetricsDeliverError(ctx context.Context, instanceID int64, timestamps []time.Time) (map[time.Time]int, Error)
	MGetAllMetricsDeliverError(ctx context.Context, timestamps []time.Time) (map[int64]map[time.Time]int, Error)
	MGetMetricsDeliverSuccess(ctx context.Context, instanceID int64, timestamps []time.Time) (map[time.Time]int, Error)
	MGetAllMetricsDeliverSuccess(ctx context.Context, timestamps []time.Time) (map[int64]map[time.Time]int, Error)
	MGetMetricsReceived(ctx context.Context, instanceID int64, timestamps []time.Time) (map[time.Time]int, Error)
	MGetMetricsReceivedTotal(ctx context.Context, timestamps []time.Time) (map[time.Time]int, Error)
	MGetAllMetricsReceived(ctx context.Context, timestamps []time.Time) (map[int64]map[time.Time]int, Error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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