redis

package
v0.0.9 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	URI                 string
	BloomFilterName     string `yaml:"bloom_filter_name"`
	BlackListFilterName string `yaml:"black_list_filter_name"`
	WhiteListFilterName string `yaml:"white_list_filter_name"`
	ConnectionTimeout   int16  `yaml:"connection_timeout_in_ms"`
	QueryTimeout        int16  `yaml:"query_timeout_in_ms"`
}

type Redis

type Redis struct {
	Client              *redis.Client
	BloomFilterName     string
	WhiteListFilterName string
	BlackListFilterName string
	Name                string
	QueryTimeout        time.Duration
}

func New

func New(cfg Config) (*Redis, error)

func (*Redis) AddDelayedTask

func (r *Redis) AddDelayedTask(listName string,
	data string, delay time.Duration,
) error

! note: delayed tasks probably are not concurrent safe at the moment.

func (*Redis) AddEventToBloom added in v0.0.8

func (r *Redis) AddEventToBloom(id []byte) error

func (*Redis) CheckAcceptability added in v0.0.8

func (r *Redis) CheckAcceptability(restrictedWrites bool, eid []byte, pubkey string) error

func (*Redis) Close

func (r *Redis) Close() error

func (*Redis) GetReadyTasks

func (r *Redis) GetReadyTasks(listName string) ([]string, error)

func (*Redis) RemoveTasks

func (r *Redis) RemoveTasks(listName string, tasks []string) error

Jump to

Keyboard shortcuts

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