messaging

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrDuplicateMessageID = errors.New("duplicate message id")
)

Functions

This section is empty.

Types

type Record

type Record struct {
	Account   string
	MessageID uuid.UUID
	Message   []byte
}

func (*Record) Clone

func (r *Record) Clone() Record

func (*Record) Validate

func (r *Record) Validate() error

type Store

type Store interface {
	// Insert inserts a message into a specified bin.
	//
	// ErrDuplicateMessageID is returned if the message's ID already exists in the bin.
	Insert(ctx context.Context, record *Record) error

	// Delete deletes a message in the specified bin.
	//
	// Delete is idempotent.
	Delete(ctx context.Context, account string, messageID uuid.UUID) error

	// Get returns the messages in a bin.
	Get(ctx context.Context, account string) ([]*Record, error)
}

Store stores messages.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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