store

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 8, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Badger added in v0.5.0

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

func NewBadger added in v0.5.0

func NewBadger(dir string, ttl time.Duration) (*Badger, error)

func (*Badger) GetAll added in v0.5.0

func (b *Badger) GetAll(receiverKey []byte) ([]*pb.DMSMessage, error)

func (*Badger) GetNext added in v0.5.0

func (b *Badger) GetNext(receiverKey []byte) (*pb.DMSMessage, error)

func (*Badger) Remove added in v0.5.0

func (b *Badger) Remove(msg *pb.DMSMessage, receiverKey []byte) error

func (*Badger) Save added in v0.5.0

func (b *Badger) Save(msg *pb.DMSMessage, receiverKey []byte) error

type File

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

func NewFile

func NewFile(baseDir string, maxAge time.Duration) *File

func (*File) GetAll

func (f *File) GetAll(receiverKey []byte) ([]*pb.DMSMessage, error)

func (*File) GetNext

func (f *File) GetNext(receiverKey []byte) (*pb.DMSMessage, error)

func (*File) Remove

func (f *File) Remove(msg *pb.DMSMessage, receiverKey []byte) error

func (*File) Save

func (f *File) Save(msg *pb.DMSMessage, receiverKey []byte) error

type Store

type Store interface {
	// Save saves a new message using the receiver key.
	Save(msg *pb.DMSMessage, receiverKey []byte) error

	// Get next returns next message available for this receiver.
	GetNext(receiver []byte) (*pb.DMSMessage, error)

	// Get all returns all messages available for this receiver.
	GetAll(receiver []byte) ([]*pb.DMSMessage, error)

	// Remove removes the message from the local storage.
	Remove(msg *pb.DMSMessage, receiverKey []byte) error
}

Store represents local store for DMSMessages.

Jump to

Keyboard shortcuts

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