Documentation ¶
Overview ¶
Package redis provides cache service by redis (cloud memorystore).
Index ¶
Constants ¶
View Source
const ( DefaultMaxIdleConns = 50 DefaultMaxActiveConns = 200 )
default max number of connections. note: in GCP, redis quota is 65,000
Variables ¶
This section is empty.
Functions ¶
func AddrFromEnv ¶
AddrFromEnv returns redis server address from environment variables.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is cache service client for redis.
type FakeServer ¶ added in v0.0.17
type FakeServer struct {
// contains filtered or unexported fields
}
FakeServer is a fake redis server for stress test.
func NewFakeServer ¶ added in v0.0.17
func NewFakeServer(tb testing.TB) *FakeServer
NewFakeServer starts a new fake redis server.
func (*FakeServer) Addr ¶ added in v0.0.17
func (s *FakeServer) Addr() net.Addr
Addr returns address of the fake redis server.
func (*FakeServer) Close ¶ added in v0.0.17
func (s *FakeServer) Close()
Close shuts down the fake redis server.
type Opts ¶ added in v0.0.17
type Opts struct { // Prefix is key prefix used by the client. Prefix string // MaxIdleConns is max number of idle connections. MaxIdleConns int // MaxActiveConns is max number of active connections. MaxActiveConns int // EntryTTL sets the expiration time of an entry, 0 means entry will never expire. EntryTTL time.Duration }
Opts is redis client option.
Click to show internal directories.
Click to hide internal directories.