@rivascva/dt-idl 1.1.48 → 1.1.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -8,18 +8,18 @@ import (
|
|
|
8
8
|
"github.com/RivasCVA/dt-idl/go/utils/logger"
|
|
9
9
|
)
|
|
10
10
|
|
|
11
|
-
type Responder[T
|
|
11
|
+
type Responder[T ~string] interface {
|
|
12
12
|
Write(w http.ResponseWriter, status int, data any)
|
|
13
13
|
WriteError(w http.ResponseWriter, status int, message string)
|
|
14
14
|
WriteErrorWithCode(w http.ResponseWriter, status int, code T, message string)
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
type StandardResponder[T
|
|
17
|
+
type StandardResponder[T ~string] struct {
|
|
18
18
|
log logger.Logger
|
|
19
19
|
baseErrorCode T
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
func NewStandardResponder[T
|
|
22
|
+
func NewStandardResponder[T ~string](log logger.Logger, baseErrorCode T) *StandardResponder[T] {
|
|
23
23
|
return &StandardResponder[T]{
|
|
24
24
|
log: log,
|
|
25
25
|
baseErrorCode: baseErrorCode,
|