utils

package
v0.0.0-...-a69a74b Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CleanUpMockDatabase

func CleanUpMockDatabase(db *database.Database, collName string)

func ErrorHandler

func ErrorHandler() gin.HandlerFunc

func GenerateID

func GenerateID() int

func Graceful

func Graceful(server *http.Server, timeout time.Duration)

func NewServiceError

func NewServiceError(message string, code int, data *interface{}) error

func SetUpMockDatabase

func SetUpMockDatabase(t *testing.T) *database.Database

Types

type ServiceError

type ServiceError struct {
	Message string
	Code    int
}

func (*ServiceError) Error

func (e *ServiceError) Error() string

func (*ServiceError) GetCode

func (e *ServiceError) GetCode() int

Jump to

Keyboard shortcuts

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