lib

package
v0.0.0-...-df178f5 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ValidationError    = "VALIDATION_ERROR"
	MalformedJSON      = "MALFORMED_JSON"
	DupilcateShortCode = "DUPLICATE_SHORT_CODE"
	NotFound           = "NOT_FOUND"
	InvalidShortCode   = "INVALID_SHORT_CODE"
)
View Source
const (
	Unauthorized  = "UNAUTHORIZED"
	Forbidden     = "FORBIDDEN"
	InvalidInput  = "INVALID_INPUT"
	DatabaseError = "DATABASE_ERROR"
	NetworkError  = "NETWORK_ERROR"
	InternalError = "INTERNAL_SERVER_ERROR"
)

Variables

This section is empty.

Functions

func BindAndValidate

func BindAndValidate(c echo.Context, i interface{}) error

func GenerateShortCode

func GenerateShortCode() (string, error)

func GetEnv

func GetEnv(key string, fallback ...string) string

func GetServerAddress

func GetServerAddress() string

func LoadEnv

func LoadEnv()

Types

type Error

type Error struct {
	Message string `json:"message"`
	Code    string `json:"code"`
	Details any    `json:"details,omitempty"`
}

type Validator

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

func NewValidator

func NewValidator() *Validator

func (*Validator) Validate

func (v *Validator) Validate(i interface{}) error

Jump to

Keyboard shortcuts

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