Skip to content

Commit a71afa7

Browse files
committed
Remove last traces of handson and spirit
1 parent ffe793d commit a71afa7

File tree

9 files changed

+38
-53
lines changed

9 files changed

+38
-53
lines changed

Dockerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ FROM golang:1.7-alpine
66
RUN apk add -U make git
77

88
# set the go path to import the source project
9-
WORKDIR $GOPATH/src/github.com/Sfeir/handsongo
10-
ADD . $GOPATH/src/github.com/Sfeir/handsongo
9+
WORKDIR $GOPATH/src/github.com/Sfeir/golang-200
10+
ADD . $GOPATH/src/github.com/Sfeir/golang-200
1111

1212
# In one command-line (for reduce memory usage purposes),
1313
# we install the required software,
14-
# we build handsongo program
14+
# we build todolist program
1515
# we clean the system from all build dependencies
1616
RUN make all && apk del make git && \
1717
rm -rf /gopath/pkg && \

Godeps/Godeps.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Makefile for handsongo : Hands On Go
1+
# Makefile for Todolist : Go-200
22
# -----------------------------------------------------------------
33
#
44
# ENV VARIABLE
@@ -64,17 +64,17 @@ clean:
6464
@rm -Rf build
6565

6666
build: format
67-
@go build -v $(VERSION_FLAG) -o $(GO)/bin/handsongo handsongo.go
67+
@go build -v $(VERSION_FLAG) -o $(GO)/bin/todolist todolist.go
6868

6969
format:
7070
@go fmt $(PKGS)
7171

7272
teardownTest:
73-
@$(shell docker kill handsongo-mongo-test 2&>/dev/null 1&>/dev/null)
74-
@$(shell docker rm handsongo-mongo-test 2&>/dev/null 1&>/dev/null)
73+
@$(shell docker kill todolist-mongo-test 2&>/dev/null 1&>/dev/null)
74+
@$(shell docker rm todolist-mongo-test 2&>/dev/null 1&>/dev/null)
7575

7676
setupTest: teardownTest
77-
@docker run -d --name handsongo-mongo-test -p "27017:27017" mongo:3.3
77+
@docker run -d --name todolist-mongo-test -p "27017:27017" mongo:3.3
7878

7979
test: setupTest
8080
@export MONGODB_SRV=mongodb://$(DOCKER_IP)/tasks; go test -v $(PKGS); make teardownTest
@@ -95,20 +95,20 @@ lint:
9595
@go vet $(PKGS)
9696

9797
start:
98-
@handsongo -port 8020 -logl debug -logf text -statd 15s -db mongodb://$(DOCKER_IP)/tasks
98+
@todolist -port 8020 -logl debug -logf text -statd 15s -db mongodb://$(DOCKER_IP)/tasks
9999

100100
stop:
101-
@killall handsongo
101+
@killall todolist
102102

103103
# -----------------------------------------------------------------
104104
# Docker targets
105105
# -----------------------------------------------------------------
106106

107107
dockerBuild:
108-
docker build -t sfeir/handsongo:latest .
108+
docker build -t sfeir/todolist:latest .
109109

110110
dockerClean:
111-
docker rmi -f sfeir/handsongo:latest
111+
docker rmi -f sfeir/todolist:latest
112112

113113
dockerUp:
114114
docker-compose up -d
@@ -121,7 +121,7 @@ dockerStop:
121121
dockerBuildUp: dockerStop dockerBuild dockerUp
122122

123123
dockerWatch:
124-
@watch -n1 'docker ps | grep handsongo'
124+
@watch -n1 'docker ps | grep todolist'
125125

126126
dockerLogs:
127127
docker-compose logs -f

