fileCache

package
v1.0.9 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2019 License: MIT Imports: 9 Imported by: 2

Documentation

Overview

Package fileCache will provide simple file content caching tools for in-Memory access to files. It uses golang/groupcache to cache your data into memory on multiple HTTP Pool servers.

Index

Constants

View Source
const (
	CACHE_STORAGE_PATH = "/usr/local/goCore/caches"
	CACHE_JOBS         = "/usr/local/goCore/jobs"
)
View Source
const (
	CACHE_BOOTSTRAP_STORAGE_PATH = CACHE_STORAGE_PATH + "/bootstrap"
	CACHE_MANIFEST_STORAGE_PATH  = CACHE_STORAGE_PATH + "/manifests"
)

Variables

View Source
var ByteManifest byteManifest
View Source
var Jobs job
View Source
var Model model

Functions

func DeleteAllBootStrapFileCache

func DeleteAllBootStrapFileCache() (err error)

func DeleteAllManifestFileCache

func DeleteAllManifestFileCache() (err error)

func DeleteBootStrapFileCache

func DeleteBootStrapFileCache(key string) (err error)

func DeleteManifestFileCache

func DeleteManifestFileCache(key string) (err error)

func DoesHashExistInCache

func DoesHashExistInCache(key string, value string) (exists bool)

func DoesHashExistInManifestCache

func DoesHashExistInManifestCache(key string, value string) (exists bool)

func GetFile

func GetFile(path string) ([]byte, error)

Returns binary data by path(key) from group cache

func GetHTMLFile

func GetHTMLFile(path string) (string, error)

Returns the html by path (key) from group cache

func GetString

func GetString(key string) (string, error)

Gets a value by Key from group cache

func Initialize

func Initialize()

Call Initialize in main before any calls to this package are performed. serverSettings package must be initialized before fileCache.

func LoadCachedBootStrapFromKeyIntoMemory

func LoadCachedBootStrapFromKeyIntoMemory(key string) (err error)

func LoadCachedManifestFromKeyIntoMemory

func LoadCachedManifestFromKeyIntoMemory(key string) (err error)

func LoadJobsFile

func LoadJobsFile() (err error)

func SetGroupCache

func SetGroupCache(servers []string)

Will update the group cache http pool. Use for dynamic systems that update at runtime.

func SetString

func SetString(key string, value string) error

Sets a Key value pair in group cache

func UpdateBootStrapMemoryCache

func UpdateBootStrapMemoryCache(key string, value string)

func UpdateManifestMemoryCache

func UpdateManifestMemoryCache(key string, value string, byteSize int)

func WriteBootStrapCacheFile

func WriteBootStrapCacheFile(key string) (err error)

func WriteJobCacheFile

func WriteJobCacheFile() (err error)

func WriteManifestCacheFile

func WriteManifestCacheFile(key string) (err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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