utils

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2022 License: GPL-3.0 Imports: 7 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 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
}

type QuotedString

type QuotedString struct {
	// contains filtered or unexported fields
}

func NewQuotedString

func NewQuotedString(str string) QuotedString

func (*QuotedString) MarshalJSON

func (s *QuotedString) MarshalJSON() ([]byte, error)

func (*QuotedString) SetQuotedOutput

func (s *QuotedString) SetQuotedOutput()

func (*QuotedString) SetRawOutput

func (s *QuotedString) SetRawOutput()

func (QuotedString) String

func (s QuotedString) String() string

func (*QuotedString) UnmarshalJSON

func (s *QuotedString) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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