cache

package
v1.0.0-beta.100 Latest Latest
Warning

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

Go to latest
Published: May 17, 2023 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SetStatus     string = "set"
	DeletedStatus string = "deleted"
	CreatedStatus string = "created"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRunner

type BaseRunner struct {
	// contains filtered or unexported fields
}

func NewBaseRunner

func NewBaseRunner(encoder metadata.CacheEncoder, accessToken *types.AccessToken, cacheStore cache.Cache) *BaseRunner

type CreateCacheRunner

type CreateCacheRunner struct {
	*BaseRunner
	// contains filtered or unexported fields
}

func (*CreateCacheRunner) Run

type DelRunner

type DelRunner struct {
	*BaseRunner
	// contains filtered or unexported fields
}

func (*DelRunner) Run

func (runner *DelRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

type DeleteCacheRunner

type DeleteCacheRunner struct {
	*BaseRunner
	// contains filtered or unexported fields
}

func (*DeleteCacheRunner) Run

type GetRunner

type GetRunner struct {
	*BaseRunner
	// contains filtered or unexported fields
}

func (*GetRunner) Run

func (runner *GetRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

type GetSetRunner

type GetSetRunner struct {
	*BaseRunner
	// contains filtered or unexported fields
}

func (*GetSetRunner) Run

func (runner *GetSetRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

type KeysRunner

type KeysRunner struct {
	*BaseRunner
	// contains filtered or unexported fields
}

func (*KeysRunner) Run

func (runner *KeysRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

type ListCachesRunner

type ListCachesRunner struct {
	*BaseRunner
	// contains filtered or unexported fields
}

func (*ListCachesRunner) Run

type Response

type Response struct {
	api.Response
	Status       string
	Data         []byte
	OldValue     []byte
	Keys         []string
	DeletedCount int64
	Caches       []*api.CacheMetadata
	Cursor       uint64
}

Response is a wrapper on api.Response.

type Runner

type Runner interface {
	Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)
}

Runner is responsible for executing the current query and return the response.

type RunnerFactory

type RunnerFactory struct {
	// contains filtered or unexported fields
}

func NewRunnerFactory

func NewRunnerFactory(encoder metadata.CacheEncoder, cacheStore cache.Cache) *RunnerFactory

NewRunnerFactory returns RunnerFactory object.

func (*RunnerFactory) GetCreateCacheRunner

func (f *RunnerFactory) GetCreateCacheRunner(r *api.CreateCacheRequest, accessToken *types.AccessToken) *CreateCacheRunner

func (*RunnerFactory) GetDelRunner

func (f *RunnerFactory) GetDelRunner(r *api.DelRequest, accessToken *types.AccessToken) *DelRunner

func (*RunnerFactory) GetDeleteCacheRunner

func (f *RunnerFactory) GetDeleteCacheRunner(r *api.DeleteCacheRequest, accessToken *types.AccessToken) *DeleteCacheRunner

func (*RunnerFactory) GetGetRunner

func (f *RunnerFactory) GetGetRunner(r *api.GetRequest, accessToken *types.AccessToken) *GetRunner

func (*RunnerFactory) GetGetSetRunner

func (f *RunnerFactory) GetGetSetRunner(r *api.GetSetRequest, accessToken *types.AccessToken) *GetSetRunner

func (*RunnerFactory) GetKeysRunner

func (f *RunnerFactory) GetKeysRunner(r *api.KeysRequest, accessToken *types.AccessToken, streaming StreamingKeys) *KeysRunner

func (*RunnerFactory) GetListCachesRunner

func (f *RunnerFactory) GetListCachesRunner(r *api.ListCachesRequest, accessToken *types.AccessToken) *ListCachesRunner

func (*RunnerFactory) GetSetRunner

func (f *RunnerFactory) GetSetRunner(r *api.SetRequest, accessToken *types.AccessToken) *SetRunner

type Session

type Session interface {
	// Execute executes the request using the query runner
	Execute(ctx context.Context, runner Runner) (Response, error)

	// TxExecute executes in a fdb transaction.
	// Metadata of caches are stored in fdb as part of project metadata and that modification is a transactional operation.
	TxExecute(ctx context.Context, runner TxRunner) (Response, error)
}

type SessionManager

type SessionManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewSessionManager

func NewSessionManager(txMgr *transaction.Manager, tenantMgr *metadata.TenantManager, tenantTracker *metadata.CacheTracker) *SessionManager

func (*SessionManager) Execute

func (sessMgr *SessionManager) Execute(ctx context.Context, runner Runner) (Response, error)

func (*SessionManager) TxExecute

func (sessMgr *SessionManager) TxExecute(ctx context.Context, runner TxRunner) (Response, error)

type SetRunner

type SetRunner struct {
	*BaseRunner
	// contains filtered or unexported fields
}

func (*SetRunner) Run

func (runner *SetRunner) Run(ctx context.Context, tenant *metadata.Tenant) (Response, error)

type StreamingKeys

type StreamingKeys interface {
	api.Cache_KeysServer
}

StreamingKeys is a wrapper interface for passing around for streaming cache keys.

type TxRunner

type TxRunner interface {
	Run(ctx context.Context, tx transaction.Tx, tenant *metadata.Tenant) (Response, context.Context, error)
}

TxRunner is responsible for executing the current query and return the response.

Jump to

Keyboard shortcuts

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