amqp

package
v0.3.8 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

View Source
const (
	TimeoutDefaultSecs   int = 60
	TimeoutInterruptSecs int = 60
	Poll                     = time.Duration(5) * time.Second
)

Variables

This section is empty.

Functions

func ClientStatusIn

func ClientStatusIn(status ClientStatus, statuses ...ClientStatus) bool

ClientStatusIn returns true if the given "status" is present in the status slice

Types

type AmqpClientCommon

type AmqpClientCommon struct {
	Context     framework.ContextData
	Name        string
	Url         string
	Timeout     int
	Params      []Param
	Pod         *v1.Pod
	TimedOut    bool
	Interrupted bool
	FinalResult *ResultData
	Mutex       sync.Mutex
}

Common partial implementation for Clients running in Pods/Containers Result() must be implemented by concrete client implementations

func (*AmqpClientCommon) Deploy

func (a *AmqpClientCommon) Deploy() error

func (*AmqpClientCommon) Interrupt

func (a *AmqpClientCommon) Interrupt()

func (*AmqpClientCommon) Running

func (a *AmqpClientCommon) Running() bool

func (*AmqpClientCommon) Status

func (a *AmqpClientCommon) Status() ClientStatus

func (*AmqpClientCommon) Wait

func (a *AmqpClientCommon) Wait() ClientStatus

Wait Waits for client to complete running (successfully or not), until pre-defined client's timeout.

func (*AmqpClientCommon) WaitFor

func (a *AmqpClientCommon) WaitFor(secs int) ClientStatus

WaitFor Waits for client to complete running (successfully or not), until given timeout.

func (*AmqpClientCommon) WaitForStatus

func (a *AmqpClientCommon) WaitForStatus(secs int, statuses ...ClientStatus) ClientStatus

WaitForStatus Waits till client status matches one of the given statuses or till it times out

type Client

type Client interface {
	Deploy() error
	Status() ClientStatus
	Running() bool
	Interrupt()
	Wait() ClientStatus
	Result() ResultData
}

type ClientStatus

type ClientStatus int
const (
	Starting ClientStatus = iota
	Running
	Success
	Error
	Timeout
	Interrupted
	Unknown
)

type Message

type Message struct {
	Address       string
	Content       string
	ContentSHA1   string
	Id            string
	CorrelationId string
	ReplyTo       string
	Expiration    int
	Priority      int
	Ttl           int
	UserId        string
}

type Param

type Param struct {
	Name, Value string
}

Data types for AMQP clients

type ResultData

type ResultData struct {
	Messages  []Message
	Delivered int
	Released  int
	Rejected  int
	Modified  int
	Accepted  int
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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