Documentation ¶
Index ¶
- Constants
- func SaveUploadedFile(file *multipart.FileHeader, dst string) error
- func ToGinHandlerFunc(handler HandlerFunc, digestAuth *login.DigestAuth) gin.HandlerFunc
- func ToGinHandlerFuncs(handlers []HandlerFunc, digestAuth *login.DigestAuth) []gin.HandlerFunc
- type File
- type HandlerFunc
- type HttpServer
- func (hs *HttpServer) Any(pattern string, handlers ...HandlerFunc)
- func (hs *HttpServer) DELETE(pattern string, handlers ...HandlerFunc)
- func (hs *HttpServer) GET(pattern string, handlers ...HandlerFunc)
- func (hs *HttpServer) HasPaths(queryPath string) bool
- func (hs *HttpServer) IsTls() bool
- func (hs *HttpServer) POST(pattern string, handlers ...HandlerFunc)
- func (hs *HttpServer) PUT(pattern string, handlers ...HandlerFunc)
- func (hs *HttpServer) SignIn(pattern string, handlers ...HandlerFunc)
- func (hs *HttpServer) Start(port int) error
- func (hs *HttpServer) StartAutoTLS(port int, certFile, keyFile string) error
- func (hs *HttpServer) StartTLS(port int, certFile, keyFile string) error
- func (hs *HttpServer) StaticHandle(relativePath string, filepath string)
- func (hs *HttpServer) Stop()
- type Page
- type PageAble
- type Request
- func (r *Request) BodyJson(v any) ([]byte, error)
- func (r *Request) FormFile(name string) (*multipart.FileHeader, error)
- func (r *Request) FormInt64Value(key string) int64
- func (r *Request) FormIntValue(key string) int
- func (r *Request) FormValue(key string) string
- func (r *Request) GetContext() *gin.Context
- func (r *Request) GetDigestAuth() *login.DigestAuth
- func (r *Request) GetHeader(key string) string
- func (r *Request) GetPage() *Page
- func (r *Request) GetRawRequest() *http.Request
- func (r *Request) GetRemoteAddress() string
- func (r *Request) GetResponseWriter() http.ResponseWriter
- func (r *Request) Header(key, value string)
- func (r *Request) IsForm() bool
- func (r *Request) IsMultipartForm() bool
- func (r *Request) MultipartForm() (*multipart.Form, error)
- func (r *Request) Param(key string) string
- func (r *Request) ShouldBindBodyWithJSON(obj any) error
- func (r *Request) Status(code int)
- func (r *Request) String(code int, format string, values ...any)
Constants ¶
View Source
const MaxHeaderBytes = 8192
View Source
const MaxReadHeaderTimeout = time.Second * 30
View Source
const MaxReadTimeout = time.Minute * 10
Variables ¶
This section is empty.
Functions ¶
func SaveUploadedFile ¶
func SaveUploadedFile(file *multipart.FileHeader, dst string) error
func ToGinHandlerFunc ¶
func ToGinHandlerFunc(handler HandlerFunc, digestAuth *login.DigestAuth) gin.HandlerFunc
func ToGinHandlerFuncs ¶
func ToGinHandlerFuncs(handlers []HandlerFunc, digestAuth *login.DigestAuth) []gin.HandlerFunc
Types ¶
type File ¶
func (*File) GetFilename ¶
type HandlerFunc ¶
type HttpServer ¶
type HttpServer struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(digestAuth *login.DigestAuth) *HttpServer
func (*HttpServer) Any ¶
func (hs *HttpServer) Any(pattern string, handlers ...HandlerFunc)
func (*HttpServer) DELETE ¶
func (hs *HttpServer) DELETE(pattern string, handlers ...HandlerFunc)
func (*HttpServer) GET ¶
func (hs *HttpServer) GET(pattern string, handlers ...HandlerFunc)
func (*HttpServer) HasPaths ¶
func (hs *HttpServer) HasPaths(queryPath string) bool
func (*HttpServer) IsTls ¶
func (hs *HttpServer) IsTls() bool
func (*HttpServer) POST ¶
func (hs *HttpServer) POST(pattern string, handlers ...HandlerFunc)
func (*HttpServer) PUT ¶
func (hs *HttpServer) PUT(pattern string, handlers ...HandlerFunc)
func (*HttpServer) SignIn ¶
func (hs *HttpServer) SignIn(pattern string, handlers ...HandlerFunc)
func (*HttpServer) Start ¶
func (hs *HttpServer) Start(port int) error
func (*HttpServer) StartAutoTLS ¶
func (hs *HttpServer) StartAutoTLS(port int, certFile, keyFile string) error
func (*HttpServer) StartTLS ¶
func (hs *HttpServer) StartTLS(port int, certFile, keyFile string) error
func (*HttpServer) StaticHandle ¶
func (hs *HttpServer) StaticHandle(relativePath string, filepath string)
func (*HttpServer) Stop ¶ added in v0.1.12
func (hs *HttpServer) Stop()
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func NewRequest ¶
func NewRequest(context *gin.Context, digestAuth *login.DigestAuth) *Request
func (*Request) FormInt64Value ¶
func (*Request) FormIntValue ¶
func (*Request) GetContext ¶
func (*Request) GetDigestAuth ¶
func (r *Request) GetDigestAuth() *login.DigestAuth
func (*Request) GetRawRequest ¶
func (*Request) GetRemoteAddress ¶
func (*Request) GetResponseWriter ¶
func (r *Request) GetResponseWriter() http.ResponseWriter
func (*Request) IsMultipartForm ¶
func (*Request) ShouldBindBodyWithJSON ¶
Click to show internal directories.
Click to hide internal directories.