Documentation ¶
Index ¶
- func GeneratePassword(password string) string
- func GenerateRandomString(n int, runes string) string
- func GenerateUUID() string
- func GetCurrentPage(pageStr string) (currentPage int, err error)
- func GetDatePtr(year int, month time.Month, day int, hour int, min int, sec int, nsec int, ...) *time.Time
- func GetFileChecksumSHA512(filepath string) (string, error)
- func GetFileReaderChecksumSHA512(reader io.Reader) (string, error)
- func GetUnixDatePtr(nsec int64) *time.Time
- func JSONListTagged(obj interface{}, tag string) []byte
- func JSONPrettyPrint(in string) string
- func ObjectPrettyPrint(obj interface{}) string
- func ParseDatePtr(layout string, value string) *time.Time
- func ValidatePassword(hashedPassword string, password string) bool
- type Pagination
- type QueryOptions
- type ResponseWithPagination
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GeneratePassword ¶
GeneratePassword - crypt password
func GenerateRandomString ¶
func GenerateUUID ¶
func GenerateUUID() string
GenerateSecurityToken - func generate uuid4 based security token without "-"
func GetCurrentPage ¶
func GetDatePtr ¶
func GetDatePtr(year int, month time.Month, day int, hour int, min int, sec int, nsec int, loc *time.Location) *time.Time
GetDatePtr - get date as pointer
func GetFileChecksumSHA512 ¶
func GetUnixDatePtr ¶
GetUnixDatePtr - get date, GMT timezone, milliseconds since unix epoch
func JSONListTagged ¶
JSONListTagged - get tagged objects list
func ObjectPrettyPrint ¶
func ObjectPrettyPrint(obj interface{}) string
ObjectPrettyPrint - tady udelej hezke zobrazeni objektu skrz JSON
func ValidatePassword ¶
ValidatePassword - validate password
@hashedPassowrd: password stored at db, hashed form @password: password from form, not hashed
Types ¶
type Pagination ¶
type Pagination struct { Page int64 `json:"page" jsonList:"page"` // current page ItemsPerPage int64 `json:"itemsPerPage" jsonList:"itemsPerPage"` // Count of items per page PageStart int64 `json:"pageStart" jsonList:"pageStart"` // First page PageStop int64 `json:"pageStop" jsonList:"pageStop"` // Last page PageCount int64 `json:"pageCount" jsonList:"pageCount"` // Pages count PageNext int64 `json:"pageNext" jsonList:"pageNext"` // Next page PagePrev int64 `json:"pagePrev" jsonList:"pagePrev"` // Previous page ItemsCount int64 `json:"totalItems" jsonList:"totalItems"` // Count of all items in dataset }
Pagination - json is optimized for VuetifyJS
func (*Pagination) GetLimits ¶
func (me *Pagination) GetLimits(currentPage int64) (offset int64, limit int64, err error)
GetLimits - Vraci limity pro databazi
func (*Pagination) RecountValuesFromPage ¶
func (me *Pagination) RecountValuesFromPage() (err error)
RecountValuesFromPage - method recount values from page, itemsPerPage and itemsCount
func (*Pagination) SetValuesFromPage ¶
func (me *Pagination) SetValuesFromPage(currentPage int64, itemsPerPage int64, itemsCount int64)
SetValuesFromPage - set all values from current page and items per page AND recount it
type QueryOptions ¶
type QueryOptions struct { SortBy []string SortDesc []bool GroupBy []string GroupDesc []bool MultiSort bool MustSort bool }
QueryOptions - object
type ResponseWithPagination ¶
type ResponseWithPagination struct { Response interface{} PaginationObject Pagination }
ResponseWithPagination - Get response data with pagination object