pkg

package
v0.0.0-...-5b112dc Latest Latest
Warning

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

Go to latest
Published: May 26, 2021 License: BSD-3-Clause Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {

	// Add_ inserts the value if the key is not found and returns true if it was added, false if not.
	Add_(key, value interface{}) bool

	// Set_ updates the value if the key exists, and inserts the value if the key is not found.
	Set_(key, value interface{})

	// SetAndGet_ updates the value if the key exists, and inserts the value if the key is not found.
	// Returns the old value for the provided key, or the new value if no key was found. This will
	// return a status of true if the key was found, and a secondary value of false if it was not found.
	SetAndGet_(key, value interface{}) (interface{}, bool)

	// Get_ attempts to find and return the value for the provided key. Returns false if not found.
	Get_(key interface{}) (interface{}, bool)

	// Del_ attempts to find and delete the value for the provided key. Returns true on success.
	Del_(key interface{}) bool

	// DelAndGet_ attempts to find and delete the value for the provided key. Returns the
	// deleted value and true on success.
	DelAndGet_(key interface{}) (interface{}, bool)

	// Range_ calls f sequentially for each key and value present. If f returns false, range stops the iteration.
	Range_(f func(key, value interface{}) bool)

	// RangeBetween_ is similar to Range, but it iterates as long as both functions remain true
	RangeBetween_(gt func(key interface{}) bool, lt func(key interface{}) bool)

	// Size_ returns the count of how many items are contained
	Size_() int
}

Store represents a "storage" type

Jump to

Keyboard shortcuts

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