Documentation
¶
Index ¶
- func AddListeners(ls ...*Listener)
- func ClearListeners()
- type Context
- func (ctx *Context) Add(handlers ...func(ctx *Context)) *Context
- func (ctx *Context) AddCookie(cookies ...*http.Cookie) *Context
- func (ctx *Context) AddFunc(name string, funcMap interface{}) *Context
- func (ctx *Context) AddFuncMap(funcMap template.FuncMap) *Context
- func (ctx *Context) BMP(buffer []byte)
- func (ctx *Context) BMPFSFile(fs *embed.FS, name string)
- func (ctx *Context) BMPFile(bmpFile string)
- func (ctx *Context) Binary(buffer []byte, contentType string)
- func (ctx *Context) Bind(structPtr interface{})
- func (ctx *Context) CSS(css string)
- func (ctx *Context) CSSFSFile(fs *embed.FS, name string)
- func (ctx *Context) CSSFile(cssFile string)
- func (ctx *Context) Chain()
- func (ctx *Context) Data(data []byte) *Context
- func (ctx *Context) Download(file, filename string)
- func (ctx *Context) FSFile(fs *embed.FS, name, contentType string)
- func (ctx *Context) File(file, contentType string)
- func (ctx *Context) FloatParam(name string, defaultVal float64) float64
- func (ctx *Context) GIF(buffer []byte)
- func (ctx *Context) GIFFSFile(fs *embed.FS, name string)
- func (ctx *Context) GIFFile(gifFile string)
- func (ctx *Context) GetData(name string) interface{}
- func (ctx *Context) GetDataMap() map[string]interface{}
- func (ctx *Context) HTML(html string)
- func (ctx *Context) HTMLFSFile(fs *embed.FS, name string)
- func (ctx *Context) HTMLFile(htmlFile string)
- func (ctx *Context) HasParam(name string) bool
- func (ctx *Context) Header(header http.Header) *Context
- func (ctx *Context) ICO(buffer []byte)
- func (ctx *Context) ICOFSFile(fs *embed.FS, name string)
- func (ctx *Context) ICOFile(icoFile string)
- func (ctx *Context) Image(buffer []byte)
- func (ctx *Context) ImageFSFile(fs *embed.FS, name string)
- func (ctx *Context) ImageFile(imageFile string)
- func (ctx *Context) IntKey() int64
- func (ctx *Context) IntParam(name string, defaultVal int64) int64
- func (ctx *Context) JPEG(buffer []byte)
- func (ctx *Context) JPEGFSFile(fs *embed.FS, name string)
- func (ctx *Context) JPEGFile(jpegFile string)
- func (ctx *Context) JPG(buffer []byte)
- func (ctx *Context) JPGFSFile(fs *embed.FS, name string)
- func (ctx *Context) JPGFile(jpgFile string)
- func (ctx *Context) JS(js string)
- func (ctx *Context) JSFSFile(fs *embed.FS, name string)
- func (ctx *Context) JSFile(jsFile string)
- func (ctx *Context) JSON(data interface{})
- func (ctx *Context) JSONFSFile(fs *embed.FS, name string)
- func (ctx *Context) JSONFile(jsonFile string)
- func (ctx *Context) JSONText(json string)
- func (ctx *Context) JoinedParamMap(separator string) map[string]string
- func (ctx *Context) Key() string
- func (ctx *Context) MultipartFile(name string) *MultipartFile
- func (ctx *Context) MultipartFiles(name string) []*MultipartFile
- func (ctx *Context) PNG(buffer []byte)
- func (ctx *Context) PNGFSFile(fs *embed.FS, name string)
- func (ctx *Context) PNGFile(pngFile string)
- func (ctx *Context) Param(name string) string
- func (ctx *Context) ParamDefault(name, defaultVal string) string
- func (ctx *Context) ParamMap() map[string][]string
- func (ctx *Context) Params(name string, defaultVal []string) []string
- func (ctx *Context) ParseMultipart(maxMemory int64)
- func (ctx *Context) Redirect(url string)
- func (ctx *Context) SetData(name string, value interface{}) *Context
- func (ctx *Context) SetDataMap(dataMap map[string]interface{}, flush bool) *Context
- func (ctx *Context) SetParamMap(paramMap map[string][]string, flush bool) *Context
- func (ctx *Context) SingleParamMap() map[string]string
- func (ctx *Context) Status(status int) *Context
- func (ctx *Context) Template(tpl string, data map[string]interface{})
- func (ctx *Context) TemplateFS(FS *embed.FS, prefix string, data map[string]interface{})
- func (ctx *Context) TemplateFile(prefix string, data map[string]interface{})
- func (ctx *Context) Text(text string)
- func (ctx *Context) TextFSFile(fs *embed.FS, name string)
- func (ctx *Context) TextFile(textFile string)
- func (ctx *Context) Write(r *Response)
- func (ctx *Context) XML(data interface{})
- func (ctx *Context) XMLFSFile(fs *embed.FS, name string)
- func (ctx *Context) XMLFile(xmlFile string)
- func (ctx *Context) XMLText(xml string)
- type Listener
- type MultipartFile
- type Response
- type ResponseBuilder
- func (r *ResponseBuilder) Build() *Response
- func (r *ResponseBuilder) ContentType(contentType string) *ResponseBuilder
- func (r *ResponseBuilder) Cookies(cookies []*http.Cookie) *ResponseBuilder
- func (r *ResponseBuilder) Data(data []byte) *ResponseBuilder
- func (r *ResponseBuilder) DefaultBuild() *Response
- func (r *ResponseBuilder) Header(header http.Header) *ResponseBuilder
- func (r *ResponseBuilder) Status(status int) *ResponseBuilder
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Context ¶
type Context struct { Request *http.Request Response *Response MultipartMap map[string][]*MultipartFile // contains filtered or unexported fields }
Context struct
func (*Context) AddFuncMap ¶
AddFuncMap add funcMap
func (*Context) FloatParam ¶
FloatParam return named param of float
func (*Context) GetDataMap ¶
GetDataMap get data map from context
func (*Context) HTMLFSFile ¶
HTMLFSFile Response html FS file
func (*Context) ImageFSFile ¶
ImageFSFile Response image FS file
func (*Context) JPEGFSFile ¶
JPEGFSFile Response jpeg FS file
func (*Context) JSONFSFile ¶
JSONFSFile Response JSON FS file
func (*Context) JoinedParamMap ¶
JoinedParamMap return joined single value param map
func (*Context) MultipartFile ¶
func (ctx *Context) MultipartFile(name string) *MultipartFile
MultipartFile get multiple file
func (*Context) MultipartFiles ¶
func (ctx *Context) MultipartFiles(name string) []*MultipartFile
MultipartFiles get multiple files
func (*Context) ParamDefault ¶
ParamDefault return named param
func (*Context) ParseMultipart ¶
ParseMultipart parse multiple Request
func (*Context) SetDataMap ¶
SetDataMap Set data map into context
func (*Context) SetParamMap ¶
SetParamMap set param map
func (*Context) SingleParamMap ¶
SingleParamMap return single value param map
func (*Context) TemplateFS ¶
TemplateFS Response template with rFS
func (*Context) TemplateFile ¶
TemplateFile Response template with file
func (*Context) TextFSFile ¶
TextFSFile Response text FS file
type Listener ¶
type Listener struct { // Created Listener Created func(c *Context) // Destroyed Listener Destroyed func(c *Context) }
Listener interface
type MultipartFile ¶
type MultipartFile struct { // ContentType Content type ContentType string // FileHeader file headers FileHeader *multipart.FileHeader }
MultipartFile struct
func (*MultipartFile) Copy ¶
func (file *MultipartFile) Copy(distName string)
Copy source file in multiple
type Response ¶
type Response struct { Data []byte Header http.Header Cookies []*http.Cookie Status int ContentType string }
Response struct
type ResponseBuilder ¶
type ResponseBuilder struct {
// contains filtered or unexported fields
}
ResponseBuilder struct
func (*ResponseBuilder) ContentType ¶
func (r *ResponseBuilder) ContentType(contentType string) *ResponseBuilder
ContentType Response
func (*ResponseBuilder) Cookies ¶
func (r *ResponseBuilder) Cookies(cookies []*http.Cookie) *ResponseBuilder
Cookies Response
func (*ResponseBuilder) Data ¶
func (r *ResponseBuilder) Data(data []byte) *ResponseBuilder
Data Response
func (*ResponseBuilder) DefaultBuild ¶
func (r *ResponseBuilder) DefaultBuild() *Response
DefaultBuild Response
func (*ResponseBuilder) Header ¶
func (r *ResponseBuilder) Header(header http.Header) *ResponseBuilder
Header Response
func (*ResponseBuilder) Status ¶
func (r *ResponseBuilder) Status(status int) *ResponseBuilder
Status Response