gofiberentities

package
v0.0.0-...-be30c67 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrorResponseType

type ErrorResponseType struct {
	TraceId string `json:"trace_id"`
	Msg     string `json:"message"`
}

type IResponse

type IResponse interface {
	Success(code int, data any) IResponse
	Error(code int, tractId, msg string) IResponse
	Response() error
}

func NewResponse

func NewResponse(c *fiber.Ctx) IResponse

type Image

type Image struct {
	Id       string `db:"id" json:"id"`
	FileName string `db:"filename" json:"filename"`
	Url      string `db:"url" json:"url"`
}

type PaginateRes

type PaginateRes struct {
	Data      any `json:"data"`
	Page      int `json:"page"`
	Limit     int `json:"limit"`
	TotalPage int `json:"total_page"`
	TotalItem int `json:"total_item"`
}

type PaginationRequest

type PaginationRequest struct {
	Page      int `query:"page"`
	Limit     int `query:"limit"`
	TotalPage int `query:"total_page" json:"total_page"`
	TotalItem int `query:"total_item" json:"totla_item"`
}

type Response

type Response struct {
	StatusCode    int
	Data          any
	ErrorResponse *ErrorResponseType
	Context       *fiber.Ctx
	IsError       bool
}

func (*Response) Error

func (r *Response) Error(code int, tractId, msg string) IResponse

func (*Response) Response

func (r *Response) Response() error

func (*Response) Success

func (r *Response) Success(code int, data any) IResponse

type SortRequest

type SortRequest struct {
	OrderBy string `query:"order_by"`
	Sort    string `query:"sort"` // DESC | ASC
}

Jump to

Keyboard shortcuts

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