redisrepo

package
v0.0.0-...-addcf83 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RedisMutexes

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

func NewRedisMutexes

func NewRedisMutexes(client *redis.Client, key string) *RedisMutexes

func (*RedisMutexes) Lock

func (mutexes *RedisMutexes) Lock(ctx context.Context, id any) (ok bool, absent bool, err error)

func (*RedisMutexes) NewAndLock

func (mutexes *RedisMutexes) NewAndLock(ctx context.Context, id any) (ok bool, err error)

func (*RedisMutexes) UnlockAll

func (mutexes *RedisMutexes) UnlockAll(ctx context.Context, ids []any)

type RedisRepository

type RedisRepository[T any] struct {
	arp.Repository[T]
	// contains filtered or unexported fields
}

func NewRedisRepository

func NewRedisRepository[T any](client *redis.Client, key string, newZeroEntity arp.NewZeroEntity[T]) *RedisRepository[T]

func NewRedisRepositoryWithMutexesimpl

func NewRedisRepositoryWithMutexesimpl[T any](client *redis.Client, key string, newZeroEntity arp.NewZeroEntity[T], mutexesimpl arp.Mutexes) *RedisRepository[T]

func (*RedisRepository[T]) Count

func (repo *RedisRepository[T]) Count(ctx context.Context) (uint64, error)

func (*RedisRepository[T]) QueryAllIds

func (repo *RedisRepository[T]) QueryAllIds(ctx context.Context) (ids []any, err error)

type RedisStore

type RedisStore[T any] struct {
	// contains filtered or unexported fields
}

func NewRedisStore

func NewRedisStore[T any](client *redis.Client, key string, newEmptyEntity arp.NewZeroEntity[T]) *RedisStore[T]

func (*RedisStore[T]) Load

func (store *RedisStore[T]) Load(ctx context.Context, id any) (entity T, found bool, err error)

func (*RedisStore[T]) RemoveAll

func (store *RedisStore[T]) RemoveAll(ctx context.Context, ids []any) error

func (*RedisStore[T]) Save

func (store *RedisStore[T]) Save(ctx context.Context, id any, entity T) error

func (*RedisStore[T]) SaveAll

func (store *RedisStore[T]) SaveAll(ctx context.Context, entitiesToInsert map[any]any, entitiesToUpdate map[any]*arp.ProcessEntity) error

Jump to

Keyboard shortcuts

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