utils

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allocate

func Allocate[T any](val T) *T

func CalculateGridSize

func CalculateGridSize(cardsNumber int) (cols, rows int)

Allows you to find the minimum image size for all cards on the page

func CardIdToPageCoordinates

func CardIdToPageCoordinates(id, columns int) (column, row int)

Allows you to calculate the position of the card on the page by its identifier

func CompareMaps

func CompareMaps(one, two map[string]string) bool

func GetFileFromMultipart added in v0.2.0

func GetFileFromMultipart(name string, r *http.Request) ([]byte, error)

func HashForTime added in v0.2.3

func HashForTime(t *time.Time) string

func NameToID

func NameToID(in string) string

func Sort

func Sort[T ISortable](items *[]T, field string)

Types

type ISortable

type ISortable interface {
	GetName() string
	GetCreatedAt() time.Time
}

Jump to

Keyboard shortcuts

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