Documentation ¶
Index ¶
- type CacheService
- func (s *CacheService) Close() error
- func (s *CacheService) DB() interface{}
- func (s *CacheService) Get(ctx context.Context, aggregateID string, out *hippo.Aggregate) error
- func (s *CacheService) Link(conf Config) error
- func (s *CacheService) Set(ctx context.Context, aggregateID string, in *hippo.Aggregate) error
- type Config
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CacheService ¶
type CacheService struct {
// contains filtered or unexported fields
}
CacheService holds aggregates in Redis.
func NewCacheService ¶
func NewCacheService() *CacheService
NewCacheService creates a new CacheService
func (*CacheService) Close ¶
func (s *CacheService) Close() error
Close closes then underlying Redis database.
func (*CacheService) DB ¶ added in v0.4.0
func (s *CacheService) DB() interface{}
DB returns db connection
func (*CacheService) Get ¶
Get returns aggregate data for the respective aggregateID. State is unmarshaled to it's original form.
func (*CacheService) Link ¶
func (s *CacheService) Link(conf Config) error
Link connects and pings the Redis database.
type Config ¶
type Config struct { // Addr should be of the form "host:port", defaults to "localhost:6379" Addr string // Password is the Redis password, optional. Password string // Database to be used in Redis, defaults to 0 Database int }
Config represents a configuration to initialize a new Redis
Click to show internal directories.
Click to hide internal directories.