utils

package
v0.0.0-...-61f3a79 Latest Latest
Warning

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

Go to latest
Published: Nov 29, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application struct {
	Name    string
	Timeout int
}

type Configuration

type Configuration struct {
	Database DatabaseSetting
	Server   ServerSettings
	App      Application
}

type DatabaseSetting

type DatabaseSetting struct {
	Url        string
	DbName     string
	Collection string
}

type ResponseError

type ResponseError struct {
	Message string                 `json:"message"`
	Status  int                    `json:"status"`
	Error   string                 `json:"error"`
	Data    map[string]interface{} `json:"data"`
}

func BadRequestError

func BadRequestError(message string, err error, data map[string]interface{}) *ResponseError

BadRequestError return ResponseError with bad_request status and messages

func InternalServerError

func InternalServerError(message string, err error, data map[string]interface{}) *ResponseError

mcustom error return ResponseError with internal_server status and messages

func NotFoundRequestError

func NotFoundRequestError(message string, err error, data map[string]interface{}) *ResponseError

NotFoundRequestError return ResponseError with not_found status and messages

type ResponseResult

type ResponseResult struct {
	Message string                 `json:"message"`
	Data    map[string]interface{} `json:"data"`
}

func Response

func Response(message string, data map[string]interface{}) *ResponseResult

BadRequestError return ResponseError with bad_request status and messages

type ServerSettings

type ServerSettings struct {
	Port string
}

Jump to

Keyboard shortcuts

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