Package AWS :

- Config Model : add a config model with a golib RouerStatus Config Model to use a AWS connection for API with a request status health check
  - Config Interface : add function GetAccessKey to retrieve the accesskey value currently used into the current connection
  - function Walk (Object, version, ...) : fix bug with pointer of string not initialized

Package Config :
  - interface Component : add status router pointer into the Init function to allow used a global router status for all component status registration as router status component

Package Status :
  - move Status Config as an sub package of Package Status

Package Errors :
  - add CamelCase const

Package Logger :
  - fix following bump dependencies

Global :
  - bump dependencies
  - change init of errors files : change function never call vy panic to prevent an error code collision
This commit is contained in:
Nicolas JUHEL
2022-09-13 10:18:04 +02:00
parent 55aa0c3637
commit 573af6ce3a
100 changed files with 887 additions and 765 deletions

View File

@@ -26,10 +26,14 @@
package httpserver
import "github.com/nabbar/golib/errors"
import (
"fmt"
liberr "github.com/nabbar/golib/errors"
)
const (
ErrorParamsEmpty errors.CodeError = iota + errors.MinPkgHttpServer
ErrorParamEmpty liberr.CodeError = iota + liberr.MinPkgHttpServer
ErrorHTTP2Configure
ErrorPoolAdd
ErrorPoolValidate
@@ -40,22 +44,16 @@ const (
ErrorServerOffline
)
var isCodeError = false
func IsCodeError() bool {
return isCodeError
}
func init() {
isCodeError = errors.ExistInMapMessage(ErrorParamsEmpty)
errors.RegisterIdFctMessage(ErrorParamsEmpty, getMessage)
if liberr.ExistInMapMessage(ErrorParamEmpty) {
panic(fmt.Errorf("error code collision with package golib/httpserver"))
}
liberr.RegisterIdFctMessage(ErrorParamEmpty, getMessage)
}
func getMessage(code errors.CodeError) (message string) {
func getMessage(code liberr.CodeError) (message string) {
switch code {
case errors.UNK_ERROR:
return ""
case ErrorParamsEmpty:
case ErrorParamEmpty:
return "given parameters is empty"
case ErrorHTTP2Configure:
return "cannot initialize http2 over http server"
@@ -75,5 +73,5 @@ func getMessage(code errors.CodeError) (message string) {
return "server offline"
}
return ""
return liberr.NullMessage
}