[BREAKING] Déplacer route /v4 vers /v4/health #12

Merged
vlbeaudoin merged 6 commits from breaking/v4-to-health into main 2023-06-02 03:20:13 -04:00
Showing only changes of commit 4673612e06 - Show all commits

View file

@ -9,6 +9,7 @@ import (
"net/http"
"git.agecem.com/agecem/bottin/v4/models"
"github.com/spf13/viper"
)
type ApiClient struct {
@ -18,6 +19,15 @@ type ApiClient struct {
Protocol string
}
func NewApiClientFromViper() *ApiClient {
apiClientKey := viper.GetString("web.api.key")
apiClientHost := viper.GetString("web.api.host")
apiClientProtocol := viper.GetString("web.api.protocol")
apiClientPort := viper.GetInt("web.api.port")
return NewApiClient(apiClientKey, apiClientHost, apiClientProtocol, apiClientPort)
}
func NewApiClient(key, host, protocol string, port int) *ApiClient {
return &ApiClient{
Key: key,