Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPort(port string) string
- func CreateRedirect(redirecter Redirecter) gin.HandlerFunc
- func CreateRedirectString(target string) gin.HandlerFunc
- func DefaultErrorRedirect(logger *slog.Logger, errorMsg string) string
- func FilterErrorMsg(logger *slog.Logger, errorMsg string) string
- func FilterExtractHtml(html string, extractSize uint64) string
- func GetBaseUrl(levelToErase uint8, c *gin.Context) string
- func GetCurrentUrl(c *gin.Context) string
- func GetPagination(defaultPageSize uint64, c *gin.Context) (uint64, uint64, uint64, string)
- func InitPagination(data gin.H, filter string, pageNumber uint64, end uint64, total uint64)
- func LogOriginalError(logger *slog.Logger, err error)
- func MapToValueSlice[K comparable, V any](objects map[K]V) []V
- func WriteError(urlBuilder *strings.Builder, logger *slog.Logger, errorMsg string)
- type DataAdder
- type LoggerGetter
- type Redirecter
- type Set
- type Stack
- type TemplateRedirecter
Constants ¶
View Source
const ( BaseUrlName = "BaseUrl" RedirectName = "Redirect" AllowedToCreateName = "AllowedToCreate" AllowedToUpdateName = "AllowedToUpdate" AllowedToDeleteName = "AllowedToDelete" )
View Source
const ( UserIdName = "Id" // current connected user id ViewedUserName = "ViewedUser" UrlName = "CurrentUrl" SessionName = "Session" )
View Source
const ( ErrorBadRoleNameKey = "ErrorBadRoleName" ErrorBaseVersionKey = "BaseVersionOutdated" ErrorEmptyCommentKey = "EmptyComment" ErrorEmptyLoginKey = "EmptyLogin" ErrorEmptyPasswordKey = "EmptyPassword" ErrorExistingLoginKey = "ExistingLogin" ErrorNotAuthorizedKey = "ErrorNotAuthorized" ErrorTechnicalKey = "ErrorTechnicalProblem" ErrorUpdateKey = "ErrorUpdate" ErrorWeakPasswordKey = "WeakPassword" ErrorWrongConfirmPasswordKey = "WrongConfirmPassword" ErrorWrongLangKey = "WrongLang" ErrorWrongLoginKey = "WrongLogin" )
error displayed to user
View Source
const ErrorKey = "error"
View Source
const QueryError = "?" + ErrorKey + "="
Variables ¶
View Source
var ( ErrBadRoleName = errors.New(ErrorBadRoleNameKey) ErrBaseVersion = errors.New(ErrorBaseVersionKey) ErrEmptyComment = errors.New(ErrorEmptyCommentKey) ErrEmptyLogin = errors.New(ErrorEmptyLoginKey) ErrEmptyPassword = errors.New(ErrorEmptyPasswordKey) ErrExistingLogin = errors.New(ErrorExistingLoginKey) ErrNotAuthorized = errors.New(ErrorNotAuthorizedKey) ErrTechnical = errors.New(ErrorTechnicalKey) ErrUpdate = errors.New(ErrorUpdateKey) ErrWeakPassword = errors.New(ErrorWeakPasswordKey) ErrWrongConfirm = errors.New(ErrorWrongConfirmPasswordKey) ErrWrongLogin = errors.New(ErrorWrongLoginKey) )
Functions ¶
func CreateRedirect ¶
func CreateRedirect(redirecter Redirecter) gin.HandlerFunc
func CreateRedirectString ¶
func CreateRedirectString(target string) gin.HandlerFunc
func FilterExtractHtml ¶
html must be well formed
func GetCurrentUrl ¶
func GetPagination ¶
func InitPagination ¶
func LogOriginalError ¶
func MapToValueSlice ¶
func MapToValueSlice[K comparable, V any](objects map[K]V) []V
Types ¶
type Redirecter ¶
type Set ¶
type Set[V comparable] map[V]empty
func MakeSet ¶
func MakeSet[V comparable](values []V) Set[V]
Click to show internal directories.
Click to hide internal directories.