Skip to content

getconversio/go-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-utils

A collection of utilities function for Go used across Conversio. No reason this can't be open source right? :-)

Build Status codecov

Usage

import "github.com/getconversio/go-utils/services/amqp"

func StartListening() {
	amqp.HandleFunc(
		"myqueue",     // Queue name
		"myexchange",  // Exchange name
		"myrouting",   // Routing key
		new(mystruct),
		func(msg interface{}, headers aq.Table) error {
			doSomething(*msg.(*mystruct))
			return nil
		})
}

Testing

Basic testing:

$ docker-compose run --rm dev

Testing the package is the default command for the dev container. To create a coverage profile:

$ docker-compose run --rm dev ./test.sh cover