resourcedb

package
v0.0.0-...-75be81d Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2024 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 MockDB

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

func NewMockDB

func NewMockDB() *MockDB

func (*MockDB) Alloc

func (s *MockDB) Alloc(ctx context.Context, amount int) ([]string, error)

func (*MockDB) Dealloc

func (s *MockDB) Dealloc(ctx context.Context, ids []string) error

func (*MockDB) Init

func (s *MockDB) Init(ctx context.Context, resources []core.Resource) error

func (*MockDB) Load

func (s *MockDB) Load(ctx context.Context, ids ...string) ([]core.Resource, error)

type RedisDB

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

func NewRedisDB

func NewRedisDB(client redis.UniversalClient, codec codec.Codec[core.Resource, []byte], keyPrefix string) *RedisDB

func (*RedisDB) Alloc

func (storage *RedisDB) Alloc(ctx context.Context, amount int) ([]string, error)

func (*RedisDB) Dealloc

func (storage *RedisDB) Dealloc(ctx context.Context, ids []string) error

func (*RedisDB) Init

func (storage *RedisDB) Init(ctx context.Context, resources []core.Resource) error

func (*RedisDB) Load

func (storage *RedisDB) Load(ctx context.Context, ids ...string) ([]core.Resource, error)

Jump to

Keyboard shortcuts

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