store

package
v0.0.0-...-44ee8c0 Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CStore

type CStore struct {
	// contains filtered or unexported fields
}

CStore stands for ConcurrentStore and is simply an abstract of a map with a mutex.

func New

func New() CStore

New returns an initialized CStore

func (*CStore) AnyContains

func (cs *CStore) AnyContains(needle string) bool

AnyContains checks whether the passed needle is contained in any of the keys that the store has.

func (*CStore) AnyContainsReverse

func (cs *CStore) AnyContainsReverse(haystack string) bool

AnyContainsReverse checks whether any of the keys stored by the store is contained in the passed haystack

func (*CStore) Contains

func (cs *CStore) Contains(key string) bool

Contains checks if a key exists in the store.

func (*CStore) Delete

func (cs *CStore) Delete(key string)

Delete deletes an entry from the underlying map

func (*CStore) Load

func (cs *CStore) Load(key string) (string, bool)

Load loads the value saved by the provided key.

func (*CStore) Size

func (cs *CStore) Size() int

Size returns the size of the underlying map

func (*CStore) Store

func (cs *CStore) Store(key, value string)

Store stores the value with the provided key

func (*CStore) StoreKey

func (cs *CStore) StoreKey(key string)

StoreKey simply stores the key with empty value

func (*CStore) ToMap

func (cs *CStore) ToMap() map[string]string

ToMap creates a copy of the underlying map and returns it

Jump to

Keyboard shortcuts

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