Documentation
¶
Index ¶
- func BasicAuth(user, password string) string
- func CompareStringSlices(sliceA, sliceB []string) bool
- func CreatePaginationMeta(total, limit, page, seed int) *base_models.PaginationResult
- func EliminateDuplicates[T comparable](input []T) (result []T)
- func ExtractFullAuth0IdFromContext(c *gin.Context) (auth0FullId string, err error)
- func ExtractLanguageFromContext(c *gin.Context) (language *base_models.Language, err error)
- func ExtractUserFromContext(c *gin.Context) (user *base_models.User, err error)
- func GenerateRandomString(length int, pools ...Pool) (string, error)
- func InitSlice[T comparable](length int, defaultValue T) (result []T)
- func IntegerToInterfaceSlice(input []int) []interface{}
- func MustExtractFullAuth0IdFromContext(c *gin.Context) (auth0FullId string)
- func MustExtractLanguageFromContext(c *gin.Context) *base_models.Language
- func MustExtractUserFromContext(c *gin.Context) *base_models.User
- func MustGenerateNewUid() uint64
- func ParsePaginationInput(input *base_input.Pagination)
- func ParseSearchInput(inputSearchPairs []string, allowedSearchFields []string) (searchPairs []base_input.SearchPair, err error)
- func ParseSortInput(inputSortPairs []string, allowedSortFields []string, defaultField string, ...) (sortPairs []base_input.SortPair, err error)
- func ReadResponseBody(response *http.Response, target interface{}) error
- func RemoveElement[T comparable](input []T, removeElement T) (result []T)
- func ReportPrivateError(c *gin.Context, apiError *response.ApiError, meta interface{})
- func ReportPrivateErrorAndAbort(c *gin.Context, apiError *response.ApiError, meta interface{})
- func ReportPublicError(c *gin.Context, apiError *response.ApiError, meta interface{})
- func ReportPublicErrorAndAbort(c *gin.Context, apiError *response.ApiError, meta interface{})
- func SliceContains[T comparable](haystack []T, needle T) bool
- func StringSliceContains(haystack []string, needle string) bool
- func StringToInterfaceSlice(input []string) []interface{}
- func ToAnySlice[T any](input []T) []any
- func UploadMimetypeContains(file *multipart.FileHeader, hasMime string) (contains bool, err error)
- func WrapErrorWithEmail(err error, email string) error
- func WrapErrorWithEosnId(err error, eosnId string) error
- func WrapErrorWithId(err error, id int) error
- func WrapErrorWithName(err error, name string) error
- type Pool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BasicAuth ¶
BasicAuth creates the base64 encoded string containing user:password for basic authentication headers
func CompareStringSlices ¶
CompareStringSlices takes two string slices and compares its content. Returns true if both slices contain the same elements and the same number of elements. It does not check the order.
func CreatePaginationMeta ¶
func CreatePaginationMeta(total, limit, page, seed int) *base_models.PaginationResult
func EliminateDuplicates ¶
func EliminateDuplicates[T comparable](input []T) (result []T)
func ExtractUserFromContext ¶
func InitSlice ¶
func InitSlice[T comparable](length int, defaultValue T) (result []T)
InitSlice initializes a new slice of the length and initializes each field with the given default value
func IntegerToInterfaceSlice ¶
func IntegerToInterfaceSlice(input []int) []interface{}
func MustGenerateNewUid ¶
func MustGenerateNewUid() uint64
func ParsePaginationInput ¶
func ParsePaginationInput(input *base_input.Pagination)
func ParseSearchInput ¶
func ParseSearchInput(inputSearchPairs []string, allowedSearchFields []string) (searchPairs []base_input.SearchPair, err error)
func ParseSortInput ¶
func ParseSortInput(inputSortPairs []string, allowedSortFields []string, defaultField string, defaultDir base_input.Direction) (sortPairs []base_input.SortPair, err error)
func ReadResponseBody ¶
ReadResponseBody reads the body of the given response without modifying it and tries to unmarshal it into the given target interface.
func RemoveElement ¶
func RemoveElement[T comparable](input []T, removeElement T) (result []T)
func ReportPrivateError ¶
func ReportPublicError ¶
func SliceContains ¶
func SliceContains[T comparable](haystack []T, needle T) bool
func StringSliceContains ¶
func StringToInterfaceSlice ¶
func StringToInterfaceSlice(input []string) []interface{}
func ToAnySlice ¶
func UploadMimetypeContains ¶
func UploadMimetypeContains(file *multipart.FileHeader, hasMime string) (contains bool, err error)
func WrapErrorWithEmail ¶
func WrapErrorWithEosnId ¶
func WrapErrorWithId ¶
func WrapErrorWithName ¶
Types ¶
type Pool ¶
type Pool string
const ( UppercaseLetterPool Pool = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" LowercaseLetterPool Pool = "abcdefghijklmnopqrstuvwxyz" NumberPool Pool = "0123456789" AlphanumericPool Pool = UppercaseLetterPool + LowercaseLetterPool + NumberPool )
Click to show internal directories.
Click to hide internal directories.