Skip to content
This repository was archived by the owner on Apr 15, 2021. It is now read-only.

Commit 0d2bb94

Browse files
author
Julien LEICHER
committed
refacto: v2 on its way!
1 parent 8cdbb62 commit 0d2bb94

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1314
-980
lines changed

.gitignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
.vscode
1+
.vscode
2+
coverage.txt

.travis.yml

+10-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
language: go
22

33
go:
4-
- master
4+
- master
5+
6+
before_install:
7+
- go get -t -v ./...
8+
9+
script:
10+
- go test ./... -coverprofile=coverage.txt -covermode=atomic
11+
12+
after_success:
13+
- bash <(curl -s https://codecov.io/bash)

Procfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
web: bin/cran
1+
web: bin/cran-web

README.md

+11-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
Compte Rendu de l'Assemblée Nationale ✨
1+
Compte Rendu de l'Assemblée Nationale ✨ [![Build Status](https://travis-ci.org/YuukanOO/cran.svg?branch=master)](https://travis-ci.org/YuukanOO/cran)
22
===
33

44
Récemment, je me suis retrouvé à lire un compte rendu sur le site de l'assemblée nationale. J'ai trouvé la mise en page peu adaptée au contenu et le manque d'informations sur les participants fort dommage.
55

6-
Comme ça faisait un moment que je voulais testé le langage **Go** et la librairie [iris](https://github.com/kataras/iris), je me suis dis que ça ferait un bon petit TP !
6+
Comme ça faisait un moment que je voulais testé le langage **Go**, je me suis dis que ça ferait un bon petit TP !
77

88
Et voici le résultat avec à gauche la version originale et à droite la version sortie par cet outil :
99

@@ -12,20 +12,24 @@ Et voici le résultat avec à gauche la version originale et à droite la versio
1212
<img src="pretty.png" width="280px"></img>
1313
</div>
1414

15-
*Une démo est hébergée sur [heroku](https://powerful-scrubland-26285.herokuapp.com/), c'est un peu lent étant donné qu'il s'agit d'un compte gratuit mais il suffit d'être patient.*
15+
*Une démo est hébergée sur [heroku](https://powerful-scrubland-26285.herokuapp.com/) !*
1616

1717
## Récupération et lancement
1818

19-
Il vous faudra une version de **Go** d'installée sur votre machine (1.11 ou ultérieur).
19+
Il vous faudra une version de **Go** installée sur votre machine (1.11 ou ultérieur).
2020

2121
La commande `go run` ci-dessous ira chercher les dépendances nécessaires au projet puis lancera le serveur web.
2222

2323
```bash
2424
$ git clone https://github.com/YuukanOO/cran.git
2525
$ cd cran
26-
$ go run main.go
26+
$ go run cmd/cran-web/main.go
2727
```
2828

29-
## Problèmes connus
29+
## Tests
3030

31-
Il reste quelques imperfections ici et là selon les comptes rendus, n'hésitez pas à contribuer si le coeur vous en dit !
31+
Pour lancer les tests, lancer la commande suivante :
32+
33+
```bash
34+
$ go test ./... --cover
35+
```

cmd/cran-web/main.go

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
package main
2+
3+
import (
4+
"cran/pkg/generating"
5+
_ "cran/pkg/generating/assembleenationale"
6+
"cran/pkg/http"
7+
"log"
8+
"os"
9+
"strconv"
10+
)
11+
12+
func main() {
13+
port, err := strconv.Atoi(os.Getenv("PORT"))
14+
15+
if err != nil {
16+
port = 8080
17+
}
18+
19+
s := http.NewServer(generating.NewService())
20+
21+
log.Fatal(s.Start(port))
22+
}

domain/doc.go

-2
This file was deleted.

domain/node.go

-10
This file was deleted.

domain/node_test.go

-79
This file was deleted.

domain/provider_test.go

-58
This file was deleted.

domain/report.go

-54
This file was deleted.

go.mod

+5-26
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,21 @@
1+
// +heroku install ./cmd/cran-web
2+
13
module cran
24

35
go 1.12
46

57
require (
6-
github.com/BurntSushi/toml v0.3.1 // indirect
7-
github.com/Joker/jade v1.0.0 // indirect
88
github.com/PuerkitoBio/goquery v1.5.0
9-
github.com/Shopify/goreferrer v0.0.0-20181106222321-ec9c9a553398 // indirect
109
github.com/antchfx/htmlquery v1.0.0 // indirect
1110
github.com/antchfx/xmlquery v1.0.0 // indirect
1211
github.com/antchfx/xpath v0.0.0-20190319080838-ce1d48779e67 // indirect
13-
github.com/aymerick/raymond v2.0.2+incompatible // indirect
14-
github.com/eknkc/amber v0.0.0-20171010120322-cdade1c07385 // indirect
15-
github.com/fatih/structs v1.1.0 // indirect
16-
github.com/flosch/pongo2 v0.0.0-20190505152737-8914e1cf9164 // indirect
1712
github.com/gobwas/glob v0.2.3 // indirect
1813
github.com/gocolly/colly v1.2.0
19-
github.com/golang/protobuf v1.3.1 // indirect
20-
github.com/iris-contrib/blackfriday v2.0.0+incompatible // indirect
21-
github.com/iris-contrib/formBinder v0.0.0-20190104093907-fbd5963f41e1 // indirect
22-
github.com/iris-contrib/go.uuid v2.0.0+incompatible // indirect
23-
github.com/json-iterator/go v1.1.6 // indirect
24-
github.com/kataras/golog v0.0.0-20180321173939-03be10146386 // indirect
25-
github.com/kataras/iris v11.1.1+incompatible
26-
github.com/kataras/pio v0.0.0-20190103105442-ea782b38602d // indirect
2714
github.com/kennygrant/sanitize v1.2.4 // indirect
28-
github.com/klauspost/compress v1.5.0 // indirect
29-
github.com/klauspost/cpuid v1.2.1 // indirect
30-
github.com/microcosm-cc/bluemonday v1.0.2 // indirect
31-
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
32-
github.com/modern-go/reflect2 v1.0.1 // indirect
33-
github.com/ryanuber/columnize v2.1.0+incompatible // indirect
15+
github.com/labstack/echo/v4 v4.1.5
3416
github.com/saintfish/chardet v0.0.0-20120816061221-3af4cd4741ca // indirect
35-
github.com/shurcooL/sanitized_anchor_name v1.0.0 // indirect
36-
github.com/stretchr/objx v0.2.0 // indirect
3717
github.com/stretchr/testify v1.3.0
3818
github.com/temoto/robotstxt v0.0.0-20180810133444-97ee4a9ee6ea // indirect
39-
golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c // indirect
40-
golang.org/x/text v0.3.2 // indirect
41-
google.golang.org/appengine v1.5.0 // indirect
19+
github.com/yosssi/ace v0.0.5
20+
google.golang.org/appengine v1.6.0 // indirect
4221
)

0 commit comments

Comments
 (0)