snapbase

package
v0.0.0-...-eeebc8f Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2018 License: MIT Imports: 4 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

Create a snapbase middleware with the specified parameters

Types

type CloseCallback

type CloseCallback func() error

CloseCallback is a callback that closes the inner provider

type GetCallback

type GetCallback func(string) (interface{}, int64, error)

GetCallback fetches a snapshot

type Parameters

type Parameters struct {
	Lazy         bool          // Lazy provider
	SnapInterval int64         // Frequency between snaps
	Close        CloseCallback // Close callback
	Get          GetCallback   // Get entry from snapshot storage
	Purge        PurgeCallback // Purge an entr
	Put          PutCallback   // Put entry into the snapshot storage
}

Parameters is a structure that contains the various common callbacks that are required for a snap-provider to work correctly, as well as any additional parameters.

type PurgeCallback

type PurgeCallback func(string) error

PurgeCallback purges an entry from the store.

type PutCallback

type PutCallback func(string, int64, interface{}) error

PutCallback is the callback that writes to the store

Jump to

Keyboard shortcuts

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