pubsubfactory

package
v0.0.0-...-d33996c Latest Latest
Warning

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

Go to latest
Published: May 30, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFromConfig

func NewFromConfig(cfg *Config) (pubsub.PubSub, error)

func NewFromString

func NewFromString(text string) (pubsub.PubSub, error)

Types

type Config

type Config struct {
	Type string `envconfig:"TYPE" json:"type"`

	InMem InMemConfig `envconfig:"INMEM" json:"inmem"`
	Redis RedisConfig `envconfig:"REDIS" json:"redis"`
}

func ParseConfig

func ParseConfig(text string) (*Config, error)

type InMemConfig

type InMemConfig struct {
	QueueSize int `envconfig:"QUEUE_SIZE" json:"queue_size"`
}

type RedisConfig

type RedisConfig struct {
	Address string `envconfig:"ADDRESS" default:"127.0.0.1:6379" json:"address"`
}

Jump to

Keyboard shortcuts

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