-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
310 additions
and
299 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
vendor | ||
coverage.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
FROM golang:1.9.3-alpine | ||
# DeGOps 0.0.4 | ||
|
||
# NOTE: added apk for CGO too. | ||
RUN apk --update --no-cache add curl bash git alpine-sdk util-linux gcc musl-dev | ||
# Install glide | ||
RUN curl https://glide.sh/get | sh | ||
|
||
WORKDIR /go/src |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
|
||
help: | ||
@echo "Go CI 0.0.4:" | ||
@echo "Available commands:" | ||
@echo "\tmake install Install dependencies." | ||
@echo "\tmake run Run default command." | ||
@echo "\tmake test Run tests." | ||
@echo "\tmake coverage Show coverage in html." | ||
@echo "\tmake clean Clean build files." | ||
|
||
install: | ||
@echo "Make: Install" | ||
./scripts/install.sh | ||
|
||
run: | ||
@echo "Make: Run" | ||
./scripts/run.sh | ||
|
||
.PHONY: test | ||
test: | ||
@echo "Make: Test" | ||
./scripts/test.sh | ||
|
||
coverage: | ||
@echo "Make: Coverage" | ||
./scripts/cover.sh | ||
|
||
clean: | ||
@echo "Make: Clean" | ||
./scripts/clean.sh | ||
|
||
|
||
## Container related commands. | ||
|
||
container-install: | ||
@echo "Make: Install" | ||
./container/install.sh | ||
|
||
.PHONY: test | ||
container-test: | ||
@echo "Make: Test" | ||
./container/test.sh | ||
|
||
container-coverage: | ||
@echo "Make: Coverage" | ||
./container/cover.sh | ||
|
||
container-clean: | ||
@echo "Make: Clean" | ||
./container/clean.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
// Package main contains Nexmo SMS example usage. | ||
package main | ||
|
||
import ( | ||
"encoding/json" | ||
"flag" | ||
"log" | ||
"time" | ||
|
||
"github.com/jimmy-go/nexmo" | ||
"github.com/jimmy-go/nexmo/sms" | ||
) | ||
|
||
func main() { | ||
key := flag.String("api-key", "", "Nexmo API KEY.") | ||
secret := flag.String("api-secret", "", "Nexmo API SECRET.") | ||
to := flag.String("to", "", "Nexmo phone destination.") | ||
from := flag.String("from", "", "Your Nexmo phone number.") | ||
text := flag.String("text", "", "SMS message content.") | ||
flag.Parse() | ||
log.SetFlags(log.Lshortfile) | ||
|
||
nclient, err := nexmo.New(*key, *secret, time.Second) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
// new SMS with only required parameters. | ||
// msg := nexmo.NewSMS(*to, *from, *text) | ||
|
||
// complete sms usage. | ||
// see: https://docs.nexmo.com/messaging/sms-api/api-reference#request | ||
msg := &sms.Request{ | ||
From: *from, | ||
To: *to, | ||
Type: "", | ||
Text: *text, | ||
StatusReport: "", | ||
ClientRef: "", | ||
Vcard: "", | ||
Vcal: "", | ||
} | ||
resp, err := nclient.SMS(msg) | ||
if err != nil { | ||
panic(err) | ||
} | ||
|
||
log.Printf("SMS : response [%v]", marshal(resp)) | ||
} | ||
|
||
func marshal(v interface{}) string { | ||
b, _ := json.MarshalIndent(v, "", " ") | ||
return string(b) | ||
} |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
// Package call contains Nexmo Call Request and Response. | ||
// | ||
// see: https://docs.nexmo.com/voice/call | ||
package call | ||
|
||
// Request Nexmo TextToSpeech request. | ||
// | ||
// see: https://docs.nexmo.com/voice/call/request | ||
type Request struct { | ||
To string `url:"to"` | ||
AnswerURL string `url:"answer_url"` | ||
From string `url:"from"` | ||
MachineDetection string `url:"machine_detection"` | ||
MachineTimeout string `url:"machine_timeout"` | ||
AnswerMethod string `url:"answer_method"` | ||
ErrorURL string `url:"error_url"` | ||
ErrorMethod string `url:"error_method"` | ||
StatusURL string `url:"status_url"` | ||
StatusMethod string `url:"status_method"` | ||
} | ||
|
||
// Response Nexmo TextToSpeech response. | ||
// | ||
// see: https://docs.nexmo.com/voice/call/response | ||
type Response struct { | ||
CallID string `json:"call-id"` | ||
To string `json:"to"` | ||
Status int `json:"status"` | ||
ErrorText string `json:"error-text"` | ||
} |
This file was deleted.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.