https://github.com/getconversio/go-utils
A collection of utility functionality for Go
https://github.com/getconversio/go-utils
amqp bigquery geoip golang logrus openexchangerates utilities
Last synced: 4 months ago
JSON representation
A collection of utility functionality for Go
- Host: GitHub
- URL: https://github.com/getconversio/go-utils
- Owner: getconversio
- License: mit
- Created: 2017-04-04T14:45:06.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-11-23T09:25:19.000Z (about 8 years ago)
- Last Synced: 2024-06-20T14:29:10.167Z (over 1 year ago)
- Topics: amqp, bigquery, geoip, golang, logrus, openexchangerates, utilities
- Language: Go
- Homepage:
- Size: 38.1 KB
- Stars: 1
- Watchers: 17
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-utils
A collection of utilities function for Go used across Conversio. No reason this
can't be open source right? :-)
[](https://travis-ci.org/getconversio/go-utils)
[](https://codecov.io/gh/getconversio/go-utils)
## Usage
```go
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