Refondre noms de package selon bonnes pratiques

This commit is contained in:
Victor Lacasse-Beaudoin 2023-09-15 17:10:57 -04:00
parent 5c6eed5e6b
commit 6ef8eccbef
17 changed files with 24 additions and 6 deletions

2
apiclient/apiclient.go Normal file
View file

@ -0,0 +1,2 @@
// Package apiclient provides the API client used by the web app
package apiclient

2
apihandler/apihandler.go Normal file
View file

@ -0,0 +1,2 @@
// Package apihandler provides handlers for API routes
package apihandler

View file

@ -0,0 +1,2 @@
// Package apiresponse provides response types for API routes
package apiresponse

View file

@ -18,7 +18,7 @@ var apiCmd = &cobra.Command{
Use: "api", Use: "api",
Short: "Start the API server", Short: "Start the API server",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
cfg, err := config.GetConfig() cfg, err := config.UnmarshalConfig()
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View file

@ -1,6 +1,4 @@
/* // Package cmd provides the cobra command and subcommands for the application
Copyright © 2023 AGECEM & Victor Lacasse-Beaudoin
*/
package cmd package cmd
import ( import (

View file

@ -18,7 +18,7 @@ var webCmd = &cobra.Command{
Use: "web", Use: "web",
Short: "Start the webserver", Short: "Start the webserver",
Run: func(cmd *cobra.Command, args []string) { Run: func(cmd *cobra.Command, args []string) {
cfg, err := config.GetConfig() cfg, err := config.UnmarshalConfig()
if err != nil { if err != nil {
log.Fatal(err) log.Fatal(err)
} }

View file

@ -1,3 +1,7 @@
/*
Package config provides types and methods for managing this application's
config options and flags
*/
package config package config
import ( import (
@ -18,7 +22,7 @@ type WebConfig struct {
Port int Port int
} }
func GetConfig() (cfg Config, err error) { func UnmarshalConfig() (cfg Config, err error) {
return cfg, viper.Unmarshal(&cfg) return cfg, viper.Unmarshal(&cfg)
} }

View file

2
dbclient/dbclient.go Normal file
View file

@ -0,0 +1,2 @@
// Package dbclient provides the database client used by the API server
package dbclient

View file

View file

@ -1,6 +1,7 @@
/* /*
Copyright © 2023 AGECEM & Victor Lacasse-Beaudoin Copyright © 2023 AGECEM & Victor Lacasse-Beaudoin
Application de registre de présences en Assemblée Générale de l'AGECEM
*/ */
package main package main

View file

View file

View file

5
webcontent/webcontent.go Normal file
View file

@ -0,0 +1,5 @@
/*
Package webcontent provides the content to be embedded in the binary executable
for the web app
*/
package webcontent

2
webhandler/webhandler.go Normal file
View file

@ -0,0 +1,2 @@
// Package webhandler provides handlers for the web app routes
package webhandler