config

package
Version: v1.8.20 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: GPL-3.0 Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AMQP

type AMQP struct {
	//QueueName the name of the queue to connect to
	QueueName string
	//Queue is the configuration for the queue
	Queue Queue
	//Consume is the configuration of the consumer
	Consume Consume
	//Publish is the configuration for the publishing of messages
	Publish Publish

	Endpoint AMQPEndpoint
}

AMQP is the configuration for AMQP

type AMQPEndpoint

type AMQPEndpoint struct {
	QueueProtocol string `mapstructure:"queueProtocol"`
	QueueUser     string `mapstructure:"queueUser"`
	QueuePassword string `mapstructure:"queuePassword"`
	QueueHost     string `mapstructure:"queueHost"`
	QueuePort     int    `mapstructure:"queuePort"`
	QueueVHost    string `mapstructure:"queueVHost"`
}

AMQPEndpoint is the configuration needed to connect to a rabbitmq vhost

func GetAMQPEndpoint

func GetAMQPEndpoint() (AMQPEndpoint, error)

GetAMQPEndpoint gets AMQPEndpoint from the values in viper

type Config

type Config struct {
	MaxMessageRetries   int64  `mapstructure:"maxMessageRetries"`
	QueueMaxConcurrency int64  `mapstructure:"queueMaxConcurrency"`
	CompletionQueueName string `mapstructure:"completionQueueName"`
	CommandQueueName    string `mapstructure:"commandQueueName"`
	DockerCACertPath    string `mapstructure:"dockerCACertPath"`
	DockerCertPath      string `mapstructure:"dockerCertPath"`
	DockerKeyPath       string `mapstructure:"dockerKeyPath"`
	//LocalMode indicates that Genesis is operating in standalone mode
	LocalMode        bool              `mapstructure:"localMode"`
	VolumeDriver     string            `mapstructure:"volumeDriver"`
	VolumeDriverOpts map[string]string `mapstructure:"volumeDriverOpts"`
	Verbosity        string            `mapstructure:"verbosity"`
	Listen           string            `mapstructure:"listen"`
}

Config groups all of the global configuration parameters into a single struct

func NewConfig

func NewConfig() (*Config, error)

NewConfig creates a new config object from the global config

func (Config) CommandAMQP

func (c Config) CommandAMQP() (AMQP, error)

CommandAMQP gets the AMQP for the command queue

func (Config) CompletionAMQP

func (c Config) CompletionAMQP() (AMQP, error)

CompletionAMQP gets the AMQP for the completion queue

func (Config) GetDockerConfig

func (c Config) GetDockerConfig() entity.DockerConfig

GetDockerConfig extracts the fields of this object representing DockerConfig

func (Config) GetLogger

func (c Config) GetLogger() (*logrus.Logger, error)

GetLogger gets a logger according to the config

func (Config) GetRestConfig

func (c Config) GetRestConfig() entity.RestConfig

GetRestConfig extracts the fields of this object representing RestConfig

func (Config) GetVolumeConfig

func (c Config) GetVolumeConfig() command.VolumeConfig

GetVolumeConfig extracts the fields of this object representing VolumeConfig

type Consume

type Consume struct {
	//Consumer is the name of the consumer
	Consumer string `mapstructure:"consumer"`
	//AutoAck causes the server to acknowledge deliveries to this consumer prior to writing the delivery to the network
	AutoAck bool
	//Exclusive: when true, the server will ensure that this is the sole consumer from this queue
	//This should always be false.
	Exclusive bool
	//NoLocal is not supported by RabbitMQ
	NoLocal bool
	//NoWait: do not wait for the server to confirm the request and immediately begin deliveries
	NoWait bool `mapstructure:"consumerNoWait"`
	//Args contains addition arguments to be provided
	Args amqp.Table
}

Consume is the configuration of the consumer of messages from the queue

func GetConsume

func GetConsume() (Consume, error)

GetConsume gets Consume from the values in viper

type Publish

type Publish struct {
	Mandatory bool   `mapstructure:"publishMandatory"`
	Immediate bool   `mapstructure:"publishImmediate"`
	Exchange  string `mapstructure:"exchange"`
}

Publish is the configuration for the publishing of messages

func GetPublish

func GetPublish() (Publish, error)

GetPublish gets Publish from the values in viper

type Queue

type Queue struct {
	//Durable sets the queue to be persistent
	Durable bool `mapstructure:"queueDurable"`
	//AutoDelete tells the queue to drop messages if there are not any consumers
	AutoDelete bool `mapstructure:"queueAutoDelete"`
	//Exclusive queues are only accessible by the connection that declares them
	Exclusive bool
	//NoWait is true, the queue will assume to be declared on the server
	NoWait bool
	//Args contains addition arguments to be provided
	Args amqp.Table
}

Queue is the configuration of the queue to be created if the queue does not yet exist

func GetQueue

func GetQueue() (Queue, error)

GetQueue gets Queue from the values in viper

Source Files

Jump to

Keyboard shortcuts

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