config

package
v0.0.0-...-48849e1 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// RequestQueueKey specifies the redis key that will be used for the request queue.
	RequestQueueKey = "gocrypt:RequestQueue"
	// ResponseKeyPrefix specifies the redis key prefix that will be used for response publishing.
	ResponseKeyPrefix = "gocrypt:Response:"
	// ErrorRetryTime specifies how long to wait before retrying when there's a redis read error.
	ErrorRetryTime = 1 * time.Second
	// ConnectionTimeout specifies the timeout for the redis connection. Must be longer than the PopTimeout.
	ConnectionTimeout = 60 * time.Second
	// PopTimeout specifies the connection timeout for the blocking queue pop. This could be arbitrarily long, but you
	// have to set a limit so I reckon 10 seconds is reasonable.
	PopTimeout = 10
	// PublishAttempts specifies the maximum amount of times that the response publish will be retried if something
	// goes wrong. Some tests rely on this being at least 3, so expect some failures if this is dropped below 3.
	PublishAttempts = 5
	// MinResponseKeyLength specifies the minimum length for the response key.
	// 16 is a decent length to be relatively sure you won't have collisions,
	// and is also the length of a UUID in binary representation.
	// Our client uses test UUIDs with a timestamp which will be well over 40 characters,
	// but there's no need to enforce that level of security on the agent-side.
	MinResponseKeyLength = 16
)
View Source
const (
	VerboseLogging = true
	UTCLogging     = false
)

Variables

View Source
var (
	// RedisHost specifies the host and port for the redis server.
	RedisHost string
	// RedisTLS specifies if the redis connection should use TLS.
	RedisTLS bool
	// RedisUsername specifies the username to use for redis auth.
	RedisUsername string
	// RedisPassword specifies the password to use for redis auth.
	RedisPassword string
	// Threads specifies how many worker threads should be started.
	Threads int
	// Durable makes the service infinitely attempt retries whenever possible, instead of exiting on failures.
	Durable = false
)

Functions

func ReadEnvironment

func ReadEnvironment()

ReadEnvironment gets the environment variables and initialises the config variables

Types

This section is empty.

Jump to

Keyboard shortcuts

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