utils

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MustAtoi

func MustAtoi(s string) int

func ParseDate

func ParseDate(layoutDate string, dateString string) time.Time

func SendJSONError

func SendJSONError(w http.ResponseWriter, err error, statusCode int)

func SendJSONResponse

func SendJSONResponse(w http.ResponseWriter, data any, statusCode int)

func ValidateStruct

func ValidateStruct[T any](data T) error

Types

type PaginationMetadata

type PaginationMetadata struct {
	Page       int `json:"page"`
	PageSize   int `json:"pageSize"`
	TotalItems int `json:"totalItems"`
	TotalPages int `json:"totalPages"`
}

Jump to

Keyboard shortcuts

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