controller

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Dec 31, 2022 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(db *gorm.DB, ctx *fiber.Ctx) (string, error)

Create is a function that creates the cache in the database.

func Delete

func Delete(id string, db *gorm.DB, ctx *fiber.Ctx) error

Delete is a function that deletes the cache from the database.

func GetValue

func GetValue(id string, db *gorm.DB, ctx *fiber.Ctx) (string, error)

GetValue is a function that gets the cache from the database.

func Update

func Update(id string, db *gorm.DB, ctx *fiber.Ctx) (string, error)

Update is a function that updates the cache in the database.

Types

type CacheReq

type CacheReq struct {
	Value string `json:"value" xml:"value" form:"value" validate:"required,min=1"`
}

Cache is a struct that represents the request body.

type ErrorResponse

type ErrorResponse struct {
	FailedField string
	Tag         string
	Value       string
}

ErrorResponse is a struct that represents the error response.

func Validator

func Validator(cache *CacheReq) []*ErrorResponse

Validator is a function that validates the request body.

Jump to

Keyboard shortcuts

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