[BREAKING] Déplacer route /v4 vers /v4/health #12
1 changed files with 10 additions and 0 deletions
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue