Compare commits

..

No commits in common. "d7b8ffc9f2501c43b4ec1163ffcf760f8f73a8bb" and "c553565f2c8c71df0dc2e7b3a0546991edae2e61" have entirely different histories.

4 changed files with 0 additions and 21 deletions

1
go.mod
View file

@ -3,7 +3,6 @@ module git.gnous.eu/gnouseu/plakken
go 1.22 go 1.22
require ( require (
github.com/joho/godotenv v1.5.1
github.com/redis/go-redis/v9 v9.5.1 github.com/redis/go-redis/v9 v9.5.1
golang.org/x/crypto v0.22.0 golang.org/x/crypto v0.22.0
) )

2
go.sum
View file

@ -6,8 +6,6 @@ github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UF
github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8= github.com/redis/go-redis/v9 v9.5.1 h1:H1X4D3yHPaYrkL5X06Wh6xNVM/pX0Ft4RV0vMGvLBh8=
github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M= github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0b/CLO2V2M=
golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30=

View file

@ -6,8 +6,6 @@ import (
"strconv" "strconv"
"git.gnous.eu/gnouseu/plakken/internal/constant" "git.gnous.eu/gnouseu/plakken/internal/constant"
"git.gnous.eu/gnouseu/plakken/internal/utils"
"github.com/joho/godotenv"
) )
// InitConfig Structure for program initialisation. // InitConfig Structure for program initialisation.
@ -22,13 +20,6 @@ type InitConfig struct {
// GetConfig Initialise configuration form .env. // GetConfig Initialise configuration form .env.
func GetConfig() InitConfig { func GetConfig() InitConfig {
if utils.FileExist(".env") {
err := godotenv.Load()
if err != nil {
log.Fatalf("Error loading .env file: %v", err)
}
}
listenAddress := os.Getenv("PLAKKEN_LISTEN") listenAddress := os.Getenv("PLAKKEN_LISTEN")
redisAddress := os.Getenv("PLAKKEN_REDIS_ADDRESS") redisAddress := os.Getenv("PLAKKEN_REDIS_ADDRESS")
db := os.Getenv("PLAKKEN_REDIS_DB") db := os.Getenv("PLAKKEN_REDIS_DB")

View file

@ -1,10 +1,8 @@
package utils package utils
import ( import (
"errors"
"log" "log"
mathrand "math/rand/v2" mathrand "math/rand/v2"
"os"
"regexp" "regexp"
"strconv" "strconv"
"strings" "strings"
@ -108,10 +106,3 @@ func ValidKey(key string) bool {
return result return result
} }
// FileExist verify if a file exist.
func FileExist(path string) bool {
_, err := os.Stat(path)
return !errors.Is(err, os.ErrNotExist)
}