utils

package
v0.0.0-...-cc09eb9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 5, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorStatus = map[string]string{
	"400": "Некорректный запрос",
	"401": "Необходима авторизация",
	"403": "Запрещено",
	"404": "Не найдено",
	"408": "Истекло время ожидания",
	"413": "Слишком большая нагрузка",
	"414": "Слишком длинный URI",
	"429": "Слишком много запросов",
	"500": "Внутреняя ошибка сервера",
	"502": "Неверный шлюз",
	"503": "Сервис недоступен",
	"505": "Версия HTTP не поддерживается",
	"520": "Неизвестная ошибка",
}

Error statuses

Functions

func Contains

func Contains(val uint64, slice ...uint64) bool

Contains for uint64[]

func DateMSK_ToLocaleSepString

func DateMSK_ToLocaleSepString(mock ...time.Time) string

Time functions: date to locale string with - separator

func DateMSK_ToLocaleString

func DateMSK_ToLocaleString(mock ...time.Time) string

Time functions: date to locale string

func GetAuthLinks() fiber.Map

OAuth links

func HashSHA512

func HashSHA512(str string) string

SHA512 hash

func IsEmptyStruct

func IsEmptyStruct(object interface{}) bool

Check for empty

func IterateStruct

func IterateStruct(s interface{}, callback func(field string, value interface{}))

Iterate over struct with callback

func TimeMSK_ToLocaleString

func TimeMSK_ToLocaleString(mock ...time.Time) string

Time functions: to locale string

func TimeMSK_ToString

func TimeMSK_ToString(mock ...time.Time) string

Time functions: to string

func TimeMSK_ToTime

func TimeMSK_ToTime(mock ...time.Time) time.Time

Time functions: to time

Types

type Sitemap

type Sitemap []SitemapPath

Sitemap: type

func (*Sitemap) Nest

func (p *Sitemap) Nest() *Sitemap

Sitemap: nest sitemap

func (*Sitemap) ToHTMLString

func (p *Sitemap) ToHTMLString() *string

Sitemap: convert sitemap to HTML

type SitemapPath

type SitemapPath struct {
	ID       int64         `json:"id"`
	ParentID int64         `json:"parent_id"`
	Title    string        `json:"title"`
	Path     string        `json:"path"`
	Priority float64       `json:"priority"`
	Children []SitemapPath `json:"children"`
}

Sitemap: SitemapPath type

type URLParams

type URLParams map[string]interface{}

URL params: type

func (*URLParams) ToString

func (p *URLParams) ToString(escaped bool) string

URL params: toString

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL