Skip to content

Commit

Permalink
Merge branch 'master' into random-latency-for-sqs
Browse files Browse the repository at this point in the history
  • Loading branch information
p4tin committed Oct 15, 2019
2 parents bfccff2 + 9436ebb commit 8939f8d
Show file tree
Hide file tree
Showing 23 changed files with 538 additions and 283 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/pr-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: PR-Tests
on: [pull_request]
jobs:

build:
name: Build
runs-on: ubuntu-latest
steps:

- name: Set up Go 1.12
uses: actions/setup-go@v1
with:
go-version: 1.12
id: go

- name: Check out code into the Go module directory
uses: actions/checkout@v1

- name: Get dependencies
run: |
go get -v -t -d ./...
- name: Unit Tests
run: go test -cover -race ./app/...
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
.idea

dist/

vendor/
deployments/

Expand All @@ -10,4 +12,5 @@ goaws_linux_amd64

setenv.sh

.env

69 changes: 69 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# This is an example goreleaser.yaml file with some sane defaults.
# Make sure to check the documentation at http://goreleaser.com
# Before running goreleaser create a tag and push it:
# - git tag -a v0.2.0 -m "Adding Docker to the publish"
# - git push origin v0.2.0

before:
hooks:
# you may remove this if you don't use vgo
- go mod tidy
# you may remove this if you don't need go generate
# - go generate ./...
# go test all
# - go test -cover -race ./...
builds:
-
main: ./app/cmd/goaws.go
binary: goaws
env:
- CGO_ENABLED=0

goos:
- darwin
- linux
- windows

goarch:
- amd64
- arm
- arm64

goarm:
- 6
- 7

ignore:
- goos: darwin
goarch: 386
- goos: linux
goarch: arm
goarm: 7

dockers:
-
image_templates:
- "pafortin/goaws"
- "docker.io/pafortin/goaws:{{ .Tag }}"
- "docker.io/pafortin/goaws:latest"
extra_files:
- app/conf/goaws.yaml

archives:
- replacements:
darwin: Darwin
linux: Linux
windows: Windows
386: i386
amd64: x86_64
checksum:
name_template: 'checksums.txt'
snapshot:
name_template: "{{ .Tag }}-next"
changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^test:'

9 changes: 0 additions & 9 deletions .travis.yml

This file was deleted.

31 changes: 15 additions & 16 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
FROM golang:alpine as builder

WORKDIR /go/src/github.com/p4tin/goaws

RUN apk add --update --repository https://dl-3.alpinelinux.org/alpine/edge/testing/ git
RUN go get github.com/golang/dep/cmd/dep

COPY Gopkg.lock Gopkg.toml app ./
RUN dep ensure
COPY . .

RUN go build -o goaws_linux_amd64 app/cmd/goaws.go

#FROM golang:alpine as builder
#
#WORKDIR /go/src/github.com/p4tin/goaws
#
#RUN apk add --update --repository https://dl-3.alpinelinux.org/alpine/edge/testing/ git
#RUN go get github.com/golang/dep/cmd/dep
#
#COPY Gopkg.lock Gopkg.toml app ./
#RUN dep ensure
#COPY . .
#
#RUN go build -o goaws_linux_amd64 app/cmd/goaws.goc
FROM alpine

EXPOSE 4100

COPY --from=builder /go/src/github.com/p4tin/goaws/goaws_linux_amd64 /
COPY ./app/conf/goaws.yaml /conf/
ENTRYPOINT ["/goaws_linux_amd64"]
COPY goaws /
COPY app/conf/goaws.yaml /conf/
ENTRYPOINT ["/goaws"]
86 changes: 0 additions & 86 deletions Gopkg.lock

This file was deleted.

42 changes: 0 additions & 42 deletions Gopkg.toml

This file was deleted.

