sqlite

package
v0.31.1 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2024 License: BSD-3-Clause Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateKey added in v0.23.2

func GenerateKey() (string, error)

Types

type FieldEncrypt added in v0.23.3

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

func NewFieldEncrypt added in v0.23.3

func NewFieldEncrypt(key string) (*FieldEncrypt, error)

func (*FieldEncrypt) Decrypt added in v0.23.3

func (ec *FieldEncrypt) Decrypt(data string) (string, error)

Decrypt decrypts ciphertext using AES-GCM

func (*FieldEncrypt) Encrypt added in v0.23.3

func (ec *FieldEncrypt) Encrypt(payload string) (string, error)

Encrypt encrypts plaintext using AES-GCM

func (*FieldEncrypt) LegacyDecrypt added in v0.29.2

func (ec *FieldEncrypt) LegacyDecrypt(data string) (string, error)

func (*FieldEncrypt) LegacyEncrypt added in v0.29.2

func (ec *FieldEncrypt) LegacyEncrypt(payload string) string

type Store

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

Store is the implementation of the activity.Store interface backed by SQLite

func NewSQLiteStore

func NewSQLiteStore(ctx context.Context, dataDir string, encryptionKey string) (*Store, error)

NewSQLiteStore creates a new Store with an event table if not exists.

func (*Store) Close

func (store *Store) Close(_ context.Context) error

Close the Store

func (*Store) Get

func (store *Store) Get(ctx context.Context, accountID string, offset, limit int, descending bool) ([]*activity.Event, error)

Get returns "limit" number of events from index ordered descending or ascending by a timestamp

func (*Store) Save

func (store *Store) Save(_ context.Context, event *activity.Event) (*activity.Event, error)

Save an event in the SQLite events table end encrypt the "email" element in meta map

Jump to

Keyboard shortcuts

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