common

package
v0.0.0-...-062da64 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fail

func Fail(c *gin.Context, err error)

Fail generate fail response

func ParseDataSelectPathParameter

func ParseDataSelectPathParameter(request *gin.Context) *dataselect.DataSelectQuery

ParseDataSelectPathParameter parses query parameters of the request and returns a DataSelectQuery object

func ParseNamespacePathParameter

func ParseNamespacePathParameter(request *gin.Context) *common.NamespaceQuery

parseNamespacePathParameter parses namespace selector for list pages in path parameter. The namespace selector is a comma separated list of namespaces that are trimmed. No namespaces mean "view all user namespaces", i.e., everything except kube-system.

func Response

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

func Success

func Success(c *gin.Context, obj interface{})

Success generate success response

Types

type BaseResponse

type BaseResponse struct {
	Code int         `json:"code"`
	Msg  string      `json:"message"`
	Data interface{} `json:"data"`
}

Jump to

Keyboard shortcuts

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