pgstore

package
v0.0.0-...-cf82ea8 Latest Latest
Warning

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

Go to latest
Published: Jan 30, 2020 License: MIT, MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrKeyNotFound = pandora.ApiError("key not found")
)

Functions

This section is empty.

Types

type BlobStore

type BlobStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

BlobStore implements pandora.BlobStore using postgresql as backend

func OpenBlobStore

func OpenBlobStore(user, pwd, host, dbname string) (*BlobStore, error)

OpenBlobStore returns the blobstore using the provided user, password, host and dbname

func (*BlobStore) Close

func (bs *BlobStore) Close() error

Close the store

func (*BlobStore) GetData

func (bs *BlobStore) GetData(out []byte, k pandora.Key) ([]byte, error)

GetData read the contents stored under the k key

func (*BlobStore) InitTables

func (bs *BlobStore) InitTables() (err error)

InitTables create all the required tables to use the blob store

func (*BlobStore) PutData

func (bs *BlobStore) PutData(k pandora.Key, data []byte) (pandora.Key, error)

PutData write the contents of data and return the key used to store the data

func (*BlobStore) UpdateRefCount

func (bs *BlobStore) UpdateRefCount(k pandora.Key, delta int) error

type MessageStore

type MessageStore struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

MessageStore implements pandora.MessageStore using postgresql as backend

func OpenMessageStore

func OpenMessageStore(user, pwd, host, dbname string) (*MessageStore, error)

OpenMessageStore opens the message store with the given parameters

func (*MessageStore) Ack

func (ms *MessageStore) Ack(mid, lid pandora.Key, status pandora.AckStatus) error

func (*MessageStore) DeleteMessages

func (ms *MessageStore) DeleteMessages() error

func (*MessageStore) Enqueue

func (ms *MessageStore) Enqueue(msg *pandora.Message) error

Enqueue will place the message inside the receiver inbox

func (*MessageStore) FetchAndLockLatest

func (ms *MessageStore) FetchAndLockLatest(recv string, dur time.Duration) (*pandora.Message, error)

FetchAndLockLatest will read and lock the latest message for the given receiver

func (*MessageStore) FetchHeaders

func (ms *MessageStore) FetchHeaders(out []pandora.Message, recv string, receivedAt time.Time) (int, error)

func (*MessageStore) InitTables

func (ms *MessageStore) InitTables() (err error)

func (*MessageStore) Reenqueue

func (ms *MessageStore) Reenqueue(now time.Time) error

Jump to

Keyboard shortcuts

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