dao/task-dao-mock.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,11 @@ import (
77

88
// MockedTask is the task returned by this mocked interface
99
var MockedTask = model.Task{
10-
Name: "Caroni",
11-
Distiller: "Caroni",
12-
Bottler: "Velier",
13-
Country: "Trinidad",
14-
Composition: "Molasse",
15-
SpiritType: model.TypeRhum,
16-
Age: 15,
17-
BottlingDate: time.Date(2015, 01, 01, 0, 0, 0, 0, time.UTC),
18-
Score: 8.5,
19-
Comment: "heavy tire taste",
10+
Title: "Learn Go",
11+
Description: "Let's learn the Go programming language and how to use it in a real project to make great programs.",
12+
Status: model.StatusInProgress,
13+
Priority: model.PriorityHigh,
14+
CreationDate: time.Date(2017, 01, 01, 0, 0, 0, 0, time.UTC),
2015
}
2116

2217
// TaskDAOMock is the mocked implementation of the TaskDAO

dao/task-dao-mongo_test.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,11 @@ func TestDAOMongo(t *testing.T) {
1717
}
1818

1919
toSave := model.Task{
20-
Name: "Caroni 2000",
21-
Distiller: "Caroni",
22-
Bottler: "Velier",
23-
Country: "Trinidad",
24-
Composition: "Melasse",
25-
SpiritType: model.TypeRhum,
26-
Age: 15,
27-
BottlingDate: time.Date(2015, 01, 01, 0, 0, 0, 0, time.UTC),
28-
Score: 8.5,
29-
Comment: "heavy tire taste",
20+
Title: "Use Go",
21+
Description: "Let's use the Go programming language in a real project.",
22+
Status: model.StatusTodo,
23+
Priority: model.PriorityMedium,
24+
CreationDate: time.Date(2017, 02, 01, 0, 0, 0, 0, time.UTC),
3025
}
3126

3227
err = daoMongo.Save(&toSave)

docker-compose.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# handsongo micro-service
2-
handsongo:
3-
container_name: handsongo
4-
image: sfeir/handsongo:latest
1+
# todolist micro-service
2+
todolist:
3+
container_name: todolist
4+
image: sfeir/todolist:latest
55
restart: always
66
links:
77
- mongo
88
ports:
99
- "8020:8020"
10-
command: /go/bin/handsongo -port 8020 -logl debug -logf text -statd 15s -db mongodb://mongo/tasks
10+
command: /go/bin/todolist -port 8020 -logl debug -logf text -statd 15s -db mongodb://mongo/tasks
1111

1212
# bdd mockup
1313
mongo:
14-
container_name: handsongo-mongo
14+
container_name: todolist-mongo
1515
image: mongo:3.3
1616
restart: always
1717
ports:

etc/apiquery.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# File : apiquery.sh
33
#
44
# Goal :
5-
# query handsongo API
5+
# query todolist API
66
#
77
# History :
88
# 16/10/20 Creation (SFR)

todolist.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ var (
4343
func main() {
4444
// new app
4545
app := cli.NewApp()
46-
app.Name = "handsongo"
47-
app.Usage = "handsongo service launcher"
46+
app.Name = "todolist"
47+
app.Usage = "todolist service launcher"
4848

4949
timeStmp, err := strconv.Atoi(BuildStmp)
5050
if err != nil {

web/web_test.go

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -108,16 +108,11 @@ func BenchmarkTaskHandlerGet(t *testing.B) {
108108
}
109109

110110
expected := model.Task{
111-
Name: "Caroni",
112-
Distiller: "Caroni",
113-
Bottler: "Velier",
114-
Country: "Trinidad",
115-
Composition: "Molasse",
116-
SpiritType: model.TypeRhum,
117-
Age: 15,
118-
BottlingDate: time.Date(2015, 01, 01, 0, 0, 0, 0, time.UTC),
119-
Score: 8.5,
120-
Comment: "heavy tire taste",
111+
Title: "Learn Go",
112+
Description: "Let's learn the Go programming language and how to use it in a real project to make great programs.",
113+
Status: model.StatusInProgress,
114+
Priority: model.PriorityHigh,
115+
CreationDate: time.Date(2017, 01, 01, 0, 0, 0, 0, time.UTC),
121116
}
122117

123118
if expected != taskOut[0] {

0 commit comments

Comments
 (0)