Documentation ¶
Index ¶
- Variables
- func AuthMiddleware(c *gin.Context, config *config.ChaosDashboardConfig)
- func SetAPIError(c *gin.Context, err *errorx.Error)
- func SetAPImachineryError(c *gin.Context, err error)
- func ShouldBindBodyWithJSON(c *gin.Context, obj interface{}) (err error)
- type APIError
- type MapStringSliceResponse
- type Response
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrNS = errorx.NewNamespace("error.api") ErrUnknown = ErrNS.NewType("unknown") // 500 ErrBadRequest = ErrNS.NewType("bad_request") // 400 ErrNotFound = ErrNS.NewType("resource_not_found") // 404 ErrInternalServer = ErrNS.NewType("internal_server_error") // 500 // Custom ErrNoClusterPrivilege = ErrNS.NewType("no_cluster_privilege") // 401 ErrNoNamespacePrivilege = ErrNS.NewType("no_namespace_privilege") // 401 )
View Source
var Log = ctrl.Log.WithName("apiserver")
View Source
var (
ResponseSuccess = Response{Status: "success"}
)
Functions ¶
func AuthMiddleware ¶
func AuthMiddleware(c *gin.Context, config *config.ChaosDashboardConfig)
func SetAPImachineryError ¶
func ShouldBindBodyWithJSON ¶
Types ¶
type MapStringSliceResponse ¶
MapSliceResponse is an alias of map[string][]string.
Click to show internal directories.
Click to hide internal directories.