cache

package
v0.0.0-...-c60c155 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2025 License: LGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Hash

func Hash(value string) string

func NewResourcesCacheManager

func NewResourcesCacheManager(strategy string, snowmanDirectoryPath string) error

Types

type ResourcesCacheManager

type ResourcesCacheManager struct {
	CacheStrategy string // "available", "never"

	StoredCacheHashes map[string]bool

	SnowmanDirectoryPath string
	// contains filtered or unexported fields
}
var CurrentResourcesCacheManager *ResourcesCacheManager

func (*ResourcesCacheManager) GetCache

func (cm *ResourcesCacheManager) GetCache(itemUrl string) (*os.File, error)

func (*ResourcesCacheManager) GetCacheItemByHostname

func (cm *ResourcesCacheManager) GetCacheItemByHostname(hostname string) ([]string, error)

TODO: we propebly need another one for induvidual items?

func (*ResourcesCacheManager) GetUnusedCacheHashes

func (cm *ResourcesCacheManager) GetUnusedCacheHashes() ([]string, error)

func (*ResourcesCacheManager) SetCache

func (cm *ResourcesCacheManager) SetCache(itemUrl string, content string) error

func (*ResourcesCacheManager) Teardown

func (cm *ResourcesCacheManager) Teardown() error

type SparqlCacheManager

type SparqlCacheManager struct {
	CacheStrategy string // "available", "never"

	StoredCacheHashes map[string]bool

	SnowmanDirectoryPath string
	// contains filtered or unexported fields
}

func NewSparqlCacheManager

func NewSparqlCacheManager(strategy string, snowmanDirectoryPath string) (*SparqlCacheManager, error)

func (*SparqlCacheManager) GetCache

func (cm *SparqlCacheManager) GetCache(location string, query string) (*os.File, error)

func (*SparqlCacheManager) GetCacheItemsByResourceAndArguments

func (cm *SparqlCacheManager) GetCacheItemsByResourceAndArguments(location string, arguments ...string) ([]string, error)

GetCacheItemsByResourceAndArguments returns a list of cache paths given a resource and arguments, like so: "myquery.rq", "arg1", "arg2" note that if only a location is provided, the resulting path might be a directory

func (*SparqlCacheManager) GetUnusedCacheHashes

func (cm *SparqlCacheManager) GetUnusedCacheHashes() ([]string, error)

func (*SparqlCacheManager) SetCache

func (cm *SparqlCacheManager) SetCache(location string, query string, content string) error

func (*SparqlCacheManager) Teardown

func (cm *SparqlCacheManager) Teardown() error

Jump to

Keyboard shortcuts

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