server

package
v0.0.0-...-6f82975 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2021 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddUser

func AddUser(c *fiber.Ctx) error

AddUser function

func Auth

func Auth(c *fiber.Ctx) error

Auth authentication handler

func Hello

func Hello(c *fiber.Ctx) error

Hello handler https://docs.gofiber.io/api/ctx

func Home

func Home(c *fiber.Ctx) error

Home handler

func RespJSON

func RespJSON(c *fiber.Ctx) error

RespJSON handler https://docs.gofiber.io/api/ctx#json

func Timeout

func Timeout(c *fiber.Ctx) error

Timeout handler

Types

type ErrorResponse

type ErrorResponse struct {
	FailedField string
	Tag         string
	Value       string
}

ErrorResponse struct

func ValidateStruct

func ValidateStruct(user User) []*ErrorResponse

ValidateStruct function

type Job

type Job struct {
	Type   string `json:"type" validate:"required,min=3,max=32"`
	Salary int    `json:"salary" validate:"required,number"`
}

Job struct

type User

type User struct {
	Name     string `json:"name" validate:"required,min=3,max=32"`
	IsActive bool   `json:"isactive" validate:"required,eq=True|eq=False"`
	Email    string `json:"email" validate:"required,email,min=6,max=32"`
	Job      Job    `json:"job" validate:"dive"`
}

User struct

Jump to

Keyboard shortcuts

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