Merge branch 'refactor/go-naming-good-practices' into main
This commit is contained in:
commit
3791631045
17 changed files with 24 additions and 6 deletions
2
apiclient/apiclient.go
Normal file
2
apiclient/apiclient.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package apiclient provides the API client used by the web app
|
||||
package apiclient
|
2
apihandler/apihandler.go
Normal file
2
apihandler/apihandler.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package apihandler provides handlers for API routes
|
||||
package apihandler
|
2
apiresponse/apiresponse.go
Normal file
2
apiresponse/apiresponse.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package apiresponse provides response types for API routes
|
||||
package apiresponse
|
|
@ -18,7 +18,7 @@ var apiCmd = &cobra.Command{
|
|||
Use: "api",
|
||||
Short: "Start the API server",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cfg, err := config.GetConfig()
|
||||
cfg, err := config.UnmarshalConfig()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
/*
|
||||
Copyright © 2023 AGECEM & Victor Lacasse-Beaudoin
|
||||
*/
|
||||
// Package cmd provides the cobra command and subcommands for the application
|
||||
package cmd
|
||||
|
||||
import (
|
||||
|
|
|
@ -18,7 +18,7 @@ var webCmd = &cobra.Command{
|
|||
Use: "web",
|
||||
Short: "Start the webserver",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
cfg, err := config.GetConfig()
|
||||
cfg, err := config.UnmarshalConfig()
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
|
|
|
@ -1,3 +1,7 @@
|
|||
/*
|
||||
Package config provides types and methods for managing this application's
|
||||
config options and flags
|
||||
*/
|
||||
package config
|
||||
|
||||
import (
|
||||
|
@ -18,7 +22,7 @@ type WebConfig struct {
|
|||
Port int
|
||||
}
|
||||
|
||||
func GetConfig() (cfg Config, err error) {
|
||||
func UnmarshalConfig() (cfg Config, err error) {
|
||||
return cfg, viper.Unmarshal(&cfg)
|
||||
}
|
||||
|
||||
|
|
2
dbclient/dbclient.go
Normal file
2
dbclient/dbclient.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package dbclient provides the database client used by the API server
|
||||
package dbclient
|
1
main.go
1
main.go
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
Copyright © 2023 AGECEM & Victor Lacasse-Beaudoin
|
||||
|
||||
Application de registre de présences en Assemblée Générale de l'AGECEM
|
||||
*/
|
||||
package main
|
||||
|
||||
|
|
5
webcontent/webcontent.go
Normal file
5
webcontent/webcontent.go
Normal 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
2
webhandler/webhandler.go
Normal file
|
@ -0,0 +1,2 @@
|
|||
// Package webhandler provides handlers for the web app routes
|
||||
package webhandler
|
Reference in a new issue