Initial QSfera import

This commit is contained in:
Курнат Андрей
2026-06-07 10:20:04 +03:00
commit 2315f25754
16485 changed files with 4826827 additions and 0 deletions
+38
View File
@@ -0,0 +1,38 @@
package gocloak
import (
"strings"
)
// HTTPErrorResponse is a model of an error response
type HTTPErrorResponse struct {
Error string `json:"error,omitempty"`
Message string `json:"errorMessage,omitempty"`
Description string `json:"error_description,omitempty"`
}
// String returns a string representation of an error
func (e HTTPErrorResponse) String() string {
var res strings.Builder
if len(e.Error) > 0 {
res.WriteString(e.Error)
}
if len(e.Message) > 0 {
if res.Len() > 0 {
res.WriteString(": ")
}
res.WriteString(e.Message)
}
if len(e.Description) > 0 {
if res.Len() > 0 {
res.WriteString(": ")
}
res.WriteString(e.Description)
}
return res.String()
}
// NotEmpty validates that error is not emptyp
func (e HTTPErrorResponse) NotEmpty() bool {
return len(e.Error) > 0 || len(e.Message) > 0 || len(e.Description) > 0
}