This commit is contained in:
2026-07-27 12:05:07 +03:00
commit df59d5d990
4 changed files with 42 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
.env
go.sum
*.key
*.crt
+2
View File
@@ -0,0 +1,2 @@
# noko-acme
+5
View File
@@ -0,0 +1,5 @@
module noko-acme
go 1.26.5
require github.com/joho/godotenv v1.5.1
+31
View File
@@ -0,0 +1,31 @@
package main
import (
"fmt"
"log"
"os"
"github.com/joho/godotenv"
)
type Config struct {
RootCAcert string
CAcert string
CAkey string
}
func LoadConfig() *Config {
return &Config{
RootCAcert: os.Getenv("RootCAcert"),
CAcert: os.Getenv("CAcert"),
CAkey: os.Getenv("CAkey"),
}
}
func main() {
if err := godotenv.Load(); err != nil {
log.Println("Предупреждение: файл .env не найден, берутся системные переменные")
}
cfg := LoadConfig()
fmt.Println(cfg)
}