repository

package
v0.0.0-...-49c6e27 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	NoMessageError = errors.New("no messages in the queue")
)

Functions

This section is empty.

Types

type RedisRepo

type RedisRepo struct {
	*redis.Client
	// contains filtered or unexported fields
}

func NewRedisRepo

func NewRedisRepo(logger *slog.Logger, opts *redis.Options) *RedisRepo

func (*RedisRepo) CheckConnection

func (r *RedisRepo) CheckConnection(ctx context.Context)

func (*RedisRepo) Get

func (r *RedisRepo) Get(data string) (string, error)

func (*RedisRepo) GetAllKeys

func (r *RedisRepo) GetAllKeys(ctx context.Context) []string

func (*RedisRepo) GetAllMessages

func (r *RedisRepo) GetAllMessages(data string, ctx context.Context) ([]string, error)

func (*RedisRepo) Insert

func (r *RedisRepo) Insert(data string) error

func (*RedisRepo) Remove

func (r *RedisRepo) Remove(data string) error

type Repository

type Repository interface {
	Insert(data string) error
	Remove(data string) error
	Get(data string) (string, error)
}

type SqliteRepo

type SqliteRepo struct {
	*sql.DB
	// contains filtered or unexported fields
}

func NewSqliteRepo

func NewSqliteRepo(dsnUri string, logger *slog.Logger) *SqliteRepo

func (*SqliteRepo) Get

func (s *SqliteRepo) Get(data string) (string, error)

func (*SqliteRepo) Insert

func (s *SqliteRepo) Insert(data string) error

func (*SqliteRepo) Remove

func (s *SqliteRepo) Remove(data string) error

Jump to

Keyboard shortcuts

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