interfaces

package
v0.0.0-...-d614328 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2023 License: MIT Imports: 0 Imported by: 9

Documentation

Overview

Package interfaces defines the behaviour of shared services

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cacher

type Cacher interface {
	// Connect to the queue
	Connect() error
	// Set a float value at key
	Set(key string, value interface{}) error
	// Get an float value at key
	GetFloat64(key string) (float64, error)
	// IncrementBy increments the value at key by the given value
	IncrementBy(key string, value int64) error
	// Delete a key
	Delete(key string) error
	// Disconnect from the queue
	Disconnect() error
}

Cacher defines the available actions for caches

type Queuer

type Queuer interface {
	// Connect to the queue
	Connect() error
	// Push pushes data onto the queue at key
	Push(string, []byte) error
	// PushMany pushes multiple items onto the queue at key
	PushMany(string, [][]byte) error
	// Fetch retrieves a single item from the queue at key and returns a
	// byte slice of data
	Fetch(string) ([]byte, error)
	// FetchMany retrieves up to the specified count from the queue at key and
	// returns a slive of byte slices
	FetchMany(string, int) ([][]byte, error)
	// CountItems counts the amount of items in the given queue
	CountItems(string) (int, error)
	// Purge all items from the given queue
	Purge(string) error
	// Disconnect from the queue
	Disconnect() error
}

Queuer defines the available actions for queues

Jump to

Keyboard shortcuts

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