utils

package
v0.0.0-...-c3bc016 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenerateShortLink(link string, key string) (string, error)

GenerateShortLink generates a short code form a link

Types

type HTTPError

type HTTPError struct {
	Code    int         `json:"code"`
	Message string      `json:"message"`
	Details interface{} `json:"details,omitempty"`
}

HTTPError represents an HTTP error.

type ValidatorError

type ValidatorError struct {
	FailedField string
	Tag         string
	Value       string
}

ValidatorError represents error validation struct.

func ValidateStruct

func ValidateStruct(task interface{}) (errors []*ValidatorError)

ValidateStruct checks if a struct is valid and returns an array of errors if it is not valid.

Jump to

Keyboard shortcuts

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