httpModule

package
v1.53.7 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2025 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

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

type HTTPResponse struct {
	Code int    `json:"code"`
	Msg  string `json:"msg"`
	Data any    `json:"data"`
}

******************** HTTPResponse 定义 ******************** //

func New

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 NotFound

func NotFound() HTTPResponseAttributer

func OK

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 HealthSystem struct {
	Debug    bool   `json:"debug" yaml:"debug" toml:"debug"`
	Version  string `json:"version" yaml:"version" toml:"version"`
	Daemon   bool   `json:"daemon" yaml:"daemon" toml:"daemon"`
	Timezone string `json:"timezone" yaml:"timezone" toml:"timezone"`
}

type HealthTime

type HealthTime struct {
	Now    time.Time `json:"now" yaml:"now" toml:"now"`
	String string    `json:"string" yaml:"string" toml:"string"`
}

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"`
}

Directories

Path Synopsis
v1HTTPModule

Jump to

Keyboard shortcuts

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