Documentation
¶
Index ¶
- type AttrCode
- type AttrData
- type AttrMsg
- type HTTPResponse
- func New(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewCreated(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewDeleted(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewForbidden(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewInternalServerError(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewNotFound(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewOK(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewUnPermission(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewUnauthorized(attrs ...HTTPResponseAttributer) HTTPResponse
- func NewUpdated(attrs ...HTTPResponseAttributer) HTTPResponse
- func (my HTTPResponse) JSON(c *gin.Context)
- func (my HTTPResponse) Raw() (int, any)
- func (my HTTPResponse) SetAttrs(attrs ...HTTPResponseAttributer) HTTPResponse
- func (my HTTPResponse) SetData(data any) HTTPResponse
- func (my HTTPResponse) SetError(err error) HTTPResponse
- func (my HTTPResponse) SetErrorf(format string, a ...any) HTTPResponse
- func (my HTTPResponse) SetMsg(msg string) HTTPResponse
- func (my HTTPResponse) TOML(c *gin.Context)
- func (my HTTPResponse) WithAccept(c *gin.Context)
- func (my HTTPResponse) WithoutCodeJSON(c *gin.Context)
- func (my HTTPResponse) WithoutCodeTOML(c *gin.Context)
- func (my HTTPResponse) WithoutCodeXML(c *gin.Context)
- func (my HTTPResponse) WithoutCodeYAML(c *gin.Context)
- func (my HTTPResponse) XML(c *gin.Context)
- func (my HTTPResponse) YAML(c *gin.Context)
- type HTTPResponseAttributer
- func Created() HTTPResponseAttributer
- func Data(data any) HTTPResponseAttributer
- func Deleted() HTTPResponseAttributer
- func Error(err error) HTTPResponseAttributer
- func Errorf(format string, a ...any) HTTPResponseAttributer
- func Forbidden() HTTPResponseAttributer
- func InternalServerError() HTTPResponseAttributer
- func Msg(msg string) HTTPResponseAttributer
- func NotFound() HTTPResponseAttributer
- func OK() HTTPResponseAttributer
- func UnPermission() HTTPResponseAttributer
- func Unauthorized() HTTPResponseAttributer
- func Updated() HTTPResponseAttributer
- type HealthResponse
- type HealthSystem
- type HealthTime
- type HealthVSCode
- type HealthVSCodeConfiguration
- type HealthWebService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AttrCode ¶
type AttrCode struct {
// contains filtered or unexported fields
}
******************** HTTPResponseAttributer 实现 ******************** //
func (AttrCode) Register ¶
func (my AttrCode) Register(res *HTTPResponse)
type AttrData ¶
type AttrData struct {
// contains filtered or unexported fields
}
******************** HTTPResponseAttributer 实现 ******************** //
func (AttrData) Register ¶
func (my AttrData) Register(res *HTTPResponse)
type AttrMsg ¶
type AttrMsg struct {
// contains filtered or unexported fields
}
******************** HTTPResponseAttributer 实现 ******************** //
func (AttrMsg) Register ¶
func (my AttrMsg) Register(res *HTTPResponse)
type HTTPResponse ¶
******************** HTTPResponse 定义 ******************** //
func New ¶
func New(attrs ...HTTPResponseAttributer) HTTPResponse
func NewCreated ¶
func NewCreated(attrs ...HTTPResponseAttributer) HTTPResponse
func NewDeleted ¶
func NewDeleted(attrs ...HTTPResponseAttributer) HTTPResponse
func NewForbidden ¶
func NewForbidden(attrs ...HTTPResponseAttributer) HTTPResponse
func NewInternalServerError ¶
func NewInternalServerError(attrs ...HTTPResponseAttributer) HTTPResponse
func NewNotFound ¶
func NewNotFound(attrs ...HTTPResponseAttributer) HTTPResponse
func NewOK ¶
func NewOK(attrs ...HTTPResponseAttributer) HTTPResponse
func NewUnPermission ¶
func NewUnPermission(attrs ...HTTPResponseAttributer) HTTPResponse
func NewUnauthorized ¶
func NewUnauthorized(attrs ...HTTPResponseAttributer) HTTPResponse
func NewUpdated ¶
func NewUpdated(attrs ...HTTPResponseAttributer) HTTPResponse
func (HTTPResponse) JSON ¶
func (my HTTPResponse) JSON(c *gin.Context)
func (HTTPResponse) Raw ¶
func (my HTTPResponse) Raw() (int, any)
func (HTTPResponse) SetAttrs ¶
func (my HTTPResponse) SetAttrs(attrs ...HTTPResponseAttributer) HTTPResponse
func (HTTPResponse) SetData ¶
func (my HTTPResponse) SetData(data any) HTTPResponse
func (HTTPResponse) SetError ¶
func (my HTTPResponse) SetError(err error) HTTPResponse
func (HTTPResponse) SetErrorf ¶
func (my HTTPResponse) SetErrorf(format string, a ...any) HTTPResponse
func (HTTPResponse) SetMsg ¶
func (my HTTPResponse) SetMsg(msg string) HTTPResponse
func (HTTPResponse) TOML ¶
func (my HTTPResponse) TOML(c *gin.Context)
func (HTTPResponse) WithAccept ¶
func (my HTTPResponse) WithAccept(c *gin.Context)
func (HTTPResponse) WithoutCodeJSON ¶
func (my HTTPResponse) WithoutCodeJSON(c *gin.Context)
func (HTTPResponse) WithoutCodeTOML ¶
func (my HTTPResponse) WithoutCodeTOML(c *gin.Context)
func (HTTPResponse) WithoutCodeXML ¶
func (my HTTPResponse) WithoutCodeXML(c *gin.Context)
func (HTTPResponse) WithoutCodeYAML ¶
func (my HTTPResponse) WithoutCodeYAML(c *gin.Context)
func (HTTPResponse) XML ¶
func (my HTTPResponse) XML(c *gin.Context)
func (HTTPResponse) YAML ¶
func (my HTTPResponse) YAML(c *gin.Context)
type HTTPResponseAttributer ¶
type HTTPResponseAttributer interface{ Register(res *HTTPResponse) }
******************** HTTPResponseAttributer 实现 ******************** //
func Created ¶
func Created() HTTPResponseAttributer
func Data ¶
func Data(data any) HTTPResponseAttributer
func Deleted ¶
func Deleted() HTTPResponseAttributer
func Error ¶
func Error(err error) HTTPResponseAttributer
func Errorf ¶
func Errorf(format string, a ...any) HTTPResponseAttributer
func Forbidden ¶
func Forbidden() HTTPResponseAttributer
func InternalServerError ¶
func InternalServerError() HTTPResponseAttributer
func Msg ¶
func Msg(msg string) HTTPResponseAttributer
func NotFound ¶
func NotFound() HTTPResponseAttributer
func OK ¶
func OK() HTTPResponseAttributer
func UnPermission ¶
func UnPermission() HTTPResponseAttributer
func Unauthorized ¶
func Unauthorized() HTTPResponseAttributer
func Updated ¶
func Updated() HTTPResponseAttributer
type HealthResponse ¶
type HealthResponse struct {
Time HealthTime `json:"time" yaml:"time" toml:"time"`
System HealthSystem `json:"system" yaml:"system" toml:"system"`
WebService HealthWebService `json:"webService" yaml:"webService" toml:"webService"`
VSCodeLaunch HealthVSCode `json:"vscodeLaunchFile" yaml:"vscodeLaunchFile" toml:"vscodeLaunchFile"`
}
type HealthSystem ¶
type HealthTime ¶
type HealthVSCode ¶
type HealthVSCode struct {
Version string `json:"version" yaml:"version" toml:"version"`
Configurations []HealthVSCodeConfiguration `json:"configurations" yaml:"configurations" toml:"configurations"`
}
type HealthVSCodeConfiguration ¶
type HealthVSCodeConfiguration struct {
Name string `json:"name" yaml:"name" toml:"name"`
Type string `json:"type" yaml:"type" toml:"type"`
Request string `json:"request" yaml:"request" toml:"request"`
Mode string `json:"mode" yaml:"mode" toml:"mode"`
Program string `json:"program" yaml:"program" toml:"program"`
Env map[string]string `json:"env" yaml:"env" toml:"env"`
Args []string `json:"args" yaml:"args" toml:"args"`
BuildFlags []string `json:"buildFlags" yaml:"buildFlags" toml:"buildFlags"`
}
type HealthWebService ¶
type HealthWebService struct {
Cors bool `json:"cors" yaml:"cors" toml:"cors"`
}
Click to show internal directories.
Click to hide internal directories.