common

package
v0.0.0-...-b8a1a0e Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BadRequestResponse

func BadRequestResponse(c *gin.Context, optStatus string, description string)

func CheckJSONParam

func CheckJSONParam(jsonString string, v interface{}) error

CheckJSONParam check json parameters for redundancy. Does not support map[string]interface type in struct.

func ForwardMasterController

func ForwardMasterController(c *gin.Context, masterControllerName string, port int)

func GetAllKeys

func GetAllKeys(jsonString string) (map[string]bool, error)

GetAllKeys gets all json keys. Does not support map[string]interface type in struct.

func GetJsonTags

func GetJsonTags(v interface{}) map[string]bool

GetJsonTags get all json tags of struct. Does not support map[string]interface type in struct.

func HttpResponse

func HttpResponse(c *gin.Context, httpCode int, data interface{}, optStatus string, description string)

func InternalErrorResponse

func InternalErrorResponse(c *gin.Context, data interface{}, optStatus string, description string)

func JsonResponse

func JsonResponse(c *gin.Context, data interface{}, err error)

func ServiceUnavailableResponse

func ServiceUnavailableResponse(c *gin.Context, data interface{}, optStatus string, description string)

Types

type Response

type Response struct {
	OptStatus   string      `json:"OPT_STATUS"`
	Description string      `json:"DESCRIPTION"`
	Data        interface{} `json:"DATA"`
}

Jump to

Keyboard shortcuts

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