store

package
v0.0.0-...-0453e60 Latest Latest
Warning

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

Go to latest
Published: Jun 23, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

type Provider interface {
	// Unique checks the uniqueness of the key.
	// If not exists, then add key to store and returns nil error. Otherwise, error is returned.
	// A timeout should be added to the unique key in case deletion failures happen.
	Unique(key string) error
	// DeUnique removes the unique key added in the store by Unique() method.
	DeUnique(key string) error
	// SaveResult saves the scan result with json format associated with the reqID in the store.
	SaveResult(key *data.Key, data *data.Item) error
	// GetResult retrieves the scan result with JSON format associated with
	// the specified reqID
	// the scanner provider name
	// and teh data mimetype.
	//
	// If data is not found, then NOT_FOUND error should be returned.
	// If data is not ready, then NOT_READY error should be returned (A next retry header can be added to HTTP response).
	// If data is marked as error, then the related error should be returned.
	GetResult(key *data.Key) (*data.Item, error)
}

Provider to provide data store capabilities.

func Default

func Default() Provider

Default returns the default store provider. The default provider is redis.Provider.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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