The project has been officially released, welcome to use!
starter-redigo provides a Redis client wrapper based on redigo,
making it easy to integrate and use Redis in Go-Spring applications.
go get github.com/go-spring/starter-redigoRefer to the example.go file.
import _ "github.com/go-spring/starter-redigo"Add Redis configuration in your project’s configuration file, for example:
spring.redigo.main.addr=127.0.0.1:6379Refer to the example.go file.
import "github.com/gomodule/redigo/redis"
type Service struct {
    Redis *redis.Client `autowire:""`
}Refer to the example.go file.
str, err := s.Redis.Get(r.Context(), "key").Result()
str, err := s.Redis.Set(r.Context(), "key", "value", 0).Result()- Supports multiple Redis instances: You can define multiple Redis instances in the configuration file and reference them by name in your project.
- Support Redis extensions: You can extend Redis functionality by implementing the Driverinterface — see the example implementationAnotherRedisDriver.