cache

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AllProviderNames = []ProviderName{REDIS}

Functions

This section is empty.

Types

type CacheProvider added in v0.11.0

type CacheProvider interface {
	Get(ctx context.Context, ref *stategate.CacheRef) (*stategate.Cache, *errorz.Error)
	Set(ctx context.Context, value *stategate.Cache) *errorz.Error
	Del(ctx context.Context, value *stategate.CacheRef) *errorz.Error
}

CacheProvider acts as dependency injection for caching ephemeral data

type ChannelProvider added in v0.11.0

type ChannelProvider interface {
	PublishEvent(ctx context.Context, event *stategate.Event) *errorz.Error
	GetEventChannel(ctx context.Context) (chan *stategate.Event, *errorz.Error)
	PublishMessage(ctx context.Context, message *stategate.PeerMessage) *errorz.Error
	GetMessageChannel(ctx context.Context) (chan *stategate.PeerMessage, *errorz.Error)
}

ChannelProvider acts as dependency injection for broadcasting messages to stategate instances as they fan out

type MutexProvider added in v0.11.0

type MutexProvider interface {
	Lock(ctx context.Context, ref *stategate.Mutex) *errorz.Error
	Unlock(ctx context.Context, value *stategate.MutexRef) *errorz.Error
}

MutexProvider acts as dependency injection for distributed mutex operations

type Provider

type Provider interface {
	CacheProvider
	ChannelProvider
	MutexProvider
	Close() error
}

Provider is a channel, cache, & mutex provider

func GetCacheProvider

func GetCacheProvider(lgger *logger.Logger, providerConfig map[string]string) (Provider, error)

type ProviderName

type ProviderName string
const (
	REDIS ProviderName = "redis"
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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