86 changes: 43 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,68 +102,68 @@ You can test that your installation is working correctly in one of two ways:
2. by using the AWS cli tools ([download link](http://docs.aws.amazon.com/cli/latest/userguide/installing.html)) here are some samples, you can refer to the [aws cli tools docs](http://docs.aws.amazon.com/cli/latest/reference/) for further information.

* aws --endpoint-url http://localhost:4100 sqs create-queue --queue-name test1
```
{
"QueueUrl": "http://localhost:4100/test1"
}
```json
{
"QueueUrl": "http://localhost:4100/test1"
}
```
* aws --endpoint-url http://localhost:4100 sqs list-queues
```
{
"QueueUrls": [
"http://localhost:4100/test1"
]
}
```json
{
"QueueUrls": [
"http://localhost:4100/test1"
]
}
```
* aws --endpoint-url http://localhost:4100 sqs send-message --queue-url http://localhost:4100/test1 --message-body "this is a test of the GoAws Queue messaging"
```
{
"MD5OfMessageBody": "9d3f5eaac3b1b4dd509f39e71e25f954",
"MD5OfMessageAttributes": "b095c6d16871105acb75d59332513337",
"MessageId": "66a1b4f5-cecf-473e-92b6-810156d41bbe"
}
```json
{
"MD5OfMessageBody": "9d3f5eaac3b1b4dd509f39e71e25f954",
"MD5OfMessageAttributes": "b095c6d16871105acb75d59332513337",
"MessageId": "66a1b4f5-cecf-473e-92b6-810156d41bbe"
}
```
* aws --endpoint-url http://localhost:4100 sqs receive-message --queue-url http://localhost:4100/test1
```
{
"Messages": [
{
"Body": "this is a test of the GoAws Queue messaging",
"MD5OfMessageAttributes": "b095c6d16871105acb75d59332513337",
"ReceiptHandle": "66a1b4f5-cecf-473e-92b6-810156d41bbe#f1fc455c-698e-442e-9747-f415bee5b461",
"MD5OfBody": "9d3f5eaac3b1b4dd509f39e71e25f954",
"MessageId": "66a1b4f5-cecf-473e-92b6-810156d41bbe"
}
]
}
```json
{
"Messages": [
{
"Body": "this is a test of the GoAws Queue messaging",
"MD5OfMessageAttributes": "b095c6d16871105acb75d59332513337",
"ReceiptHandle": "66a1b4f5-cecf-473e-92b6-810156d41bbe#f1fc455c-698e-442e-9747-f415bee5b461",
"MD5OfBody": "9d3f5eaac3b1b4dd509f39e71e25f954",
"MessageId": "66a1b4f5-cecf-473e-92b6-810156d41bbe"
}
]
}
```
* aws --endpoint-url http://localhost:4100 sqs delete-message --queue-url http://localhost:4100/test1 --receipt-handle 66a1b4f5-cecf-473e-92b6-810156d41bbe#f1fc455c-698e-442e-9747-f415bee5b461
```
No output
No output
```
* aws --endpoint-url http://localhost:4100 sqs receive-message --queue-url http://localhost:4100/test1
```
No output (No messages in Q)
No output (No messages in Q)
```
* aws --endpoint-url http://localhost:4100 sqs delete-queue --queue-url http://localhost:4100/test1
```
No output
No output
```
* aws --endpoint-url http://localhost:4100 sqs list-queues
```
No output (There are no Queues left)
No output (There are no Queues left)
```

* aws --endpoint-url http://localhost:4100 sns list-topics (Example Response from list-topics)
```
{
"Topics": [
{
"TopicArn": "arn:aws:sns:local:000000000000:topic1"
},
{
"TopicArn": "arn:aws:sns:local:000000000000:topic2"
}
]
}
```json
{
"Topics": [
{
"TopicArn": "arn:aws:sns:local:000000000000:topic1"
},
{
"TopicArn": "arn:aws:sns:local:000000000000:topic2"
}
]
}
```
Loading

0 comments on commit 8939f8d

Please sign in to comment.