repository

package
v0.0.0-...-ba8ef21 Latest Latest
Warning

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

Go to latest
Published: Jun 17, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExpiryDate

func GetExpiryDate() int64

func NewRedisClient

func NewRedisClient() *redis.Client

func Persist

func Persist(messages <-chan *entities.Hook)

func Subscribe

func Subscribe(pubSub PubSub)

Types

type Batch

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

func (*Batch) Add

func (batch *Batch) Add(message *entities.Hook)

func (*Batch) Process

func (batch *Batch) Process()

type Pagination

type Pagination struct {
	Offset int64
	Limit  int64
}

type PubSub

type PubSub interface {
	Subscribe() <-chan *entities.Hook
	Publish(payload entities.Hook)
}

type PubSubClient

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

func NewPubSub

func NewPubSub() *PubSubClient

func (*PubSubClient) Publish

func (p *PubSubClient) Publish(hook entities.Hook)

func (*PubSubClient) Subscribe

func (p *PubSubClient) Subscribe() <-chan *entities.Hook

type Redis

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

func (*Redis) Add

func (r *Redis) Add(hooks ...*entities.Hook) error

func (*Redis) ClearExpired

func (r *Redis) ClearExpired() error

func (*Redis) Delete

func (r *Redis) Delete(channel string) error

func (*Redis) Get

func (r *Redis) Get(channel string, pagination Pagination) ([]entities.Hook, int64, error)

type Storage

type Storage interface {
	Add(hooks ...*entities.Hook) error
	Get(channel string, pagination Pagination) ([]entities.Hook, int64, error)
	Delete(channel string) error
	ClearExpired() error
}
var DB Storage

func NewStorage

func NewStorage() (Storage, error)

Jump to

Keyboard shortcuts

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