Documentation ¶
Index ¶
- Variables
- func AssetUrl(path string) string
- func BadRequestError(c echo.Context) error
- func Decompress(in io.Reader, out io.Writer) error
- func ExtractIdFromString(s string) string
- func GetFileNameFromUrl(url string, extension bool) string
- func IsHtmxRequest(c echo.Context) bool
- func IsHtmxRequestMiddleware(next echo.HandlerFunc) echo.HandlerFunc
- func NotFoundError(c echo.Context) error
- func RemoveExtension(s string) string
- func SendToastMessage(message string, t string, closeDialog bool, c echo.Context, trigger string)
- func ServerFaultError(c echo.Context) error
- func SetHxTrigger(c echo.Context, data map[string]any)
- func Slugify(s string) string
- func StrippedHTML(s string) string
- type Century
- type Composer
- type Pagination
- func (p *Pagination) FirstPart() []string
- func (p *Pagination) GetActivePageWrapper(text string) string
- func (p *Pagination) GetAvailablePageWrapper(href, page, htmxUrl string) string
- func (p *Pagination) GetDisabledPageWrapper(text string) string
- func (p *Pagination) GetDots() string
- func (p *Pagination) GetNextButton(text string) string
- func (p *Pagination) GetPreviousButton(text string) string
- func (p *Pagination) HasPages() bool
- func (p *Pagination) LastPart() []string
- func (p *Pagination) MiddlePart() []string
- func (p *Pagination) Render() template.HTML
- func (p *Pagination) TotalPages() int
- type Song
- type UrlData
Constants ¶
This section is empty.
Variables ¶
var TemplateFuncs = template.FuncMap{ "now": time.Now, "timeSince": time.Since, "timeUntil": time.Until, "formatTime": formatTime, "approxDuration": approxDuration, "uppercase": strings.ToUpper, "lowercase": strings.ToLower, "pluralize": pluralize, "slugify": Slugify, "safeHTML": safeHTML, "strippedHTML": StrippedHTML, "removeExt": RemoveExtension, "join": strings.Join, "incr": incr, "incrBy": incrBy, "decr": decr, "decrBy": decrBy, "formatInt": formatInt, "formatFloat": formatFloat, "yesno": yesno, "urlSetParam": urlSetParam, "urlDelParam": urlDelParam, "getFileNameFromUrl": GetFileNameFromUrl, "marshalJSON": marshalJSON, }
Functions ¶
func BadRequestError ¶ added in v0.17.0
func BadRequestError(c echo.Context) error
func ExtractIdFromString ¶ added in v0.0.31
ExtractIdFromString extracts the ID from a string.
func GetFileNameFromUrl ¶
func IsHtmxRequest ¶
func IsHtmxRequest(c echo.Context) bool
IsHtmxRequest checks if the request is an htmx request by checking the value of the "HX-Request" header.
func IsHtmxRequestMiddleware ¶ added in v0.17.0
func IsHtmxRequestMiddleware(next echo.HandlerFunc) echo.HandlerFunc
func NotFoundError ¶ added in v0.0.31
func NotFoundError(c echo.Context) error
NotFoundError is a handler that returns a 404 error page.
func RemoveExtension ¶
func SendToastMessage ¶ added in v0.11.0
func ServerFaultError ¶ added in v0.0.31
func ServerFaultError(c echo.Context) error
func SetHxTrigger ¶ added in v0.11.0
func StrippedHTML ¶
Types ¶
type Pagination ¶
type Pagination struct {
// contains filtered or unexported fields
}
func NewPagination ¶
func NewPagination(totalAmount, perPage, currentPage int, baseUrl string, htmxTarget string, htmxUrl string) *Pagination
NewPagination constructor
func (*Pagination) FirstPart ¶
func (p *Pagination) FirstPart() []string
FirstPart returns the first part of the pagination.
func (*Pagination) GetActivePageWrapper ¶
func (p *Pagination) GetActivePageWrapper(text string) string
GetActivePageWrapper returns an HTML string representing the active page link for pagination. The function takes a `text` parameter, which is the text to be displayed inside the link. It generates an HTML string with the active page link using the provided `text`.
func (*Pagination) GetAvailablePageWrapper ¶
func (p *Pagination) GetAvailablePageWrapper(href, page, htmxUrl string) string
GetAvailablePageWrapper returns a string representing a pagination link with the given href, page number, and htmxUrl. If htmxTarget is specified, it adds the hx-target attribute to the link.
func (*Pagination) GetDisabledPageWrapper ¶
func (p *Pagination) GetDisabledPageWrapper(text string) string
GetDisabledPageWrapper returns a disabled page wrapper HTML element for pagination. It takes a `text` parameter representing the text to be displayed within the wrapper. The method returns a string containing the disabled page wrapper HTML element.
func (*Pagination) GetDots ¶
func (p *Pagination) GetDots() string
GetDots returns the HTML representation of the dots used for pagination ellipsis.
func (*Pagination) GetNextButton ¶
func (p *Pagination) GetNextButton(text string) string
GetNextButton returns the HTML code for the next button in the pagination. If the current page is the last page, it returns the disabled page wrapper. Otherwise, it returns the URL for the next page with the specified text.
func (*Pagination) GetPreviousButton ¶
func (p *Pagination) GetPreviousButton(text string) string
GetPreviousButton returns the HTML string for the previous button in the pagination. If the current page is the first page, it returns a disabled button. Otherwise, it returns a button with the URL for the previous page and the specified text.
func (*Pagination) HasPages ¶
func (p *Pagination) HasPages() bool
HasPages returns true if there are more than one pages in the pagination.
func (*Pagination) LastPart ¶
func (p *Pagination) LastPart() []string
LastPart returns the last part of the pagination.
func (*Pagination) MiddlePart ¶
func (p *Pagination) MiddlePart() []string
MiddlePart returns the middle part of the pagination.
func (*Pagination) Render ¶
func (p *Pagination) Render() template.HTML
Render generates the HTML for the pagination component and returns it as a template.HTML value.
func (*Pagination) TotalPages ¶
func (p *Pagination) TotalPages() int
TotalPages returns the total number of pages in the pagination.