Documentation
¶
Index ¶
- func AddListeners(ls ...*Listener)
- func ClearListeners()
- type Builder
- func (r *Builder) Buffer(buffer []byte) *Builder
- func (r *Builder) Build() *Render
- func (r *Builder) Code(code int) *Builder
- func (r *Builder) ContentType(contentType string) *Builder
- func (r *Builder) Cookies(cookies []*http.Cookie) *Builder
- func (r *Builder) DefaultBuild() *Render
- func (r *Builder) Header(header http.Header) *Builder
- 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)
- func (ctx *Context) Bind(structPtr interface{})
- func (ctx *Context) BindAndValidate(structPtr interface{}, call func())
- func (ctx *Context) BindAndValidateWithParams(structPtr interface{}, messageName, message, codeName string, code int, ...)
- 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) Download(file, filename string)
- func (ctx *Context) FSFile(fs *embed.FS, name string)
- func (ctx *Context) File(file 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() http.Header
- 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, 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) error
- func (ctx *Context) Redirect(url string)
- func (ctx *Context) Render(r *Render)
- func (ctx *Context) Rendered() *Render
- 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) 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) Validate(structPtr interface{}, call func())
- func (ctx *Context) ValidateWithParams(structPtr interface{}, messageName, message, codeName string, code int, ...)
- func (ctx *Context) Write(buffer []byte)
- func (ctx *Context) WriteCode(code int)
- 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 Render
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder struct
func (*Builder) ContentType ¶
ContentType render
type Context ¶
type Context struct { Logger *logrus.Logger Request *http.Request MultipartMap map[string][]*MultipartFile // contains filtered or unexported fields }
Context struct
func (*Context) AddFuncMap ¶
AddFuncMap add funcMap
func (*Context) BindAndValidate ¶
func (ctx *Context) BindAndValidate(structPtr interface{}, call func())
BindAndValidate struct ptr
func (*Context) BindAndValidateWithParams ¶
func (ctx *Context) BindAndValidateWithParams(structPtr interface{}, messageName, message, codeName string, code int, call func())
BindAndValidateWithParams struct ptr
func (*Context) FloatParam ¶
FloatParam return named param of float
func (*Context) GetDataMap ¶
GetDataMap get data map from context
func (*Context) HTMLFSFile ¶
HTMLFSFile render html rFS file
func (*Context) ImageFSFile ¶
ImageFSFile render image rFS file
func (*Context) JPEGFSFile ¶
JPEGFSFile render jpeg rFS file
func (*Context) JSONFSFile ¶
JSONFSFile render JSON rFS 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) 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 render template with rFS
func (*Context) TemplateFile ¶
TemplateFile render template with file
func (*Context) TextFSFile ¶
TextFSFile render text rFS file
func (*Context) Validate ¶
func (ctx *Context) Validate(structPtr interface{}, call func())
Validate struct ptr
func (*Context) ValidateWithParams ¶
func (ctx *Context) ValidateWithParams(structPtr interface{}, messageName, message, codeName string, code int, call func())
ValidateWithParams struct ptr
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) error
Copy source file in multiple