Files
sender/config/config.go
T
phoenixandphoenix 6bd1b22e68 tsk-7: Change name of repo (#8)
Closes #7

Reviewed-on: #8
Co-authored-by: phoenix <kundeng00@pm.me>
Co-committed-by: phoenix <kundeng00@pm.me>
2025-11-09 03:11:33 +00:00

36 lines
555 B
Go

package config
import "encoding/json"
import "fmt"
import "os"
import (
"git.kundeng.us/phoenix/sender/models"
)
const (
App_Name = "sender"
)
func ParseConfig(filepath string) (config models.TwiloDetails, success bool) {
content, err := os.ReadFile(filepath)
fmt.Println("Reading config file...")
fmt.Printf("%s\n", filepath)
if err != nil {
fmt.Println("An error reading the file")
return
}
err = json.Unmarshal(content, &config)
if err != nil {
fmt.Println("An error occurred")
return config, false
}
return config, true
}