utils

package
v0.0.0-...-ad3f63c Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPaginatedResponse

func BuildPaginatedResponse(c *fiber.Ctx, data interface{}, page, pageSize int, hasNext bool) error

func Collection

func Collection(collectionName string) *mongo.Collection

Types

type PaginatedResponse

type PaginatedResponse struct {
	Ctx        *fiber.Ctx
	Data       interface{}
	Page       int
	PageSize   int
	TotalUsers int
}

type Response

type Response struct {
	Status  int        `json:"status"`
	Message string     `json:"message"`
	Data    *fiber.Map `json:"data"`
}

func NewErrorResponse

func NewErrorResponse(status int, message string) *Response

func NewSuccessResponse

func NewSuccessResponse(status int, message string, data *fiber.Map) *Response

Jump to

Keyboard shortcuts

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