Skip to content

gradientzero/comby-store-redis

Repository files navigation

comby-store-redis

Simple implementation of the CacheStore interface defined in comby with Redis. comby is a powerful application framework designed with Event Sourcing and Command Query Responsibility Segregation (CQRS) principles, written in Go.

License

Prerequisites

# run redis server locally for testings
docker run -d --name redis-stack-server -p 6379:6379 redis/redis-stack-server:latest

Installation

comby-store-redis supports the latest version of comby (v2), requires Go version 1.22+ and is based on Redis client v9.0.0.

go get github.com/gradientzero/comby-store-redis

Quickstart

import (
	"github.com/gradientzero/comby-store-redis"
	"github.com/gradientzero/comby/v2"
)

// create redis CacheStore
cacheStore := store.NewCacheStoreRedis("localhost:6379", "", 0)
if err = cacheStore.Init(ctx,
    comby.CacheStoreOptionWithAttribute("anyKey", "anyValue"),
); err != nil {
    panic(err)
}

// create Facade
fc, _ := comby.NewFacade(
  comby.FacadeWithCacheStore(cacheStore),
)

Tests

go test -v ./...

Contributing

Please follow the guidelines in CONTRIBUTING.md.

License

This project is licensed under the MIT License.

Contact

https://www.gradient0.com

About

Simple comby CacheStore implementation with Redis

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages