helper

package
v0.0.0-...-336782b Latest Latest
Warning

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

Go to latest
Published: Nov 23, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrorEmailAlreadyExists = errors.New("email already exists")
View Source
var ErrorInvalidLogin = errors.New("invalid email or password")
View Source
var ErrorUsernameAlreadyExists = errors.New("username already exists")
View Source
var TimeNowMillis = time.Now().UnixNano() / int64(time.Millisecond)
View Source
var UUID = uuid.New().String()

Functions

func GetErrorStatusCode

func GetErrorStatusCode(err error) int

Types

type ExampleErrorResponse

type ExampleErrorResponse struct {
	Message  string `json:"message" example:"user bad request"`
	Email    string `json:"email" example:"cannot be empty"`
	Password string `json:"password" example:"cannot be empty"`
}

this is for swagger needs

type Response

type Response struct {
	Status int         `json:"status"`
	Data   interface{} `json:"data,omitempty"`
	Error  interface{} `json:"error,omitempty"`
}

func NewResponse

func NewResponse(status int, data interface{}, error error) *Response

Jump to

Keyboard shortcuts

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