cacheStorage

package module
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2024 License: Apache-2.0 Imports: 2 Imported by: 5

README

README

This README would normally document whatever steps are necessary to get your application up and running.

What is this repository for?
How do I get set up?
  • Summary of set up
  • Configuration
  • Dependencies
  • Database configuration
  • How to run tests
  • Deployment instructions
Contribution guidelines
  • Writing tests
  • Code review
  • Other guidelines
Who do I talk to?
  • Repo owner or admin
  • Other community or team contact

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CacheStorage

type CacheStorage interface {
	Connect(c context.Context, host, userName, userPw, database string) error
	Close(context.Context) error
	GetCacheStorageClient() (CacheStorageGetter, CacheStorageSetter)
}

type CacheStorageError

type CacheStorageError interface {
	IsNotFound() bool
	IsInvalidDestType() bool
	Error() string
}

type CacheStorageGetter

type CacheStorageGetter interface {
	GetById(c context.Context, collectionName string, id string, ver string, dest interface{}) CacheStorageError
	GetManyByIds(c context.Context, collectionName string, ids []string, ver string, dest interface{}) CacheStorageError
	GetAll(c context.Context, collectionName string, ver string, dest interface{}) CacheStorageError
	GetLatestVersions(c context.Context) ([]CacheVersion, CacheStorageError)
	GetLatestCollectionVersion(c context.Context, collection string) (CacheVersion, CacheStorageError)

	/*TODO: move to persistent storage*/
	GetArrayBySingleId(c context.Context, collectionName string, id string, ver string, dest interface{}) CacheStorageError
}

type CacheStorageGetterMiddleware

type CacheStorageGetterMiddleware func(cacheStorageGetter CacheStorageGetter) CacheStorageGetter

type CacheStorageGetterWrapper

type CacheStorageGetterWrapper interface {
	CacheStorageGetter
}

type CacheStorageSetter

type CacheStorageSetter interface {
	Insert(c context.Context, collectionName string, id string, ver string, item interface{}) CacheStorageError
	InsertMany(c context.Context, collectionName string, ver string, items map[string]interface{}) CacheStorageError
	InsertOrUpdate(c context.Context, collectionName string, id string, ver string, item interface{}) CacheStorageError
	Update(c context.Context, collectionName string, id string, ver string, item interface{}) CacheStorageError
	Remove(c context.Context, collectionName string, id string, ver string) CacheStorageError
	RemoveAll(c context.Context, collectionName string, ver string) CacheStorageError

	/*TODO: move to persistent storage*/
	GetAndLockById(c context.Context, collectionName string, id string, dest interface{}) CacheStorageError
	ReleaseLockedById(c context.Context, collectionName string, id string) CacheStorageError
}

type CacheStorageSetterMiddleware

type CacheStorageSetterMiddleware func(setter CacheStorageSetter) CacheStorageSetter

type CacheStorageSetterWrapper

type CacheStorageSetterWrapper interface {
	CacheStorageSetter
}

type CacheVersion

type CacheVersion struct {
	CollectionName  string
	Versions        []Version
	LockVersionUpon []string
	CacheType       string
}

type Version

type Version struct {
	Version string
	TimedTo time.Time
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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