Documentation ¶
Index ¶
- Constants
- Variables
- func CheckPort(port string) string
- func CreateRedirect(redirecter Redirecter) gin.HandlerFunc
- func CreateRedirectString(target string) gin.HandlerFunc
- func DefaultErrorRedirect(logger log.Logger, errorMsg string) string
- func FilterErrorMsg(logger log.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 log.Logger, err error)
- func MapToValueSlice[K comparable, V any](objects map[K]V) []V
- func WriteError(urlBuilder *strings.Builder, logger log.Logger, errorMsg string)
- type DataAdder
- type LocalesManager
- type Redirecter
- type Set
- type Stack
- type TemplateRedirecter
Constants ¶
View Source
const ( RedirectName = "Redirect" BaseUrlName = "BaseUrl" UserIdName = "Id" // current connected user id ViewedUserName = "ViewedUser" AllowedToCreateName = "AllowedToCreate" AllowedToUpdateName = "AllowedToUpdate" AllowedToDeleteName = "AllowedToDelete" )
View Source
const ( ErrorKey = "error" QueryError = "?" + errorKeyEq AddQueryError = "&" + errorKeyEq PathQueryError = "/" + QueryError )
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 ReportingPlaceName = "reporting_place"
View Source
const WrongLangKey = "WrongLang"
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 FilterErrorMsg ¶ added in v1.10.0
func FilterExtractHtml ¶ added in v0.2.0
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 LocalesManager ¶ added in v1.10.3
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.