Documentation ¶
Index ¶
- Constants
- Variables
- func CallerFileLine(up ...int) string
- func CallerFuncName(up ...int) string
- func ConnectionNameGenerator(options ...GeneratorOption) (nextConnName func() string)
- func ConsumerNameGenerator(queueName string, options ...GeneratorOption) (nextConsumerName func() string)
- func ExchangeNameGenerator(sessionName string, options ...GeneratorOption) (nextExchangeName func() string)
- func FileLine(up ...int) string
- func FilePath(relative string, up ...int) string
- func FuncName(up ...int) string
- func Jitter(min, max time.Duration) time.Duration
- func MessageGenerator(queueOrExchangeName string, options ...GeneratorOption) (nextMessage func() string)
- func NewConnectURLGenerator(excludePorts ...int) func() (proxyName, connectURL string, port int)
- func NewExchangeQueueGenerator(funcName string) func() ExchangeQueue
- func NewPortGenerator(excludePorts ...int) func() int
- func NextConnectURL() (proxyName, connectURL string, port int)
- func NextPort() int
- func PoolNameGenerator(funcName string, options ...GeneratorOption) (nextConnName func() string)
- func QueueNameGenerator(sessionName string, options ...GeneratorOption) (nextQueueName func() string)
- func RandInt() int
- func RandIntRange(min int, max int) int
- func RandIntWithPrefix(name string) string
- func RandString(strlen int) string
- func RandStringFromCharSet(strlen int, charSet string) string
- func RoutingKeyGenerator(sessionName string, options ...GeneratorOption) (nextRoutingKey func() string)
- func SessionNameGenerator(connectionName string, options ...GeneratorOption) (nextSessionName func() string)
- func VerifyLeak(m *testing.M)
- type ExchangeQueue
- type GeneratorOption
Constants ¶
View Source
const ( // CharSetAlphaNum is the alphanumeric character set for use with // RandStringFromCharSet CharSetAlphaNum = "abcdefghijklmnopqrstuvwxyz012346789" // CharSetAlpha is the alphabetical character set for use with // RandStringFromCharSet CharSetAlpha = "abcdefghijklmnopqrstuvwxyz" )
Variables ¶
View Source
var ( NumTests = 100 Upstream = "rabbitmq:5672" Username = "admin" Password = "password" Hostname = "localhost" ToxiProxyPort = 8474 BrokenPort = 5670 HealthyPort = 5671 ExcludedPorts = []int{BrokenPort, HealthyPort, ToxiProxyPort} BrokenConnectURL = fmt.Sprintf("amqp://%s:%s@%s:%d/", Username, Password, Hostname, BrokenPort) HealthyConnectURL = fmt.Sprintf("amqp://%s:%s@%s:%d/", Username, Password, Hostname, HealthyPort) )
Functions ¶
func CallerFileLine ¶
func CallerFuncName ¶
func ConnectionNameGenerator ¶
func ConnectionNameGenerator(options ...GeneratorOption) (nextConnName func() string)
func ConsumerNameGenerator ¶
func ConsumerNameGenerator(queueName string, options ...GeneratorOption) (nextConsumerName func() string)
func ExchangeNameGenerator ¶
func ExchangeNameGenerator(sessionName string, options ...GeneratorOption) (nextExchangeName func() string)
func MessageGenerator ¶
func MessageGenerator(queueOrExchangeName string, options ...GeneratorOption) (nextMessage func() string)
func NewConnectURLGenerator ¶
func NewExchangeQueueGenerator ¶
func NewExchangeQueueGenerator(funcName string) func() ExchangeQueue
func NewPortGenerator ¶
func NextConnectURL ¶
func PoolNameGenerator ¶
func PoolNameGenerator(funcName string, options ...GeneratorOption) (nextConnName func() string)
func QueueNameGenerator ¶
func QueueNameGenerator(sessionName string, options ...GeneratorOption) (nextQueueName func() string)
func RandIntRange ¶
RandIntRange returns a random integer between min (inclusive) and max (exclusive)
func RandIntWithPrefix ¶
RandIntWithPrefix is used to generate a unique name with a prefix
func RandString ¶
RandString generates a random alphanumeric string of the length specified
func RandStringFromCharSet ¶
RandStringFromCharSet generates a random string by selecting characters from the charset provided
func RoutingKeyGenerator ¶
func RoutingKeyGenerator(sessionName string, options ...GeneratorOption) (nextRoutingKey func() string)
func SessionNameGenerator ¶
func SessionNameGenerator(connectionName string, options ...GeneratorOption) (nextSessionName func() string)
func VerifyLeak ¶
Types ¶
type ExchangeQueue ¶
type ExchangeQueue struct { Exchange string Queue string RoutingKey string ConsumerTag string NextPubMsg func() string NextSubMsg func() string }
func NewExchangeQueue ¶
func NewExchangeQueue(exchange, queue, routingKey string) ExchangeQueue
type GeneratorOption ¶
type GeneratorOption func(*generatorOptions)
func WithPrefix ¶
func WithPrefix(prefix string) GeneratorOption
func WithRandomSuffix ¶
func WithRandomSuffix(addRandomSuffix bool) GeneratorOption
func WithSuffix ¶
func WithSuffix(suffix string) GeneratorOption
Click to show internal directories.
Click to hide internal directories.