http

package
v0.0.0-...-af6c1de Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2024 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Int64ToByte

func Int64ToByte(i int64) []byte

Types

type ErrorDetail

type ErrorDetail struct {
	Error       bool   `json:"-"`
	FailedField string `json:"failed_field"`
	Tag         string `json:"criteria"`
	Value       any    `json:"value"`
	Message     string `json:"message"`
}

type GlobalErrorHandlerResp

type GlobalErrorHandlerResp struct {
	Success bool   `json:"success"`
	Message string `json:"message"`
}

type HttpErrorHandler

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

func (HttpErrorHandler) Response

func (h HttpErrorHandler) Response(c *fiber.Ctx, err error) error

type HttpServer

type HttpServer struct {
	App *fiber.App

	ErrorHandler *HttpErrorHandler
	// contains filtered or unexported fields
}

func New

func New(port string, logger log.Logger, swaggerOn bool) *HttpServer

func (*HttpServer) Cleanup

func (h *HttpServer) Cleanup()

func (*HttpServer) Start

func (h *HttpServer) Start()

type Validator

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

func NewValidator

func NewValidator(validate *validator.Validate) *Validator

func (Validator) Validate

func (v Validator) Validate(data any) []ErrorDetail

func (Validator) ValidateField

func (v Validator) ValidateField(field any, fieldName, tag string) *ErrorDetail

Jump to

Keyboard shortcuts

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