fscache

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2022 License: MIT Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheStates = cacheFileStates{
		ReadState:               "Read",
		WriteState:              "Write",
		CacheExpireState:        "Expired",
		InvalidateGenerateState: "InvalidateGenerate",
	}
)

Functions

This section is empty.

Types

type CacheFile

type CacheFile struct {
	ChmodWrapper                   pathchmod.Wrapper           // user input
	AbsParentDir, AbsFilePath      string                      // user input
	IsAcquireLock                  bool                        // user input
	IsCollectReadError             bool                        // user input
	IsCollectWriteError            bool                        // user input
	IsWriteEmptyOnNull             bool                        // user input
	IsRemoveFileBeforeWrite        bool                        // user input
	OnInvalidGenerator             *errfunc.OnInvalidGenerator // generator func
	OnReadActionInvoker            pathhelpercore.InvokerFunc
	OnWriteActionInvoker           pathhelpercore.InvokerFunc
	OnCacheExpireActionInvoker     pathhelpercore.InvokerFunc
	OnInvalidGenerateActionInvoker pathhelpercore.InvokerFunc
	// contains filtered or unexported fields
}

func (*CacheFile) ExpireCacheFile

func (it *CacheFile) ExpireCacheFile() *errorwrapper.Wrapper

func (*CacheFile) FileInfo

func (it *CacheFile) FileInfo(
	stateType strtype.Variant,
	fileRawBytesResults *errbyte.Results,
) *pathhelpercore.FileInfo

func (*CacheFile) GetOnce

func (it *CacheFile) GetOnce(
	toPtr interface{},
) *errorwrapper.Wrapper

GetOnce

on compile success reflect set to ToPtr
on compile error returns previous compiling error

func (*CacheFile) GetSetInvalidGeneratorOnEmpty

func (it *CacheFile) GetSetInvalidGeneratorOnEmpty(
	generator *errfunc.OnInvalidGenerator,
) *CacheFile

func (*CacheFile) InvalidateCacheFile

func (it *CacheFile) InvalidateCacheFile() *errorwrapper.Wrapper

func (*CacheFile) IsApplicable

func (it *CacheFile) IsApplicable() bool

func (*CacheFile) IsCacheIntegrityAlright

func (it *CacheFile) IsCacheIntegrityAlright(
	toPtr interface{},
) bool

func (*CacheFile) IsCompiled

func (it *CacheFile) IsCompiled() bool

func (*CacheFile) IsCompiledSafe

func (it *CacheFile) IsCompiledSafe() bool

func (*CacheFile) IsErrorOnNull

func (it *CacheFile) IsErrorOnNull() bool

func (*CacheFile) IsExpireActionInvokerDefined

func (it *CacheFile) IsExpireActionInvokerDefined() bool

func (*CacheFile) IsExpireActionInvokerEmpty

func (it *CacheFile) IsExpireActionInvokerEmpty() bool

func (*CacheFile) IsFileExist

func (it *CacheFile) IsFileExist() bool

func (*CacheFile) IsNotFileExist

func (it *CacheFile) IsNotFileExist() bool

func (*CacheFile) IsOnInvalidGeneratorDefined

func (it *CacheFile) IsOnInvalidGeneratorDefined() bool

func (*CacheFile) IsOnInvalidGeneratorEmpty

func (it *CacheFile) IsOnInvalidGeneratorEmpty() bool

func (*CacheFile) IsOnInvalidateGenerateActionInvokerDefined

func (it *CacheFile) IsOnInvalidateGenerateActionInvokerDefined() bool

func (*CacheFile) IsOnInvalidateGenerateActionInvokerEmpty

func (it *CacheFile) IsOnInvalidateGenerateActionInvokerEmpty() bool

func (*CacheFile) IsReadActionInvokerDefined

func (it *CacheFile) IsReadActionInvokerDefined() bool

func (*CacheFile) IsReadActionInvokerEmpty

func (it *CacheFile) IsReadActionInvokerEmpty() bool

func (*CacheFile) IsWriteActionInvokerDefined

func (it *CacheFile) IsWriteActionInvokerDefined() bool

func (*CacheFile) IsWriteActionInvokerEmpty

func (it *CacheFile) IsWriteActionInvokerEmpty() bool

func (*CacheFile) ReadCacheOrDirectJsonResult

