redis

package
v0.0.0-...-c53e812 Latest Latest
Warning

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

Go to latest
Published: May 14, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RedisNotificationList = "STONE-NOTIFICATIONS"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Address            string        `envconfig:"REDIS_ADDR" required:"true"`
	Port               string        `envconfig:"REDIS_PORT" required:"true"`
	Password           string        `envconfig:"REDIS_PASSWORD"`
	UseTLS             bool          `envconfig:"REDIS_USE_TLS" default:"false"`
	MaxIdle            int           `envconfig:"REDIS_MAX_IDLE" default:"100"`
	MaxActive          int           `envconfig:"REDIS_MAX_ACTIVE" default:"1000"`
	IdleTimeout        time.Duration `envconfig:"REDIS_IDLE_TIMEOUT" default:"1m"`
	DialConnectTimeout time.Duration `envconfig:"REDIS_CONNECT_TIMEOUT" default:"1s"`
	DialReadTimeout    time.Duration `envconfig:"REDIS_READ_TIMEOUT" default:"300ms"`
	DialWriteTimeout   time.Duration `envconfig:"REDIS_WRITE_TIMEOUT" default:"300ms"`
}

func (Config) Addr

func (c Config) Addr() string

func (Config) URL

func (c Config) URL() string

type Notification

type Notification struct {
	EventType string
	EventID   string
	Body      json.RawMessage
}

type RedisNotifier

type RedisNotifier struct {
	// contains filtered or unexported fields
}

func New

func New() *RedisNotifier

func (*RedisNotifier) Configure

func (n *RedisNotifier) Configure(log *logrus.Logger) error

func (RedisNotifier) Send

func (n RedisNotifier) Send(ctx context.Context, eventTypeHeader, eventIDHeader, body string) error

Jump to

Keyboard shortcuts

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