mirror of
https://github.com/SecurityBrewery/catalyst.git
synced 2025-12-09 16:52:51 +01:00
56 lines
1.4 KiB
Go
56 lines
1.4 KiB
Go
package statistics
|
|
|
|
// This file was generated by the swagger tool.
|
|
// Editing this file might prove futile when you re-run the swagger generate command
|
|
|
|
import (
|
|
"context"
|
|
"net/http"
|
|
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/go-openapi/errors"
|
|
|
|
"github.com/SecurityBrewery/catalyst/generated/restapi/api"
|
|
)
|
|
|
|
// GetStatisticsEndpoint executes the core logic of the related
|
|
// route endpoint.
|
|
func GetStatisticsEndpoint(handler func(ctx context.Context) *api.Response) gin.HandlerFunc {
|
|
return func(ctx *gin.Context) {
|
|
|
|
resp := handler(ctx)
|
|
|
|
switch resp.Code {
|
|
case http.StatusNoContent:
|
|
ctx.AbortWithStatus(resp.Code)
|
|
default:
|
|
ctx.JSON(resp.Code, resp.Body)
|
|
}
|
|
}
|
|
}
|
|
|
|
// NewGetStatisticsParams creates a new GetStatisticsParams object
|
|
// with the default values initialized.
|
|
func NewGetStatisticsParams() *GetStatisticsParams {
|
|
var ()
|
|
return &GetStatisticsParams{}
|
|
}
|
|
|
|
// GetStatisticsParams contains all the bound params for the get statistics operation
|
|
// typically these are obtained from a http.Request
|
|
//
|
|
// swagger:parameters getStatistics
|
|
type GetStatisticsParams struct {
|
|
}
|
|
|
|
// ReadRequest both binds and validates a request, it assumes that complex things implement a Validatable(strfmt.Registry) error interface
|
|
// for simple values it will use straight method calls
|
|
func (o *GetStatisticsParams) ReadRequest(ctx *gin.Context) error {
|
|
var res []error
|
|
|
|
if len(res) > 0 {
|
|
return errors.CompositeValidationError(res...)
|
|
}
|
|
return nil
|
|
}
|