api

package
v0.0.0-...-f10ba98 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const LinkExpireInHours = 2

Variables

This section is empty.

Functions

func BadRequestResponse

func BadRequestResponse(ctx echo.Context, message string) error

func CheckPasswordHash

func CheckPasswordHash(password, hash string) bool

func ErrorResponse

func ErrorResponse(ctx echo.Context, err error) error

func GenerateSecureToken

func GenerateSecureToken(id uuid.UUID) (string, error)

func GetDataFromSecureToken

func GetDataFromSecureToken(token string) (*uuid.UUID, error)

func HashData

func HashData(data string) (string, error)

func NotFoundResponse

func NotFoundResponse(ctx echo.Context, message string) error

func ServerErrorResponse

func ServerErrorResponse(ctx echo.Context) error

func SuccessResponse

func SuccessResponse(ctx echo.Context, data any) error

func ValidationErrorResponse

func ValidationErrorResponse(ctx echo.Context, errors map[string]string) error

Types

type Response

type Response struct {
	ErrorMessage    string            `json:"message,omitempty"`
	Data            interface{}       `json:"data,omitempty"`
	Error           bool              `json:"error"`
	ValidationError map[string]string `json:"validation_errors,omitempty"`
}

type ResponseWithPagination

type ResponseWithPagination struct {
	ErrorMessage    string            `json:"message,omitempty"`
	Data            interface{}       `json:"data,omitempty"`
	MetaData        interface{}       `json:"meta_data,omitempty"`
	Error           bool              `json:"error"`
	ValidationError map[string]string `json:"validation_errors,omitempty"`
}

type TableName

type TableName string
const (
	Invitations TableName = "invitation"
	Bride       TableName = "bride"
	Groom       TableName = "groom"
)

Directories

Path Synopsis
v1

Jump to

Keyboard shortcuts

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