func (it *CacheFile) ReadCacheOrDirectJsonResult() *errjson.Result

func (*CacheFile) ReadFromFile

func (it *CacheFile) ReadFromFile(
	toPtr interface{},
) *errorwrapper.Wrapper

func (*CacheFile) ReadFromFileAsJsonResult

func (it *CacheFile) ReadFromFileAsJsonResult() (
	fileJsonResult *corejson.Result,
	readingErrWrap *errorwrapper.Wrapper,
)

func (*CacheFile) References

func (it *CacheFile) References() *refs.Collection

func (*CacheFile) RemoveFileCache

func (it *CacheFile) RemoveFileCache() *errorwrapper.Wrapper

func (*CacheFile) RootNameInfo

func (it *CacheFile) RootNameInfo() *coretaskinfo.Info

func (*CacheFile) Save

func (it *CacheFile) Save(
	fromAny interface{},
) *errorwrapper.Wrapper

Save

Casting happens:
- self or self pointer returns directly
- []Bytes to Result
- string (json) to Result
- Jsoner to Result
- bytesSerializer to Result
- error to Result
- AnyItem

func (*CacheFile) StateActionInvoke

func (it *CacheFile) StateActionInvoke(
	state strtype.Variant,
	fileRawBytesResults *errbyte.Results,
) *errorwrapper.Wrapper

type HashmapCacheFile

type HashmapCacheFile struct {
	CacheFile
	// contains filtered or unexported fields
}

func (*HashmapCacheFile) AddOrUpdateEnumDynamicMapSave

