rabbitmq

package
v0.0.0-...-6d50071 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ExchangeAddRepo    = "add.repository.fx"
	ExchangeDelRepo    = "del.repository.fx"
	ExchangeUpdateRepo = "update.repository.fx"
)

Exchanges

Variables

This section is empty.

Functions

This section is empty.

Types

type HandlerDeleteRepoQueue

type HandlerDeleteRepoQueue func(string) error

HandlerDeleteRepoQueue func

type HandlerInstall

type HandlerInstall func(Install) error

HandlerInstall func

type HandlerRepo

type HandlerRepo func(model.Repository) error

HandlerRepo func that handles with msg RepositoriesQueue

type HandlerUpdateRepoQueue

type HandlerUpdateRepoQueue func() error

HandlerUpdateRepoQueue func

type Install

type Install struct {
	UpgradeRequest helmapi.UpgradeRequest `json:"upgradeRequest"`
	Name           string                 `json:"name"`
	Token          string                 `json:"token"`
	Filename       string                 `json:"filename"`
	CACertificate  string                 `json:"ca_certificate"`
	ClusterURI     string                 `json:"cluster_uri"`
	Namespace      string                 `json:"namespace"`
	DeploymentID   uint                   `json:"deployment_id"`
}

Install consumer

type Queues

type Queues struct {
	InstallQueue       string
	ResultInstallQueue string
	AddRepoQueue       string
	DeleteRepoQueue    string
	UpdateRepoQueue    string
}

Queues struct

type RabbitImpl

type RabbitImpl struct {
	Conn    *amqp.Connection
	Channel *amqp.Channel
	Queues  Queues
}

RabbitImpl struct

func InitRabbit

func InitRabbit(uri string, queues Queues) (RabbitImpl, error)

InitRabbit func

func (RabbitImpl) Bind

func (rabbit RabbitImpl) Bind(queueName, routingKey, exchange string) error

Bind func

func (RabbitImpl) ConsumeDeleteRepoQueue

func (rabbit RabbitImpl) ConsumeDeleteRepoQueue(fn HandlerDeleteRepoQueue) error

ConsumeDeleteRepoQueue func

func (RabbitImpl) ConsumeInstallQueue

func (rabbit RabbitImpl) ConsumeInstallQueue(fn HandlerInstall, install Install) error

ConsumeInstallQueue func

func (RabbitImpl) ConsumeRepoQueue

func (rabbit RabbitImpl) ConsumeRepoQueue(fn HandlerRepo, repo model.Repository) error

ConsumeRepoQueue func

func (RabbitImpl) ConsumeUpdateRepoQueue

func (rabbit RabbitImpl) ConsumeUpdateRepoQueue(fn HandlerUpdateRepoQueue) error

ConsumeUpdateRepoQueue func

func (RabbitImpl) CreateFanoutExchange

func (rabbit RabbitImpl) CreateFanoutExchange(name string) error

CreateFanoutExchange func

func (RabbitImpl) CreateQueue

func (rabbit RabbitImpl) CreateQueue(queueName string, exclusive bool) error

CreateQueue func

func (RabbitImpl) GetChannel

func (rabbit RabbitImpl) GetChannel() *amqp.Channel

GetChannel with rabbitMQ Server

func (RabbitImpl) GetConnection

func (rabbit RabbitImpl) GetConnection(uri string) *amqp.Connection

GetConnection to the RabbitMQ Server

func (RabbitImpl) GetConsumer

func (rabbit RabbitImpl) GetConsumer(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)

GetConsumer queue

func (RabbitImpl) Publish

func (rabbit RabbitImpl) Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error

Publish a message on queue

type RabbitInterface

type RabbitInterface interface {
	GetConnection(uri string) *amqp.Connection
	GetChannel() *amqp.Channel
	Publish(exchange, key string, mandatory, immediate bool, msg amqp.Publishing) error
	GetConsumer(queue, consumer string, autoAck, exclusive, noLocal, noWait bool, args amqp.Table) (<-chan amqp.Delivery, error)
	CreateQueue(queueName string, exclusive bool) error
	CreateFanoutExchange(name string) error
	Bind(queueName, routingKey, exchange string) error
	ConsumeRepoQueue(fn HandlerRepo, repo model.Repository) error
	ConsumeInstallQueue(fn HandlerInstall, install Install) error
	ConsumeDeleteRepoQueue(fn HandlerDeleteRepoQueue) error
	ConsumeUpdateRepoQueue(fn HandlerUpdateRepoQueue) error
}

RabbitInterface interface

type RabbitPayloadProducer

type RabbitPayloadProducer struct {
	Success      bool   `json:"sucess"`
	Error        string `json:"error"`
	DeploymentID uint   `json:"deployment_id"`
}

RabbitPayloadProducer producer

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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