wscl

package
v0.0.0-...-1de58c0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUpdCacheEntry

func AddUpdCacheEntry(key string, i interface{}, address string) error

AddUpdCacheEntry adds or updates a cache entry using the value of interface i and the string key. It is the callers responsbility to manage the key structure. For a struct type of Foo[], the function should be called as follows:

f := Foo{F1: "value1", F2: "value2",} k := "myUniqueKey1234" err := AddUpdCacheEntry(k,f)

func GetCacheEntry

func GetCacheEntry(key string, i interface{}, address string) error

GetCacheEntry reads the specified entry from the cache. If the entry does not exist, an error will be set. For a struct type of Foo{}, the function should be called as follows:

f := &Foo{} k := "myUniqueKey1234" err := GetCacheEntry(k, f)

followng the call, f will contain the cached value of the Foo{} type if the read was successful.

func RemoveCacheEntry

func RemoveCacheEntry(key string, address string) error

RemoveCacheEntry removes the specified entry from the cache if it exists. If the specified entry does not exist, no error is returned, as the cache is deemd to be in the correct state. An error will be returned only if the function was not able to complete the operation from a technical standpoint.

Types

This section is empty.

Jump to

Keyboard shortcuts

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