Documentation
¶
Index ¶
- func EnsureNonNilArr[T any](arr []T) []T
- func HandleError(c *gin.Context, err error)
- func IsFloat(v *reflect.Value) bool
- func IsInt(v *reflect.Value) bool
- func IsUint(v *reflect.Value) bool
- func NewHTTPError(code int, err error) error
- func NewHTTPErrorStr(code int, message string) error
- func ResponseArr[T any](c *gin.Context, statusCode int, data []T)
- func ResponseCreatedArr[T any](c *gin.Context, data []T)
- func ResponseErr(c *gin.Context, httpStatusCode int, err ...error)
- func ResponseErrStr(c *gin.Context, httpStatusCode int, message ...string)
- func ResponseOKArr[T any](c *gin.Context, data []T)
- type APPContext
- type ArrayResponse
- type ErrorMessage
- type ErrorMessageDTO
- type HTTPError
- type ParamDef
- type RequestParam
- func (p *RequestParam) AddContextParam(name string, empty bool, pattern *regexp.Regexp) *ParamDef
- func (p *RequestParam) AddCookieParam(name string, empty bool, pattern *regexp.Regexp) *ParamDef
- func (p *RequestParam) AddQueryParam(name string, empty bool, pattern *regexp.Regexp) *ParamDef
- func (p *RequestParam) AddUrlParam(name string, empty bool, pattern *regexp.Regexp) *ParamDef
- func (p *RequestParam) Handle(c *gin.Context) error
- func (p *RequestParam) HandleWithBody(c *gin.Context, body interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnsureNonNilArr ¶
func EnsureNonNilArr[T any](arr []T) []T
func HandleError ¶
func NewHTTPError ¶
func NewHTTPErrorStr ¶
func ResponseCreatedArr ¶
func ResponseOKArr ¶
Types ¶
type APPContext ¶
type APPContext struct {
GithubAppSettings *models.GitHubAppSettings
ServiceMap map[string]interface{}
Config *config.Config
GithubAppClient *github.Client
RepoBasePath string
LogDirPath string
Version string
CookieDomain string
}
func (*APPContext) MustGetService ¶
func (c *APPContext) MustGetService(name string) interface{}
func (*APPContext) RegisterService ¶
func (c *APPContext) RegisterService(name string, service interface{})
type ArrayResponse ¶
func NewArrayResponse ¶
func NewArrayResponse[T any](data []T) ArrayResponse[T]
type ErrorMessage ¶
type ErrorMessage struct {
Message string `json:"message"`
}
func NewErrorMessage ¶
func NewErrorMessage(err ...error) []ErrorMessage
func NewErrorMessageStr ¶
func NewErrorMessageStr(err ...string) []ErrorMessage
type ErrorMessageDTO ¶
type ErrorMessageDTO struct {
HttpStatusCode int `json:"httpStatusCode"`
ErrorMessages []ErrorMessage `json:"errorMessages"`
}
func NewErrorMessageDTO ¶
func NewErrorMessageDTO(httpStatusCode int, err ...error) ErrorMessageDTO
func NewErrorMessageDTOStr ¶
func NewErrorMessageDTOStr(httpStatusCode int, message ...string) ErrorMessageDTO
type HTTPError ¶
func NewGormHTTPError ¶
type RequestParam ¶
func NewRequestParam ¶
func NewRequestParam() *RequestParam
func (*RequestParam) AddContextParam ¶
func (*RequestParam) AddCookieParam ¶
func (*RequestParam) AddQueryParam ¶
func (*RequestParam) AddUrlParam ¶
func (*RequestParam) HandleWithBody ¶
func (p *RequestParam) HandleWithBody(c *gin.Context, body interface{}) error
Click to show internal directories.
Click to hide internal directories.