config

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2023 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RabbitQueueBroker    = "RabbitMQ - Queue"
	RabbitExchangeBroker = "RabbitMQ - Exchange"
	NatsBroker           = "NATs"
	RedisBroker          = "Redis"
	GooglePubSubBroker   = "Google Pub/Sub"
)

Variables

This section is empty.

Functions

func GetFlags

func GetFlags(brokerType string) flags

GetFlags will parse the flags provided by the users input and return the results

Types

type Config

type Config struct {
	URL             string
	Broker          string
	BodyFileName    string
	HeadersFileName string
	Repeat          int
	RabbitCfg       *RabbitConfig
	NatsCfg         *NatsConfig
	RedisCfg        *RedisConfig
	GooglePubSubCfg *GooglePubSubConfig
}

Config contains all of the configuration required to send messages to a broker

func NewConfig

func NewConfig(brokerType string, flags flags) (*Config, error)

NewConfig will create and validate configuration based on the provided flags

func (Config) Destination added in v0.0.2

func (c Config) Destination() string

Destination will return where the message has been configured to be sent depending on the broker. Different brokers call this different things so the flags the users set are named after what a broker uses, and this will return that value

type GooglePubSubConfig added in v0.0.3

type GooglePubSubConfig struct {
	Topic       string
	ProjectID   string
	DisableAuth bool
}

GooglePubSubConfig contains config specifically for Google Pub/Sub

type NatsConfig

type NatsConfig struct {
	Subject string
}

NatsConfig contains config specifically for NATs

type RabbitConfig

type RabbitConfig struct {
	DestinationName string
}

RabbitConfig contains config specifically for RabbitMQ

type RedisConfig added in v0.0.2

type RedisConfig struct {
	Channel string
}

RedisConfig contains config specifically for Redis