storage

package
v0.0.0-...-f1fda4b Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamoDBBackend

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

func (*DynamoDBBackend) Delete

func (b *DynamoDBBackend) Delete(id uuid.UUID) error

func (*DynamoDBBackend) Init

func (b *DynamoDBBackend) Init(c map[string]string) error

func (*DynamoDBBackend) Retrieve

func (b *DynamoDBBackend) Retrieve(id uuid.UUID) ([]byte, []byte, error)

func (*DynamoDBBackend) Store

func (b *DynamoDBBackend) Store(data, key []byte, ttl int64) (uuid.UUID, error)

type InMemoryStorageBackend

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

InMemoryStorageBackend is a storage backend that stores data in memory

func (*InMemoryStorageBackend) Delete

func (b *InMemoryStorageBackend) Delete(id uuid.UUID) error

Delete deletes data from the storage backend

func (*InMemoryStorageBackend) Init

Init initializes the storage backend

func (*InMemoryStorageBackend) Retrieve

func (b *InMemoryStorageBackend) Retrieve(id uuid.UUID) ([]byte, []byte, error)

Retrieve retrieves data from the storage backend

func (*InMemoryStorageBackend) Store

func (b *InMemoryStorageBackend) Store(data, key []byte, TTL int64) (uuid.UUID, error)

Store stores data in the storage backend

type NullBackend

type NullBackend struct{}

func (*NullBackend) Delete

func (b *NullBackend) Delete(id uuid.UUID) error

func (*NullBackend) Init

func (b *NullBackend) Init(map[string]string) error

func (*NullBackend) Retrieve

func (b *NullBackend) Retrieve(id uuid.UUID) ([]byte, []byte, error)

func (*NullBackend) Store

func (b *NullBackend) Store(data, key []byte, ttl int64) (uuid.UUID, error)

type Record

type Record struct {
	ID   string `dynamodbav:"id"`
	Data []byte `dynamodbav:"data"`
	Key  []byte `dynamodbav:"key"`
	TTL  int64  `dynamodbav:"ttl"`
}

type StorageBackend

type StorageBackend interface {
	Delete(id uuid.UUID) error
	Init(map[string]string) error
	Store(data, key []byte, ttl int64) (uuid.UUID, error)
	Retrieve(id uuid.UUID) ([]byte, []byte, error)
}

Jump to

Keyboard shortcuts

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