redisboot

package
v0.0.0-...-3c51467 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Redis

type Redis struct {
	Client *redis.Client
	// contains filtered or unexported fields
}

Redis implements the AppService interface.

func (*Redis) Close

func (s *Redis) Close() error

Close is run right before shutdown. The app waits until close resolves.

func (*Redis) Configure

func (s *Redis) Configure(env *goboot.AppEnv) error

func (*Redis) Init

func (s *Redis) Init() error

Init implements the AppService interface.

func (*Redis) Name

func (s *Redis) Name() string

type RedisConfig

type RedisConfig struct {
	// Url contains hostname:port, e.g. localhost:6379
	URL string `yaml:"url"`

	// Password if left empty uses no empty
	Password string `yaml:"password"`

	// DB defaults to db 0
	DB int `yaml:"db"`

	// Maximum number of socket connections.
	// Default is 10 connections per every CPU as reported by runtime.NumCPU.
	PoolSize int `yaml:"poolSize"`

	// Dial timeout for establishing new connections. Default is 5 seconds.
	DialTimeout time.Duration `yaml:"dialTimeout"`

	// Number of retries upon initial connect. Default is 5 times. Set -1 to disable
	ConnectMaxRetries int `yaml:"connectMaxRetries"`

	// Time between retries for initial connect attempts. Default is 5 seconds.
	ConnectRetryDuration time.Duration `yaml:"connectRetryDuration"`
}

Jump to

Keyboard shortcuts

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