amqphandler

package
v0.0.0-...-2b5bdcb Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNotConnected indicates AMQP client is not connected.
	ErrNotConnected = errors.New("not connected")
	// ErrSendChannelFull indicates AMQP send channel is full.
	ErrSendChannelFull = errors.New("send channel full")
)

Functions

This section is empty.

Types

type AmqpHandler

type AmqpHandler struct {
	sync.Mutex

	// MessageChannel channel for amqp messages
	MessageChannel chan Message
	// contains filtered or unexported fields
}

AmqpHandler structure with all amqp connection info.

func New

func New() (*AmqpHandler, error)

New creates new amqp object.

func (*AmqpHandler) Close

func (handler *AmqpHandler) Close()

Close closes all amqp connection.

func (*AmqpHandler) Connect

func (handler *AmqpHandler) Connect(cryptoContext CryptoContext, sdURL, systemID string, insecure bool) error

Connect connects to cloud.

func (*AmqpHandler) Disconnect

func (handler *AmqpHandler) Disconnect() error

Disconnect disconnects from cloud.

func (*AmqpHandler) SendAlerts

func (handler *AmqpHandler) SendAlerts(alerts cloudprotocol.Alerts) error

SendAlerts sends alerts message.

func (*AmqpHandler) SendInstallCertsConfirmation

func (handler *AmqpHandler) SendInstallCertsConfirmation(confirmations []cloudprotocol.InstallCertData) error

SendInstallCertsConfirmation sends install certificates confirmation.

func (*AmqpHandler) SendInstanceNewState

func (handler *AmqpHandler) SendInstanceNewState(newState cloudprotocol.NewState) error

SendServiceNewState sends new state message.

func (*AmqpHandler) SendInstanceStateRequest

func (handler *AmqpHandler) SendInstanceStateRequest(request cloudprotocol.StateRequest) error

SendServiceStateRequest sends state request message.

func (*AmqpHandler) SendIssueUnitCerts

func (handler *AmqpHandler) SendIssueUnitCerts(requests []cloudprotocol.IssueCertData) error

SendIssueUnitCerts sends request to issue new certificates.

func (*AmqpHandler) SendLog

func (handler *AmqpHandler) SendLog(serviceLog cloudprotocol.PushLog) error

SendLog sends system or service logs.

func (*AmqpHandler) SendMonitoringData

func (handler *AmqpHandler) SendMonitoringData(monitoringData cloudprotocol.Monitoring) error

SendMonitoringData sends monitoring data.

func (*AmqpHandler) SendOverrideEnvVarsStatus

func (handler *AmqpHandler) SendOverrideEnvVarsStatus(envs cloudprotocol.OverrideEnvVarsStatus) error

SendOverrideEnvVarsStatus overrides env vars status.

func (*AmqpHandler) SendUnitStatus

func (handler *AmqpHandler) SendUnitStatus(unitStatus cloudprotocol.UnitStatus) error

SendUnitStatus sends unit status.

func (*AmqpHandler) SubscribeForConnectionEvents

func (handler *AmqpHandler) SubscribeForConnectionEvents(consumer ConnectionEventsConsumer) error

SubscribeForConnectionEvents subscribes for connection events.

func (*AmqpHandler) UnsubscribeFromConnectionEvents

func (handler *AmqpHandler) UnsubscribeFromConnectionEvents(consumer ConnectionEventsConsumer) error

UnsubscribeFromConnectionEvents unsubscribes from connection events.

type ConnectionEventsConsumer

type ConnectionEventsConsumer interface {
	CloudConnected()
	CloudDisconnected()
}

ConnectionEventsConsumer connection events consumer interface.

type CryptoContext

type CryptoContext interface {
	GetTLSConfig() (*tls.Config, error)
	DecryptMetadata(input []byte) ([]byte, error)
}

CryptoContext interface to access crypto functions.

type Message

type Message interface{}

Message AMQP message.

Jump to

Keyboard shortcuts

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