go-fiber

command module
v0.0.0-...-c69a607 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 24, 2023 License: MIT Imports: 32 Imported by: 0

README

go-fiber

Test of Fiber Go Web Framework

TODO

  • How To Deploy a Go Web Application with Docker
  • Récupération des informations sur le dépôt (stargazers_count, homepage, language ?, open_issues_count)
  • Changer le fichier de config par un .env à la place du fichier TOML (meilleure intégration avec Docker)

Sommaire

Golang web server in production

Creating a Service for Systemd
touch /lib/systemd/system/<service name>.service

Edit file:

[Unit]
Description=<service description>
After=network.target

[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=<path to exec with arguments>

[Install]
WantedBy=multi-user.target
Commande Description
service <service name> start To launch
service <service name> enable To enable on boot
service <service name> disable To disable on boot
service <service name> status To show status
service <service name> stop To stop

Mesure et performance

Go met à disposition de puissants outils pour mesurer les performances des programmes :

  • pprof (graph, flamegraph, peek)
  • trace
  • cover

=> Lien vers une vidéo intéressante Mesure et optimisation de la performance en Go

pprof

Lancer :

curl http://localhost:8888/debug/pprof/heap?seconds=10 > <fichier à analyser>

Puis :

go tool pprof -http :7000 <fichier à analyser> # Interface web
go tool pprof --nodefraction=0 -http :7000 <fichier à analyser> # Interface web avec tous les noeuds
go tool pprof <fichier à analyser> # Ligne de commande
trace

Lancer :

go test <package path> -trace=<fichier à analyser>
curl localhost:<port>/debug/pprof/trace?seconds=10 > <fichier à analyser>

Puis :

go tool trace <fichier à analyser>
cover

Lancer :

go test <package path> -covermode=count -coverprofile=./<fichier à analyser>

Puis :

go tool cover -html=<fichier à analyser>

Docker

docker-compose down && docker-compose build && docker-compose up -d  

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
middlewares

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL