Compare commits
19 Commits
Author | SHA1 | Date | |
---|---|---|---|
fb847b03af | |||
f826633e6e
|
|||
edeae23bf1
|
|||
a038b86147
|
|||
ede0b99d3a
|
|||
d04ce18eb0
|
|||
8ae9a0f107
|
|||
a259bb6dbc
|
|||
adf32568ee
|
|||
0cfa159cb1
|
|||
0ead99608a
|
|||
7fe3e66cad
|
|||
a73d7d1654
|
|||
bbd7a7bc2c
|
|||
f5151eb214
|
|||
eefb9ac9f5
|
|||
468a7d212d
|
|||
a4def75d06
|
|||
16c66ee28c
|
@@ -72,7 +72,7 @@ type Builder struct {
|
||||
}
|
||||
|
||||
func Get(err error) *Builder {
|
||||
return &Builder{errorData: fromError(err)}
|
||||
return &Builder{errorData: FromError(err)}
|
||||
}
|
||||
|
||||
func New(t ErrorType, msg string) *Builder {
|
||||
@@ -80,7 +80,12 @@ func New(t ErrorType, msg string) *Builder {
|
||||
}
|
||||
|
||||
func Wrap(err error, msg string) *Builder {
|
||||
return &Builder{errorData: wrapExErr(fromError(err), msg, CatWrap, 1)}
|
||||
if !pkgconfig.RecursiveErrors {
|
||||
v := FromError(err)
|
||||
v.Message = msg
|
||||
return &Builder{errorData: v}
|
||||
}
|
||||
return &Builder{errorData: wrapExErr(FromError(err), msg, CatWrap, 1)}
|
||||
}
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@@ -372,7 +377,7 @@ func (b *Builder) Output(ctx context.Context, g *gin.Context) {
|
||||
b.GinReq(ctx, g, g.Request)
|
||||
}
|
||||
|
||||
b.errorData.Output(ctx, g)
|
||||
b.errorData.Output(g)
|
||||
|
||||
if b.errorData.Severity == SevErr || b.errorData.Severity == SevFatal {
|
||||
b.errorData.Log(stackSkipLogger.Error())
|
||||
|
@@ -11,7 +11,7 @@ import (
|
||||
|
||||
var reflectTypeStr = reflect.TypeOf("")
|
||||
|
||||
func fromError(err error) *ExErr {
|
||||
func FromError(err error) *ExErr {
|
||||
if verr, ok := err.(*ExErr); ok {
|
||||
// A simple ExErr
|
||||
return verr
|
||||
|
@@ -2,7 +2,6 @@ package exerr
|
||||
|
||||
import (
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"net/http"
|
||||
)
|
||||
|
||||
type ErrorCategory struct{ Category string }
|
||||
@@ -14,6 +13,7 @@ var (
|
||||
CatForeign = ErrorCategory{"Foreign"} // A foreign error that some component threw (e.g. an unknown mongodb error), happens if we call Wrap(..) on an non-bmerror value
|
||||
)
|
||||
|
||||
//goland:noinspection GoUnusedGlobalVariable
|
||||
var AllCategories = []ErrorCategory{CatWrap, CatSystem, CatUser, CatForeign}
|
||||
|
||||
type ErrorSeverity struct{ Severity string }
|
||||
@@ -27,6 +27,7 @@ var (
|
||||
SevFatal = ErrorSeverity{"Fatal"}
|
||||
)
|
||||
|
||||
//goland:noinspection GoUnusedGlobalVariable
|
||||
var AllSeverities = []ErrorSeverity{SevTrace, SevDebug, SevInfo, SevWarn, SevErr, SevFatal}
|
||||
|
||||
type ErrorType struct {
|
||||
@@ -34,13 +35,30 @@ type ErrorType struct {
|
||||
DefaultStatusCode *int
|
||||
}
|
||||
|
||||
//goland:noinspection GoUnusedGlobalVariable
|
||||
var (
|
||||
TypeInternal = ErrorType{"Internal", langext.Ptr(http.StatusInternalServerError)}
|
||||
TypePanic = ErrorType{"Panic", langext.Ptr(http.StatusInternalServerError)}
|
||||
TypeWrap = ErrorType{"Wrap", nil}
|
||||
TypeInternal = ErrorType{"INTERNAL_ERROR", langext.Ptr(500)}
|
||||
TypePanic = ErrorType{"PANIC", langext.Ptr(500)}
|
||||
TypeNotImplemented = ErrorType{"NOT_IMPLEMENTED", langext.Ptr(500)}
|
||||
|
||||
TypeWrap = ErrorType{"Wrap", nil}
|
||||
|
||||
TypeBindFailURI = ErrorType{"BINDFAIL_URI", langext.Ptr(400)}
|
||||
TypeBindFailQuery = ErrorType{"BINDFAIL_QUERY", langext.Ptr(400)}
|
||||
TypeBindFailJSON = ErrorType{"BINDFAIL_JSON", langext.Ptr(400)}
|
||||
TypeBindFailFormData = ErrorType{"BINDFAIL_FORMDATA", langext.Ptr(400)}
|
||||
TypeBindFailHeader = ErrorType{"BINDFAIL_HEADER", langext.Ptr(400)}
|
||||
|
||||
TypeUnauthorized = ErrorType{"UNAUTHORIZED", langext.Ptr(401)}
|
||||
TypeAuthFailed = ErrorType{"AUTH_FAILED", langext.Ptr(401)}
|
||||
|
||||
// other values come from pkgconfig
|
||||
)
|
||||
|
||||
func NewType(key string, defStatusCode *int) ErrorType {
|
||||
return ErrorType{key, defStatusCode}
|
||||
}
|
||||
|
||||
type LogPrintLevel string
|
||||
|
||||
const (
|
||||
|
@@ -6,29 +6,32 @@ import (
|
||||
)
|
||||
|
||||
type ErrorPackageConfig struct {
|
||||
ZeroLogErrTraces bool // autom print zerolog logs on .Build() (for SevErr and SevFatal)
|
||||
ZeroLogAllTraces bool // autom print zerolog logs on .Build() (for all Severities)
|
||||
RecursiveErrors bool // errors contains their Origin-Error
|
||||
ExtendedGinOutput bool // Log extended data (trace, meta, ...) to gin in err.Output()
|
||||
Types []ErrorType // all available error-types
|
||||
ZeroLogErrTraces bool // autom print zerolog logs on .Build() (for SevErr and SevFatal)
|
||||
ZeroLogAllTraces bool // autom print zerolog logs on .Build() (for all Severities)
|
||||
RecursiveErrors bool // errors contains their Origin-Error
|
||||
ExtendedGinOutput bool // Log extended data (trace, meta, ...) to gin in err.Output()
|
||||
ExtendGinOutput func(err *ExErr, json map[string]any) // (Optionally) extend the gin output with more fields
|
||||
ExtendGinDataOutput func(err *ExErr, depth int, json map[string]any) // (Optionally) extend the gin `__data` output with more fields
|
||||
}
|
||||
|
||||
type ErrorPackageConfigInit struct {
|
||||
ZeroLogErrTraces bool
|
||||
ZeroLogAllTraces bool
|
||||
RecursiveErrors bool
|
||||
ExtendedGinOutput bool
|
||||
InitTypes func(_ func(key string, defaultStatusCode *int) ErrorType)
|
||||
ZeroLogErrTraces bool
|
||||
ZeroLogAllTraces bool
|
||||
RecursiveErrors bool
|
||||
ExtendedGinOutput bool
|
||||
ExtendGinOutput func(err *ExErr, json map[string]any)
|
||||
ExtendGinDataOutput func(err *ExErr, depth int, json map[string]any)
|
||||
}
|
||||
|
||||
var initialized = false
|
||||
|
||||
var pkgconfig = ErrorPackageConfig{
|
||||
ZeroLogErrTraces: true,
|
||||
ZeroLogAllTraces: false,
|
||||
RecursiveErrors: true,
|
||||
ExtendedGinOutput: false,
|
||||
Types: []ErrorType{TypeInternal, TypePanic, TypeWrap},
|
||||
ZeroLogErrTraces: true,
|
||||
ZeroLogAllTraces: false,
|
||||
RecursiveErrors: true,
|
||||
ExtendedGinOutput: false,
|
||||
ExtendGinOutput: func(err *ExErr, json map[string]any) {},
|
||||
ExtendGinDataOutput: func(err *ExErr, depth int, json map[string]any) {},
|
||||
}
|
||||
|
||||
// Init initializes the exerr packages
|
||||
@@ -39,24 +42,23 @@ func Init(cfg ErrorPackageConfigInit) {
|
||||
panic("Cannot re-init error package")
|
||||
}
|
||||
|
||||
types := pkgconfig.Types
|
||||
ego := func(err *ExErr, json map[string]any) {}
|
||||
egdo := func(err *ExErr, depth int, json map[string]any) {}
|
||||
|
||||
fnAddType := func(key string, defaultStatusCode *int) ErrorType {
|
||||
et := ErrorType{key, defaultStatusCode}
|
||||
types = append(types, et)
|
||||
return et
|
||||
if cfg.ExtendGinOutput != nil {
|
||||
ego = cfg.ExtendGinOutput
|
||||
}
|
||||
|
||||
if cfg.InitTypes != nil {
|
||||
cfg.InitTypes(fnAddType)
|
||||
if cfg.ExtendGinDataOutput != nil {
|
||||
egdo = cfg.ExtendGinDataOutput
|
||||
}
|
||||
|
||||
pkgconfig = ErrorPackageConfig{
|
||||
ZeroLogErrTraces: cfg.ZeroLogErrTraces,
|
||||
ZeroLogAllTraces: cfg.ZeroLogAllTraces,
|
||||
RecursiveErrors: cfg.RecursiveErrors,
|
||||
ExtendedGinOutput: cfg.ExtendedGinOutput,
|
||||
Types: types,
|
||||
ZeroLogErrTraces: cfg.ZeroLogErrTraces,
|
||||
ZeroLogAllTraces: cfg.ZeroLogAllTraces,
|
||||
RecursiveErrors: cfg.RecursiveErrors,
|
||||
ExtendedGinOutput: cfg.ExtendedGinOutput,
|
||||
ExtendGinOutput: ego,
|
||||
ExtendGinDataOutput: egdo,
|
||||
}
|
||||
|
||||
initialized = true
|
||||
|
@@ -162,7 +162,6 @@ func (ee *ExErr) RecursiveStatuscode() *int {
|
||||
}
|
||||
}
|
||||
|
||||
// fallback to <empty>
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -179,6 +178,18 @@ func (ee *ExErr) RecursiveCategory() ErrorCategory {
|
||||
return ee.Category
|
||||
}
|
||||
|
||||
// RecursiveMeta searches (top-down) for teh first error that has a meta value with teh specified key
|
||||
// and returns its value (or nil)
|
||||
func (ee *ExErr) RecursiveMeta(key string) *MetaValue {
|
||||
for curr := ee; curr != nil; curr = curr.OriginalError {
|
||||
if metaval, ok := curr.Meta[key]; ok {
|
||||
return langext.Ptr(metaval)
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (ee *ExErr) Depth() int {
|
||||
if ee.OriginalError == nil {
|
||||
return 1
|
||||
|
62
exerr/gin.go
62
exerr/gin.go
@@ -1,52 +1,58 @@
|
||||
package exerr
|
||||
|
||||
import (
|
||||
"context"
|
||||
"github.com/gin-gonic/gin"
|
||||
json "gogs.mikescher.com/BlackForestBytes/goext/gojson"
|
||||
"net/http"
|
||||
"time"
|
||||
)
|
||||
|
||||
func (ee *ExErr) toJson() gin.H {
|
||||
json := gin.H{}
|
||||
func (ee *ExErr) toJson(depth int) gin.H {
|
||||
ginJson := gin.H{}
|
||||
|
||||
if ee.UniqueID != "" {
|
||||
json["id"] = ee.UniqueID
|
||||
ginJson["id"] = ee.UniqueID
|
||||
}
|
||||
if ee.Category != CatWrap {
|
||||
json["category"] = ee.Category
|
||||
ginJson["category"] = ee.Category
|
||||
}
|
||||
if ee.Type != TypeWrap {
|
||||
json["type"] = ee.Type
|
||||
ginJson["type"] = ee.Type
|
||||
}
|
||||
if ee.StatusCode != nil {
|
||||
json["statuscode"] = ee.StatusCode
|
||||
ginJson["statuscode"] = ee.StatusCode
|
||||
}
|
||||
if ee.Message != "" {
|
||||
json["message"] = ee.Message
|
||||
ginJson["message"] = ee.Message
|
||||
}
|
||||
if ee.Caller != "" {
|
||||
json["caller"] = ee.Caller
|
||||
ginJson["caller"] = ee.Caller
|
||||
}
|
||||
if ee.Severity != SevErr {
|
||||
json["severity"] = ee.Severity
|
||||
ginJson["severity"] = ee.Severity
|
||||
}
|
||||
if ee.Timestamp != (time.Time{}) {
|
||||
json["time"] = ee.Timestamp.Format(time.RFC3339)
|
||||
ginJson["time"] = ee.Timestamp.Format(time.RFC3339)
|
||||
}
|
||||
if ee.WrappedErrType != "" {
|
||||
ginJson["wrappedErrType"] = ee.WrappedErrType
|
||||
}
|
||||
if ee.OriginalError != nil {
|
||||
json["original"] = ee.OriginalError.toJson()
|
||||
ginJson["original"] = ee.OriginalError.toJson(depth + 1)
|
||||
}
|
||||
|
||||
return json
|
||||
pkgconfig.ExtendGinDataOutput(ee, depth, ginJson)
|
||||
|
||||
return ginJson
|
||||
}
|
||||
|
||||
func (ee *ExErr) Output(ctx context.Context, g *gin.Context) {
|
||||
func (ee *ExErr) Output(g *gin.Context) {
|
||||
var statuscode = http.StatusInternalServerError
|
||||
|
||||
var baseCat = ee.RecursiveCategory()
|
||||
var baseType = ee.RecursiveType()
|
||||
var baseStatuscode = ee.RecursiveStatuscode()
|
||||
var baseMessage = ee.RecursiveMessage()
|
||||
|
||||
if baseCat == CatUser {
|
||||
statuscode = http.StatusBadRequest
|
||||
@@ -62,20 +68,18 @@ func (ee *ExErr) Output(ctx context.Context, g *gin.Context) {
|
||||
|
||||
warnOnPkgConfigNotInitialized()
|
||||
|
||||
if pkgconfig.ExtendedGinOutput {
|
||||
g.JSON(statuscode, gin.H{
|
||||
"errorid": ee.UniqueID,
|
||||
"error": ee.RecursiveMessage(),
|
||||
"errorcategory": ee.RecursiveCategory(),
|
||||
"errortype": ee.RecursiveType(),
|
||||
"errodata": ee.toJson(),
|
||||
})
|
||||
} else {
|
||||
g.JSON(statuscode, gin.H{
|
||||
"errorid": ee.UniqueID,
|
||||
"error": ee.RecursiveMessage(),
|
||||
"errorcategory": ee.RecursiveCategory(),
|
||||
"errortype": ee.RecursiveType(),
|
||||
})
|
||||
ginOutput := gin.H{
|
||||
"errorid": ee.UniqueID,
|
||||
"message": baseMessage,
|
||||
"errorcode": baseType.Key,
|
||||
"category": baseCat.Category,
|
||||
}
|
||||
|
||||
if pkgconfig.ExtendedGinOutput {
|
||||
ginOutput["__data"] = ee.toJson(0)
|
||||
}
|
||||
|
||||
pkgconfig.ExtendGinOutput(ee, ginOutput)
|
||||
|
||||
g.Render(statuscode, json.GoJsonRender{Data: ginOutput, NilSafeSlices: true, NilSafeMaps: true})
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@ func IsType(err error, errType ErrorType) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
bmerr := fromError(err)
|
||||
bmerr := FromError(err)
|
||||
for bmerr != nil {
|
||||
if bmerr.Type == errType {
|
||||
return true
|
||||
@@ -28,7 +28,7 @@ func IsFrom(e error, original error) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
bmerr := fromError(e)
|
||||
bmerr := FromError(e)
|
||||
for bmerr == nil {
|
||||
return false
|
||||
}
|
||||
@@ -48,7 +48,7 @@ func HasSourceMessage(e error, msg string) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
bmerr := fromError(e)
|
||||
bmerr := FromError(e)
|
||||
for bmerr == nil {
|
||||
return false
|
||||
}
|
||||
@@ -71,7 +71,7 @@ func MessageMatch(e error, matcher func(string) bool) bool {
|
||||
return true
|
||||
}
|
||||
|
||||
bmerr := fromError(e)
|
||||
bmerr := FromError(e)
|
||||
for bmerr == nil {
|
||||
return false
|
||||
}
|
||||
|
@@ -1,16 +0,0 @@
|
||||
package ginext
|
||||
|
||||
type apiError struct {
|
||||
ErrorCode string `json:"errorcode"`
|
||||
Message string `json:"message"`
|
||||
FAPIErrorMessage *string `json:"fapiMessage,omitempty"`
|
||||
}
|
||||
|
||||
type extAPIError struct {
|
||||
ErrorCode string `json:"errorcode"`
|
||||
Message string `json:"message"`
|
||||
FAPIErrorMessage *string `json:"fapiMessage,omitempty"`
|
||||
|
||||
RawError *string `json:"__error"`
|
||||
Trace []string `json:"__trace"`
|
||||
}
|
@@ -50,10 +50,3 @@ func (ac *AppContext) RequestURI() string {
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
func (ac *AppContext) FinishSuccess(res HTTPResponse) HTTPResponse {
|
||||
if ac.cancelled {
|
||||
panic("Cannot finish a cancelled request")
|
||||
}
|
||||
return res
|
||||
}
|
||||
|
@@ -1,21 +0,0 @@
|
||||
package commonApiErr
|
||||
|
||||
type APIErrorCode struct {
|
||||
HTTPStatusCode int
|
||||
Key string
|
||||
}
|
||||
|
||||
//goland:noinspection GoSnakeCaseUsage
|
||||
var (
|
||||
NotImplemented = APIErrorCode{500, "NOT_IMPLEMENTED"}
|
||||
InternalError = APIErrorCode{500, "INTERNAL_ERROR"}
|
||||
Panic = APIErrorCode{500, "PANIC"}
|
||||
|
||||
BindFailURI = APIErrorCode{400, "BINDFAIL_URI"}
|
||||
BindFailQuery = APIErrorCode{400, "BINDFAIL_QUERY"}
|
||||
BindFailJSON = APIErrorCode{400, "BINDFAIL_JSON"}
|
||||
BindFailFormData = APIErrorCode{400, "BINDFAIL_FORMDATA"}
|
||||
|
||||
Unauthorized = APIErrorCode{401, "UNAUTHORIZED"}
|
||||
AuthFailed = APIErrorCode{401, "AUTH_FAILED"}
|
||||
)
|
105
ginext/engine.go
105
ginext/engine.go
@@ -1,8 +1,14 @@
|
||||
package ginext
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/mathext"
|
||||
"net"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
@@ -10,13 +16,21 @@ type GinWrapper struct {
|
||||
engine *gin.Engine
|
||||
SuppressGinLogs bool
|
||||
|
||||
allowCors bool
|
||||
ginDebug bool
|
||||
returnRawErrors bool
|
||||
requestTimeout time.Duration
|
||||
allowCors bool
|
||||
ginDebug bool
|
||||
requestTimeout time.Duration
|
||||
|
||||
routeSpecs []ginRouteSpec
|
||||
}
|
||||
|
||||
func NewEngine(allowCors bool, ginDebug bool, returnRawErrors bool, timeout time.Duration) *GinWrapper {
|
||||
type ginRouteSpec struct {
|
||||
Method string
|
||||
URL string
|
||||
Middlewares []string
|
||||
Handler string
|
||||
}
|
||||
|
||||
func NewEngine(allowCors bool, ginDebug bool, timeout time.Duration) *GinWrapper {
|
||||
engine := gin.New()
|
||||
|
||||
wrapper := &GinWrapper{
|
||||
@@ -24,7 +38,6 @@ func NewEngine(allowCors bool, ginDebug bool, returnRawErrors bool, timeout time
|
||||
SuppressGinLogs: false,
|
||||
allowCors: allowCors,
|
||||
ginDebug: ginDebug,
|
||||
returnRawErrors: returnRawErrors,
|
||||
requestTimeout: timeout,
|
||||
}
|
||||
|
||||
@@ -35,18 +48,94 @@ func NewEngine(allowCors bool, ginDebug bool, returnRawErrors bool, timeout time
|
||||
engine.Use(CorsMiddleware())
|
||||
}
|
||||
|
||||
// do not debug-print routes
|
||||
gin.DebugPrintRouteFunc = func(_, _, _ string, _ int) {}
|
||||
|
||||
if ginDebug {
|
||||
gin.SetMode(gin.ReleaseMode)
|
||||
|
||||
ginlogger := gin.Logger()
|
||||
engine.Use(func(context *gin.Context) {
|
||||
if !wrapper.SuppressGinLogs {
|
||||
ginlogger(context)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
gin.SetMode(gin.DebugMode)
|
||||
}
|
||||
|
||||
return wrapper
|
||||
}
|
||||
|
||||
func (w *GinWrapper) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
|
||||
w.engine.ServeHTTP(writer, request)
|
||||
func (w *GinWrapper) ListenAndServeHTTP(addr string, postInit func(port string)) (chan error, *http.Server) {
|
||||
|
||||
w.DebugPrintRoutes()
|
||||
|
||||
httpserver := &http.Server{
|
||||
Addr: addr,
|
||||
Handler: w.engine,
|
||||
}
|
||||
|
||||
errChan := make(chan error)
|
||||
|
||||
go func() {
|
||||
|
||||
ln, err := net.Listen("tcp", httpserver.Addr)
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
|
||||
_, port, err := net.SplitHostPort(ln.Addr().String())
|
||||
if err != nil {
|
||||
errChan <- err
|
||||
return
|
||||
}
|
||||
|
||||
log.Info().Str("address", httpserver.Addr).Msg("HTTP-Server started on http://localhost:" + port)
|
||||
|
||||
if postInit != nil {
|
||||
postInit(port) // the net.Listener a few lines above is at this point actually already buffering requests
|
||||
}
|
||||
|
||||
errChan <- httpserver.Serve(ln)
|
||||
}()
|
||||
|
||||
return errChan, httpserver
|
||||
}
|
||||
|
||||
func (w *GinWrapper) DebugPrintRoutes() {
|
||||
if !w.ginDebug {
|
||||
return
|
||||
}
|
||||
|
||||
lines := make([][4]string, 0)
|
||||
|
||||
pad := [4]int{0, 0, 0, 0}
|
||||
|
||||
for _, spec := range w.routeSpecs {
|
||||
|
||||
line := [4]string{
|
||||
spec.Method,
|
||||
spec.URL,
|
||||
strings.Join(spec.Middlewares, " -> "),
|
||||
spec.Handler,
|
||||
}
|
||||
|
||||
lines = append(lines, line)
|
||||
|
||||
pad[0] = mathext.Max(pad[0], len(line[0]))
|
||||
pad[1] = mathext.Max(pad[1], len(line[1]))
|
||||
pad[2] = mathext.Max(pad[2], len(line[2]))
|
||||
pad[3] = mathext.Max(pad[3], len(line[3]))
|
||||
}
|
||||
|
||||
for _, line := range lines {
|
||||
|
||||
fmt.Printf("Gin-Route: %s %s --> %s --> %s\n",
|
||||
langext.StrPadRight("["+line[0]+"]", " ", pad[0]+2),
|
||||
langext.StrPadRight(line[1], " ", pad[1]),
|
||||
langext.StrPadRight(line[2], " ", pad[2]),
|
||||
langext.StrPadRight(line[3], " ", pad[3]))
|
||||
}
|
||||
}
|
||||
|
@@ -1,10 +1,9 @@
|
||||
package ginext
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
|
||||
)
|
||||
|
||||
type WHandlerFunc func(PreContext) HTTPResponse
|
||||
@@ -13,18 +12,20 @@ func Wrap(w *GinWrapper, fn WHandlerFunc) gin.HandlerFunc {
|
||||
|
||||
return func(g *gin.Context) {
|
||||
|
||||
g.Set("__returnRawErrors", w.returnRawErrors)
|
||||
|
||||
reqctx := g.Request.Context()
|
||||
|
||||
wrap, stackTrace, panicObj := callPanicSafe(fn, PreContext{wrapper: w, ginCtx: g})
|
||||
if panicObj != nil {
|
||||
|
||||
fmt.Printf("\n======== ======== STACKTRACE ======== ========\n%s\n======== ======== ======== ========\n\n", stackTrace)
|
||||
log.Error().
|
||||
Interface("panicObj", panicObj).
|
||||
|
||||
err := exerr.
|
||||
New(exerr.TypePanic, "Panic occured (in gin handler)").
|
||||
Any("panicObj", panicObj).
|
||||
Str("trace", stackTrace).
|
||||
Msg("Panic occured (in gin handler)")
|
||||
wrap = APIError(g, commonApiErr.Panic, "A panic occured in the HTTP handler", errors.New(fmt.Sprintf("%+v", panicObj)))
|
||||
Build()
|
||||
|
||||
wrap = Error(g, err)
|
||||
}
|
||||
|
||||
if g.Writer.Written() {
|
||||
|
@@ -2,8 +2,10 @@ package ginext
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/gin-gonic/gin/binding"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"runtime/debug"
|
||||
)
|
||||
@@ -15,6 +17,7 @@ type PreContext struct {
|
||||
query any
|
||||
body any
|
||||
form any
|
||||
header any
|
||||
}
|
||||
|
||||
func (pctx *PreContext) URI(uri any) *PreContext {
|
||||
@@ -37,36 +40,73 @@ func (pctx *PreContext) Form(form any) *PreContext {
|
||||
return pctx
|
||||
}
|
||||
|
||||
func (pctx *PreContext) Header(header any) *PreContext {
|
||||
pctx.header = header
|
||||
return pctx
|
||||
}
|
||||
|
||||
func (pctx PreContext) Start() (*AppContext, *gin.Context, *HTTPResponse) {
|
||||
if pctx.uri != nil {
|
||||
if err := pctx.ginCtx.ShouldBindUri(pctx.uri); err != nil {
|
||||
return nil, nil, langext.Ptr(APIError(pctx.ginCtx, commonApiErr.BindFailURI, "Failed to read uri", err))
|
||||
err = exerr.Wrap(err, "Failed to read uri").
|
||||
WithType(exerr.TypeBindFailURI).
|
||||
Str("struct_type", fmt.Sprintf("%T", pctx.uri)).
|
||||
Build()
|
||||
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
|
||||
}
|
||||
}
|
||||
|
||||
if pctx.query != nil {
|
||||
if err := pctx.ginCtx.ShouldBindQuery(pctx.query); err != nil {
|
||||
return nil, nil, langext.Ptr(APIError(pctx.ginCtx, commonApiErr.BindFailQuery, "Failed to read query", err))
|
||||
err = exerr.Wrap(err, "Failed to read query").
|
||||
WithType(exerr.TypeBindFailQuery).
|
||||
Str("struct_type", fmt.Sprintf("%T", pctx.query)).
|
||||
Build()
|
||||
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
|
||||
}
|
||||
}
|
||||
|
||||
if pctx.body != nil {
|
||||
if pctx.ginCtx.ContentType() == "application/json" {
|
||||
if err := pctx.ginCtx.ShouldBindJSON(pctx.body); err != nil {
|
||||
return nil, nil, langext.Ptr(APIError(pctx.ginCtx, commonApiErr.BindFailJSON, "Failed to read body", err))
|
||||
err = exerr.Wrap(err, "Failed to read json-body").
|
||||
WithType(exerr.TypeBindFailJSON).
|
||||
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
||||
Build()
|
||||
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
|
||||
}
|
||||
} else {
|
||||
return nil, nil, langext.Ptr(APIError(pctx.ginCtx, commonApiErr.BindFailJSON, "missing JSON body", nil))
|
||||
err := exerr.New(exerr.TypeBindFailJSON, "missing JSON body").
|
||||
Str("struct_type", fmt.Sprintf("%T", pctx.body)).
|
||||
Build()
|
||||
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
|
||||
}
|
||||
}
|
||||
|
||||
if pctx.form != nil {
|
||||
if pctx.ginCtx.ContentType() == "multipart/form-data" {
|
||||
if err := pctx.ginCtx.ShouldBindWith(pctx.form, binding.Form); err != nil {
|
||||
return nil, nil, langext.Ptr(APIError(pctx.ginCtx, commonApiErr.BindFailFormData, "Failed to read multipart-form", err))
|
||||
err = exerr.Wrap(err, "Failed to read multipart-form").
|
||||
WithType(exerr.TypeBindFailFormData).
|
||||
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
|
||||
Build()
|
||||
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
|
||||
}
|
||||
} else {
|
||||
return nil, nil, langext.Ptr(APIError(pctx.ginCtx, commonApiErr.BindFailJSON, "missing form body", nil))
|
||||
err := exerr.New(exerr.TypeBindFailFormData, "missing form body").
|
||||
Str("struct_type", fmt.Sprintf("%T", pctx.form)).
|
||||
Build()
|
||||
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
|
||||
}
|
||||
}
|
||||
|
||||
if pctx.header != nil {
|
||||
if err := pctx.ginCtx.ShouldBindHeader(pctx.query); err != nil {
|
||||
err = exerr.Wrap(err, "Failed to read header").
|
||||
WithType(exerr.TypeBindFailHeader).
|
||||
Str("struct_type", fmt.Sprintf("%T", pctx.query)).
|
||||
Build()
|
||||
return nil, nil, langext.Ptr(Error(pctx.ginCtx, err))
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -3,57 +3,97 @@ package ginext
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/rs/zerolog/log"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/exerr"
|
||||
json "gogs.mikescher.com/BlackForestBytes/goext/gojson"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"runtime/debug"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type headerval struct {
|
||||
Key string
|
||||
Val string
|
||||
}
|
||||
|
||||
type HTTPResponse interface {
|
||||
Write(g *gin.Context)
|
||||
WithHeader(k string, v string) HTTPResponse
|
||||
}
|
||||
|
||||
type jsonHTTPResponse struct {
|
||||
statusCode int
|
||||
data any
|
||||
headers []headerval
|
||||
}
|
||||
|
||||
func (j jsonHTTPResponse) Write(g *gin.Context) {
|
||||
for _, v := range j.headers {
|
||||
g.Header(v.Key, v.Val)
|
||||
}
|
||||
g.Render(j.statusCode, json.GoJsonRender{Data: j.data, NilSafeSlices: true, NilSafeMaps: true})
|
||||
}
|
||||
|
||||
func (j jsonHTTPResponse) WithHeader(k string, v string) HTTPResponse {
|
||||
j.headers = append(j.headers, headerval{k, v})
|
||||
return j
|
||||
}
|
||||
|
||||
type emptyHTTPResponse struct {
|
||||
statusCode int
|
||||
headers []headerval
|
||||
}
|
||||
|
||||
func (j emptyHTTPResponse) Write(g *gin.Context) {
|
||||
for _, v := range j.headers {
|
||||
g.Header(v.Key, v.Val)
|
||||
}
|
||||
g.Status(j.statusCode)
|
||||
}
|
||||
|
||||
func (j emptyHTTPResponse) WithHeader(k string, v string) HTTPResponse {
|
||||
j.headers = append(j.headers, headerval{k, v})
|
||||
return j
|
||||
}
|
||||
|
||||
type textHTTPResponse struct {
|
||||
statusCode int
|
||||
data string
|
||||
headers []headerval
|
||||
}
|
||||
|
||||
func (j textHTTPResponse) Write(g *gin.Context) {
|
||||
for _, v := range j.headers {
|
||||
g.Header(v.Key, v.Val)
|
||||
}
|
||||
g.String(j.statusCode, "%s", j.data)
|
||||
}
|
||||
|
||||
func (j textHTTPResponse) WithHeader(k string, v string) HTTPResponse {
|
||||
j.headers = append(j.headers, headerval{k, v})
|
||||
return j
|
||||
}
|
||||
|
||||
type dataHTTPResponse struct {
|
||||
statusCode int
|
||||
data []byte
|
||||
contentType string
|
||||
headers []headerval
|
||||
}
|
||||
|
||||
func (j dataHTTPResponse) Write(g *gin.Context) {
|
||||
for _, v := range j.headers {
|
||||
g.Header(v.Key, v.Val)
|
||||
}
|
||||
g.Data(j.statusCode, j.contentType, j.data)
|
||||
}
|
||||
|
||||
func (j dataHTTPResponse) WithHeader(k string, v string) HTTPResponse {
|
||||
j.headers = append(j.headers, headerval{k, v})
|
||||
return j
|
||||
}
|
||||
|
||||
type fileHTTPResponse struct {
|
||||
mimetype string
|
||||
filepath string
|
||||
filename *string
|
||||
headers []headerval
|
||||
}
|
||||
|
||||
func (j fileHTTPResponse) Write(g *gin.Context) {
|
||||
@@ -62,18 +102,46 @@ func (j fileHTTPResponse) Write(g *gin.Context) {
|
||||
g.Header("Content-Disposition", fmt.Sprintf("attachment; filename=\"%s\"", *j.filename))
|
||||
|
||||
}
|
||||
for _, v := range j.headers {
|
||||
g.Header(v.Key, v.Val)
|
||||
}
|
||||
g.File(j.filepath)
|
||||
}
|
||||
|
||||
func (j fileHTTPResponse) WithHeader(k string, v string) HTTPResponse {
|
||||
j.headers = append(j.headers, headerval{k, v})
|
||||
return j
|
||||
}
|
||||
|
||||
type redirectHTTPResponse struct {
|
||||
statusCode int
|
||||
url string
|
||||
headers []headerval
|
||||
}
|
||||
|
||||
func (j redirectHTTPResponse) Write(g *gin.Context) {
|
||||
g.Redirect(j.statusCode, j.url)
|
||||
}
|
||||
|
||||
func (j redirectHTTPResponse) WithHeader(k string, v string) HTTPResponse {
|
||||
j.headers = append(j.headers, headerval{k, v})
|
||||
return j
|
||||
}
|
||||
|
||||
type jsonAPIErrResponse struct {
|
||||
err *exerr.ExErr
|
||||
headers []headerval
|
||||
}
|
||||
|
||||
func (j jsonAPIErrResponse) Write(g *gin.Context) {
|
||||
j.err.Output(g)
|
||||
}
|
||||
|
||||
func (j jsonAPIErrResponse) WithHeader(k string, v string) HTTPResponse {
|
||||
j.headers = append(j.headers, headerval{k, v})
|
||||
return j
|
||||
}
|
||||
|
||||
func Status(sc int) HTTPResponse {
|
||||
return &emptyHTTPResponse{statusCode: sc}
|
||||
}
|
||||
@@ -102,52 +170,12 @@ func Redirect(sc int, newURL string) HTTPResponse {
|
||||
return &redirectHTTPResponse{statusCode: sc, url: newURL}
|
||||
}
|
||||
|
||||
func APIError(g *gin.Context, errcode commonApiErr.APIErrorCode, msg string, e error) HTTPResponse {
|
||||
return createApiError(g, errcode, msg, e)
|
||||
func Error(g *gin.Context, e error) HTTPResponse {
|
||||
return &jsonAPIErrResponse{
|
||||
err: exerr.FromError(e),
|
||||
}
|
||||
}
|
||||
|
||||
func NotImplemented(g *gin.Context) HTTPResponse {
|
||||
return createApiError(g, commonApiErr.NotImplemented, "", nil)
|
||||
}
|
||||
|
||||
func createApiError(g *gin.Context, errcode commonApiErr.APIErrorCode, msg string, e error) HTTPResponse {
|
||||
reqUri := ""
|
||||
if g != nil && g.Request != nil {
|
||||
reqUri = g.Request.Method + " :: " + g.Request.RequestURI
|
||||
}
|
||||
|
||||
log.Error().
|
||||
Str("errorcode.key", errcode.Key).
|
||||
Int("errcode.status", errcode.HTTPStatusCode).
|
||||
Str("uri", reqUri).
|
||||
AnErr("err", e).
|
||||
Stack().
|
||||
Msg(msg)
|
||||
|
||||
var fapiMessage *string = nil
|
||||
if v, ok := e.(interface{ FAPIMessage() string }); ok {
|
||||
fapiMessage = langext.Ptr(v.FAPIMessage())
|
||||
}
|
||||
|
||||
if g.GetBool("__returnRawErrors") {
|
||||
return &jsonHTTPResponse{
|
||||
statusCode: errcode.HTTPStatusCode,
|
||||
data: extAPIError{
|
||||
ErrorCode: errcode.Key,
|
||||
Message: msg,
|
||||
RawError: langext.Ptr(langext.Conditional(e == nil, "", fmt.Sprintf("%+v", e))),
|
||||
FAPIErrorMessage: fapiMessage,
|
||||
Trace: strings.Split(string(debug.Stack()), "\n"),
|
||||
},
|
||||
}
|
||||
} else {
|
||||
return &jsonHTTPResponse{
|
||||
statusCode: errcode.HTTPStatusCode,
|
||||
data: apiError{
|
||||
ErrorCode: errcode.Key,
|
||||
Message: msg,
|
||||
FAPIErrorMessage: fapiMessage,
|
||||
},
|
||||
}
|
||||
}
|
||||
return Error(g, exerr.New(exerr.TypeNotImplemented, "").Build())
|
||||
}
|
||||
|
@@ -2,7 +2,13 @@ package ginext
|
||||
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/langext"
|
||||
"gogs.mikescher.com/BlackForestBytes/goext/rext"
|
||||
"net/http"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"runtime"
|
||||
"strings"
|
||||
)
|
||||
|
||||
var anyMethods = []string{
|
||||
@@ -12,14 +18,15 @@ var anyMethods = []string{
|
||||
}
|
||||
|
||||
type GinRoutesWrapper struct {
|
||||
wrapper *GinWrapper
|
||||
routes gin.IRouter
|
||||
wrapper *GinWrapper
|
||||
routes gin.IRouter
|
||||
defaultHandler []gin.HandlerFunc
|
||||
}
|
||||
|
||||
type GinRouteBuilder struct {
|
||||
routes *GinRoutesWrapper
|
||||
|
||||
methods []string
|
||||
method string
|
||||
relPath string
|
||||
handlers []gin.HandlerFunc
|
||||
}
|
||||
@@ -29,43 +36,49 @@ func (w *GinWrapper) Routes() *GinRoutesWrapper {
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) Group(relativePath string) *GinRoutesWrapper {
|
||||
return &GinRoutesWrapper{wrapper: w.wrapper, routes: w.routes.Group(relativePath)}
|
||||
return &GinRoutesWrapper{wrapper: w.wrapper, routes: w.routes.Group(relativePath), defaultHandler: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) Use(middleware ...gin.HandlerFunc) *GinRoutesWrapper {
|
||||
defHandler := langext.ArrCopy(w.defaultHandler)
|
||||
defHandler = append(defHandler, middleware...)
|
||||
return &GinRoutesWrapper{wrapper: w.wrapper, routes: w.routes, defaultHandler: defHandler}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) GET(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: []string{http.MethodGet}, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: http.MethodGet, relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) POST(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: []string{http.MethodPost}, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: http.MethodPost, relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) DELETE(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: []string{http.MethodDelete}, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: http.MethodDelete, relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) PATCH(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: []string{http.MethodPatch}, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: http.MethodPatch, relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) PUT(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: []string{http.MethodPut}, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: http.MethodPut, relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) OPTIONS(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: []string{http.MethodOptions}, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: http.MethodOptions, relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) HEAD(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: []string{http.MethodHead}, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: http.MethodHead, relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) COUNT(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: []string{"COUNT"}, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: "COUNT", relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRoutesWrapper) Any(relativePath string) *GinRouteBuilder {
|
||||
return &GinRouteBuilder{routes: w, methods: anyMethods, relPath: relativePath, handlers: make([]gin.HandlerFunc, 0)}
|
||||
return &GinRouteBuilder{routes: w, method: "*", relPath: relativePath, handlers: langext.ArrCopy(w.defaultHandler)}
|
||||
}
|
||||
|
||||
func (w *GinRouteBuilder) Use(middleware ...gin.HandlerFunc) *GinRouteBuilder {
|
||||
@@ -74,12 +87,63 @@ func (w *GinRouteBuilder) Use(middleware ...gin.HandlerFunc) *GinRouteBuilder {
|
||||
}
|
||||
|
||||
func (w *GinRouteBuilder) Handle(handler WHandlerFunc) {
|
||||
|
||||
middlewareNames := langext.ArrMap(w.handlers, func(v gin.HandlerFunc) string { return nameOfFunction(v) })
|
||||
handlerName := nameOfFunction(handler)
|
||||
|
||||
w.handlers = append(w.handlers, Wrap(w.routes.wrapper, handler))
|
||||
for _, m := range w.methods {
|
||||
w.routes.routes.Handle(m, w.relPath, w.handlers...)
|
||||
|
||||
methodName := w.method
|
||||
|
||||
if w.method == "*" {
|
||||
methodName = "ANY"
|
||||
for _, method := range anyMethods {
|
||||
w.routes.routes.Handle(method, w.relPath, w.handlers...)
|
||||
}
|
||||
} else {
|
||||
w.routes.routes.Handle(w.method, w.relPath, w.handlers...)
|
||||
}
|
||||
|
||||
w.routes.wrapper.routeSpecs = append(w.routes.wrapper.routeSpecs, ginRouteSpec{
|
||||
Method: methodName,
|
||||
URL: w.relPath,
|
||||
Middlewares: middlewareNames,
|
||||
Handler: handlerName,
|
||||
})
|
||||
}
|
||||
|
||||
func (w *GinWrapper) NoRoute(handler WHandlerFunc) {
|
||||
w.engine.NoRoute(Wrap(w, handler))
|
||||
|
||||
w.routeSpecs = append(w.routeSpecs, ginRouteSpec{
|
||||
Method: "ANY",
|
||||
URL: "[NO_ROUTE]",
|
||||
Middlewares: nil,
|
||||
Handler: nameOfFunction(handler),
|
||||
})
|
||||
}
|
||||
|
||||
func nameOfFunction(f any) string {
|
||||
|
||||
fname := runtime.FuncForPC(reflect.ValueOf(f).Pointer()).Name()
|
||||
|
||||
split := strings.Split(fname, "/")
|
||||
if len(split) == 0 {
|
||||
return ""
|
||||
}
|
||||
|
||||
fname = split[len(split)-1]
|
||||
|
||||
// https://stackoverflow.com/a/32925345/1761622
|
||||
if strings.HasSuffix(fname, "-fm") {
|
||||
fname = fname[:len(fname)-len("-fm")]
|
||||
}
|
||||
|
||||
suffix := rext.W(regexp.MustCompile("\\.func[0-9]+$"))
|
||||
|
||||
if match, ok := suffix.MatchFirst(fname); ok {
|
||||
fname = fname[:len(fname)-match.FullMatch().Length()]
|
||||
}
|
||||
|
||||
return fname
|
||||
}
|
||||
|
@@ -1,5 +1,5 @@
|
||||
package goext
|
||||
|
||||
const GoextVersion = "0.0.188"
|
||||
const GoextVersion = "0.0.207"
|
||||
|
||||
const GoextVersionTimestamp = "2023-07-24T10:42:39+0200"
|
||||
const GoextVersionTimestamp = "2023-07-25T10:47:00+0200"
|
||||
|
Reference in New Issue
Block a user