Documentation
¶
Index ¶
- func BuildPaginationInfo(page, pageSize, totalCount int) models.PaginationInfo
- func BuildPaginationInfoWithSorting(page, pageSize, totalCount int, sortBy, sortDirection string) models.PaginationInfo
- func CalculateTotalPages(totalCount int, pageSize int) int
- func CheckVATExists(vat, entityType, excludeID string) (bool, error)
- func GeneratePassword() (string, error)
- func GetEffectiveUserID(user *models.User) string
- func GetPaginationAndSortingFromQuery(c *gin.Context) (int, int, string, string)
- func GetPaginationFromQuery(c *gin.Context) (int, int)
- func GetPasswordRequirements() []string
- func GetSortingFromQuery(c *gin.Context) (string, string)
- func GetUserContextExtended(c *gin.Context) (string, string, string, string)
- func GetUserFromContext(c *gin.Context) (*models.User, bool)
- func HashSystemSecret(secret string) (string, error)
- func ValidatePasswordStrength(password string) (bool, []string)
- func VerifySystemSecret(secret, encodedHash string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildPaginationInfo ¶
func BuildPaginationInfo(page, pageSize, totalCount int) models.PaginationInfo
BuildPaginationInfo creates a standard pagination info object
func BuildPaginationInfoWithSorting ¶
func BuildPaginationInfoWithSorting(page, pageSize, totalCount int, sortBy, sortDirection string) models.PaginationInfo
BuildPaginationInfoWithSorting creates a standard pagination info object with sorting information
func CalculateTotalPages ¶
CalculateTotalPages calculates the total number of pages based on total count and page size
func CheckVATExists ¶
CheckVATExists checks if a VAT exists in the specified entity table
func GeneratePassword ¶
GeneratePassword generates a secure temporary password that passes our validation
func GetEffectiveUserID ¶
GetEffectiveUserID returns the effective user ID for a user For Owner users without a local database ID, returns "owner" as a fallback identifier This is used for audit logging and tracking operations by Owner users
func GetPaginationAndSortingFromQuery ¶
GetPaginationAndSortingFromQuery extracts page, pageSize, sortBy and sortDirection from query parameters
func GetPaginationFromQuery ¶
GetPaginationFromQuery extracts page and pageSize from query parameters
func GetPasswordRequirements ¶
func GetPasswordRequirements() []string
GetPasswordRequirements returns a list of password requirements for user display
func GetSortingFromQuery ¶
GetSortingFromQuery extracts sortBy and sortDirection from query parameters
func GetUserContextExtended ¶
GetUserContextExtended extracts user ID, organization ID, and role information from Gin context Returns userID, userOrgID, userOrgRole, userRole strings
func GetUserFromContext ¶
GetUserFromContext extracts user context data from Gin context Returns user object and boolean indicating success
func HashSystemSecret ¶
HashSystemSecret generates an Argon2id hash of the system secret The hash is stored in the PHC string format: $argon2id$v=19$m=65536,t=3,p=2$salt$hash
func ValidatePasswordStrength ¶
ValidatePasswordStrength validates password strength with simple, clear rules Returns only the first error found to guide user step by step
func VerifySystemSecret ¶
VerifySystemSecret verifies a system secret against an Argon2id hash Returns true if the secret matches the hash, false otherwise
Types ¶
This section is empty.