func (it *HashmapCacheFile) AddOrUpdateEnumDynamicMapSave(
	enumDynamicMap enumimpl.DynamicMap,
) (
	isAnyNewlyAdded bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AddOrUpdateKeyValuesSave

func (it *HashmapCacheFile) AddOrUpdateKeyValuesSave(
	keyValues ...corestr.KeyAnyValuePair,
) (
	isAnyNewlyAdded bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AddOrUpdateManySave

func (it *HashmapCacheFile) AddOrUpdateManySave(
	keys ...string,
) (
	isAnyAddedNewly bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AddOrUpdateMapAnyItemsSave

func (it *HashmapCacheFile) AddOrUpdateMapAnyItemsSave(
	savingMap *coredynamic.MapAnyItems,
) (
	isAnyNewlyAdded bool,
	currentMap *coredynamic.MapAnyItems,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AddOrUpdateMapSave

func (it *HashmapCacheFile) AddOrUpdateMapSave(
	mapStringAnyItem map[string]string,
) (
	isAnyNewlyAdded bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AddOrUpdateMetaCollectionSave

func (it *HashmapCacheFile) AddOrUpdateMetaCollectionSave(
	metaAttrCompiler loggerinf.MetaAttributesCompiler,
) (
	isAnyNewlyAdded bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AddOrUpdateReferencesFullStringSave

func (it *HashmapCacheFile) AddOrUpdateReferencesFullStringSave(
	references ...ref.Value,
) (
	isAnyNewlyAdded bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AddOrUpdateReferencesSave

func (it *HashmapCacheFile) AddOrUpdateReferencesSave(
	references ...ref.Value,
) (
	isAnyNewlyAdded bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AddOrUpdateSave

func (it *HashmapCacheFile) AddOrUpdateSave(
	key string,
	val string,
) (savingErrWrap *errorwrapper.Wrapper)

func (*HashmapCacheFile) AllKeys

func (it *HashmapCacheFile) AllKeys() (
	allKeys []string,
	readErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) AllKeysSorted

func (it *HashmapCacheFile) AllKeysSorted() (
	allKeysSorted []string,
	readErrWrap *errorwrapper.Wrapper,
)

func (*HashmapCacheFile) CoreHashmap

func (it *HashmapCacheFile) CoreHashmap() (
	*corestr.Hashmap,
	*errorwrapper.Wrapper,
)

func (*HashmapCacheFile) EnumDynamicMap

func (it *HashmapCacheFile) EnumDynamicMap() (
	enumimpl.DynamicMap,
	*errorwrapper.Wrapper,
)

func (*HashmapCacheFile) GetValue

func (it *HashmapCacheFile) GetValue(key string) (val string)

func (*HashmapCacheFile) GetValueWithStat

func (it *HashmapCacheFile) GetValueWithStat(key string) (val string, isFound bool)

func (*HashmapCacheFile) HasAllKey

func (it *HashmapCacheFile) HasAllKey(
	keys ...string,
) bool

func (*HashmapCacheFile) HasAnyItem

func (it *HashmapCacheFile) HasAnyItem() bool

func (*HashmapCacheFile) HasKey

func (it *HashmapCacheFile) HasKey(key string) bool

func (*HashmapCacheFile) IsAnyMissing

func (it *HashmapCacheFile) IsAnyMissing(keys ...string) bool

func (*HashmapCacheFile) IsEmpty

func (it *HashmapCacheFile) IsEmpty() bool

func (*HashmapCacheFile) IsFileIntegrityAlright

func (it *HashmapCacheFile) IsFileIntegrityAlright() bool

func (*HashmapCacheFile) IsMissing

func (it *HashmapCacheFile) IsMissing(key string) bool

func (*HashmapCacheFile) Length

func (it *HashmapCacheFile) Length() int

func (*HashmapCacheFile) Read

func (it *HashmapCacheFile) Read() (map[string]string, *errorwrapper.Wrapper)

func (*HashmapCacheFile) SafeDynamicMap

func (it *HashmapCacheFile) SafeDynamicMap() enumimpl.DynamicMap

func (*HashmapCacheFile) SafeHashmap

func (it *HashmapCacheFile) SafeHashmap() map[string]string

func (*HashmapCacheFile) SafeMayAnyItems

func (it *HashmapCacheFile) SafeMayAnyItems() *coredynamic.MapAnyItems

func (*HashmapCacheFile) Save

func (it *HashmapCacheFile) Save(
	hashset map[string]bool,
) *errorwrapper.Wrapper

func (*HashmapCacheFile) String

func (it *HashmapCacheFile) String() string

func (*HashmapCacheFile) Strings

func (it *HashmapCacheFile) Strings() []string

type HashsetCacheFile

type HashsetCacheFile struct {
	CacheFile
	// contains filtered or unexported fields
}

func (*HashsetCacheFile) AddOrUpdateCoreHashsetSave

func (it *HashsetCacheFile) AddOrUpdateCoreHashsetSave(
	savingCoreHashset *corestr.Hashset,
) (
	isAnyAddedNewly bool,
	coreHashset *corestr.Hashset,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashsetCacheFile) AddOrUpdateHashsetSave

func (it *HashsetCacheFile) AddOrUpdateHashsetSave(
	anotherHashset map[string]bool,
) (
	isAnyAddedNewly bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashsetCacheFile) AddOrUpdateManySave

func (it *HashsetCacheFile) AddOrUpdateManySave(
	keys ...string,
) (
	isAnyAddedNewly bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*HashsetCacheFile) AddOrUpdateSave

func (it *HashsetCacheFile) AddOrUpdateSave(
	key string,
) (isAddedNewly bool, savingErrWrap *errorwrapper.Wrapper)

func (*HashsetCacheFile) CoreHashset

func (it *HashsetCacheFile) CoreHashset() (
	*corestr.Hashset,
	*errorwrapper.Wrapper,
)

func (*HashsetCacheFile) HasAnyItem

func (it *HashsetCacheFile) HasAnyItem() bool

func (*HashsetCacheFile) HasKey

func (it *HashsetCacheFile) HasKey(key string) bool

func (*HashsetCacheFile) Hashset

func (it *HashsetCacheFile) Hashset() (map[string]bool, *errorwrapper.Wrapper)

func (*HashsetCacheFile) IsEmpty

func (it *HashsetCacheFile) IsEmpty() bool

func (*HashsetCacheFile) IsHashsetFileIntegrityAlright

func (it *HashsetCacheFile) IsHashsetFileIntegrityAlright() bool

func (*HashsetCacheFile) IsMissing

func (it *HashsetCacheFile) IsMissing(key string) bool

func (*HashsetCacheFile) Length

func (it *HashsetCacheFile) Length() int

func (*HashsetCacheFile) Read

func (it *HashsetCacheFile) Read() (map[string]bool, *errorwrapper.Wrapper)

func (*HashsetCacheFile) SafeHashset

func (it *HashsetCacheFile) SafeHashset() map[string]bool

func (*HashsetCacheFile) Save

func (it *HashsetCacheFile) Save(
	hashset map[string]bool,
) *errorwrapper.Wrapper

type MapStringAnyCacheFile

type MapStringAnyCacheFile struct {
	CacheFile
	// contains filtered or unexported fields
}

func (*MapStringAnyCacheFile) AddOrUpdateEnumDynamicMapSave

func (it *MapStringAnyCacheFile) AddOrUpdateEnumDynamicMapSave(
	enumDynamicMap enumimpl.DynamicMap,
) (
	savingErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AddOrUpdateKeyValuesSave

func (it *MapStringAnyCacheFile) AddOrUpdateKeyValuesSave(
	keyValues ...corestr.KeyAnyValuePair,
) (
	savingErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AddOrUpdateManySave

func (it *MapStringAnyCacheFile) AddOrUpdateManySave(
	keys ...string,
) (
	isAnyAddedNewly bool,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AddOrUpdateMapAnyItemsSave

func (it *MapStringAnyCacheFile) AddOrUpdateMapAnyItemsSave(
	savingMap *coredynamic.MapAnyItems,
) (
	currentMap *coredynamic.MapAnyItems,
	savingErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AddOrUpdateMapSave

func (it *MapStringAnyCacheFile) AddOrUpdateMapSave(
	mapStringAnyItem map[string]interface{},
) (
	savingErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AddOrUpdateMetaCollectionSave

func (it *MapStringAnyCacheFile) AddOrUpdateMetaCollectionSave(
	metaAttrCompiler loggerinf.MetaAttributesCompiler,
) (
	savingErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AddOrUpdateReferencesFullStringSave

func (it *MapStringAnyCacheFile) AddOrUpdateReferencesFullStringSave(
	references ...ref.Value,
) (
	savingErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AddOrUpdateReferencesSave

func (it *MapStringAnyCacheFile) AddOrUpdateReferencesSave(
	references ...ref.Value,
) (
	savingErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AddOrUpdateSave

func (it *MapStringAnyCacheFile) AddOrUpdateSave(
	key string,
	val interface{},
) (savingErrWrap *errorwrapper.Wrapper)

func (*MapStringAnyCacheFile) AllKeys

func (it *MapStringAnyCacheFile) AllKeys() (
	allKeys []string,
	readErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) AllKeysSorted

func (it *MapStringAnyCacheFile) AllKeysSorted() (
	allKeysSorted []string,
	readErrWrap *errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) CoreMapAnyItems

func (it *MapStringAnyCacheFile) CoreMapAnyItems() (
	*coredynamic.MapAnyItems,
	*errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) EnumDynamicMap

func (it *MapStringAnyCacheFile) EnumDynamicMap() (
	enumimpl.DynamicMap,
	*errorwrapper.Wrapper,
)

func (*MapStringAnyCacheFile) GetValue

func (it *MapStringAnyCacheFile) GetValue(key string) (val interface{})

func (*MapStringAnyCacheFile) GetValueWithStat

func (it *MapStringAnyCacheFile) GetValueWithStat(key string) (val interface{}, isFound bool)

func (*MapStringAnyCacheFile) HasAllKey

func (it *MapStringAnyCacheFile) HasAllKey(
	keys ...string,
) bool

func (*MapStringAnyCacheFile) HasAnyItem

func (it *MapStringAnyCacheFile) HasAnyItem() bool

func (*MapStringAnyCacheFile) HasKey

func (it *MapStringAnyCacheFile) HasKey(key string) bool

func (*MapStringAnyCacheFile) IsAnyMissing

func (it *MapStringAnyCacheFile) IsAnyMissing(keys ...string) bool

func (*MapStringAnyCacheFile) IsEmpty

func (it *MapStringAnyCacheFile) IsEmpty() bool

func (*MapStringAnyCacheFile) IsFileIntegrityAlright

func (it *MapStringAnyCacheFile) IsFileIntegrityAlright() bool

func (*MapStringAnyCacheFile) IsMissing

func (it *MapStringAnyCacheFile) IsMissing(key string) bool

func (*MapStringAnyCacheFile) Length

func (it *MapStringAnyCacheFile) Length() int

func (*MapStringAnyCacheFile) Read

func (it *MapStringAnyCacheFile) Read() (map[string]interface{}, *errorwrapper.Wrapper)

func (*MapStringAnyCacheFile) SafeDynamicMap

func (it *MapStringAnyCacheFile) SafeDynamicMap() enumimpl.DynamicMap

func (*MapStringAnyCacheFile) SafeMapStringAny

func (it *MapStringAnyCacheFile) SafeMapStringAny() map[string]interface{}

func (*MapStringAnyCacheFile) SafeMayAnyItems

func (it *MapStringAnyCacheFile) SafeMayAnyItems() *coredynamic.MapAnyItems

func (*MapStringAnyCacheFile) Save

func (it *MapStringAnyCacheFile) Save(
	hashset map[string]bool,
) *errorwrapper.Wrapper

func (*MapStringAnyCacheFile) String

func (it *MapStringAnyCacheFile) String() string

func (*MapStringAnyCacheFile) Strings

func (it *MapStringAnyCacheFile) Strings() []string

type StringsCacheFile

type StringsCacheFile struct {
	CacheFile
	// contains filtered or unexported fields
}

func (*StringsCacheFile) AddOrUpdateMetaCollectionSave

func (it *StringsCacheFile) AddOrUpdateMetaCollectionSave(
	metaAttrCompiler loggerinf.MetaAttributesCompiler,
) (
	savingErrWrap *errorwrapper.Wrapper,
)

func (*StringsCacheFile) AppendLinesSave

func (it *StringsCacheFile) AppendLinesSave(
	items ...string,
) (savingErrWrap *errorwrapper.Wrapper)

func (*StringsCacheFile) AppendSave

func (it *StringsCacheFile) AppendSave(
	stringItems ...string,
) *errorwrapper.Wrapper

func (*StringsCacheFile) CoreHashset

func (it *StringsCacheFile) CoreHashset() (
	*corestr.Hashset,
	*errorwrapper.Wrapper,
)

func (*StringsCacheFile) EnumDynamicMap

func (it *StringsCacheFile) EnumDynamicMap() (
	enumimpl.DynamicMap,
	*errorwrapper.Wrapper,
)

func (*StringsCacheFile) GetSafeValueByIndex

func (it *StringsCacheFile) GetSafeValueByIndex(index int) (val string)

func (*StringsCacheFile) GetValueByIndex

func (it *StringsCacheFile) GetValueByIndex(index int) (val string)

func (*StringsCacheFile) HasAnyItem

func (it *StringsCacheFile) HasAnyItem() bool

func (*StringsCacheFile) IsEmpty

func (it *StringsCacheFile) IsEmpty() bool

func (*StringsCacheFile) IsFileIntegrityAlright

func (it *StringsCacheFile) IsFileIntegrityAlright() bool

func (*StringsCacheFile) Length

func (it *StringsCacheFile) Length() int

func (*StringsCacheFile) Read

func (it *StringsCacheFile) Read() ([]string, *errorwrapper.Wrapper)

func (*StringsCacheFile) SafeDynamicMap

func (it *StringsCacheFile) SafeDynamicMap() enumimpl.DynamicMap

func (*StringsCacheFile) SafeHashmap

func (it *StringsCacheFile) SafeHashmap() map[string]string

func (*StringsCacheFile) SafeHashset

func (it *StringsCacheFile) SafeHashset() map[string]bool

func (*StringsCacheFile) SafeMayAnyItems

func (it *StringsCacheFile) SafeMayAnyItems() *coredynamic.MapAnyItems

func (*StringsCacheFile) SafeStrings

func (it *StringsCacheFile) SafeStrings() []string

func (*StringsCacheFile) SafeStringsSorted

func (it *StringsCacheFile) SafeStringsSorted() (allKeysSorted []string)

func (*StringsCacheFile) Save

func (it *StringsCacheFile) Save(
	stringItems ...string,
) *errorwrapper.Wrapper

func (*StringsCacheFile) String

func (it *StringsCacheFile) String() string

func (*StringsCacheFile) Strings

func (it *StringsCacheFile) Strings() []string

func (*StringsCacheFile) StringsSorted

func (it *StringsCacheFile) StringsSorted() (
	allKeysSorted []string,
	readErrWrap *errorwrapper.Wrapper,
)

Jump to

Keyboard shortcuts

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