Documentation ¶
Index ¶
- Constants
- func ComputePages(current int, totalPage int64) []int
- func Enhance(app *view.HTMLEngine)
- func GetPageUrl(url string, index, pageCount int, siName string) string
- func Index(arr, value interface{}) int
- func Page(ctx *Context, ps int, total int64, showTotal bool, classes string) string
- func ParseTimeLocal(format, date string) (time.Time, error)
- func Render(app iris.Party, path string, html string, param ...interface{})
- func Rewrite(app iris.Party, from string, to string, statusCode ...int)
- func SendHtml(app iris.Party, path string, html string) error
- func SidFilter(ctx iris.Context)
- type Context
- func (ctx *Context) AddParamError(key, msg string)
- func (ctx *Context) AddScript(js string) string
- func (ctx *Context) AppendViewData(key string, values ...string)
- func (ctx *Context) CheckBody(field string) *Validator
- func (ctx *Context) CheckBodyValues(field string) *ValidatorValues
- func (ctx *Context) CheckFile(field string) *ValidatorFile
- func (ctx *Context) CheckPath(field string) *Validator
- func (ctx *Context) CheckQuery(field string) *Validator
- func (ctx *Context) Css(css ...string)
- func (ctx *Context) Do(handlers context.Handlers)
- func (ctx *Context) Err(status int, data interface{})
- func (ctx *Context) GetUid(uid interface{}) error
- func (ctx *Context) GetUidInt() int
- func (ctx *Context) GetUidInt64() int64
- func (ctx *Context) GetUidString() string
- func (ctx *Context) HasSignin() bool
- func (ctx *Context) Js(js ...string) string
- func (ctx *Context) Next()
- func (ctx *Context) Ok(data interface{})
- func (ctx *Context) ParamErrors() map[string]string
- func (ctx *Context) PathIndex(i int) string
- func (ctx *Context) PathLeft(count int) string
- func (ctx *Context) PathMatch(pattern string) bool
- func (ctx *Context) PathMid(start, length int) string
- func (ctx *Context) PathParent() string
- func (ctx *Context) PathRight(count int) string
- func (ctx *Context) ProxyPass(proxy, path string) error
- func (ctx *Context) QueryString() string
- func (ctx *Context) ReadValidate(form interface{}) bool
- func (ctx *Context) Redirect(urlToRedirect string, statusHeader ...int)
- func (ctx *Context) RedirectSignin(signinUrl string, needRedirectFrom bool)
- func (ctx *Context) RedirectWithFrom(uri string)
- func (ctx *Context) RemoveCookieLocal(key string)
- func (ctx *Context) Scripts() []string
- func (ctx *Context) SetCookieLocal(key, value string, maxAge int, httpOnly bool, domain string)
- func (ctx *Context) SetUid(uid interface{}, secs int)
- func (ctx *Context) Sid() string
- func (ctx *Context) Title(title string)
- func (ctx *Context) View(filename string, optionalViewModel ...interface{}) error
- type SessionProvider
- type Validator
- func (v *Validator) Bool(dv bool, msg ...string) bool
- func (v *Validator) ByteLen(min, max int, msg ...string) *Validator
- func (v *Validator) Date(dv time.Time, msg ...string) time.Time
- func (v *Validator) DateFormat(format string, dv time.Time, msg ...string) time.Time
- func (v *Validator) DateTime(dv time.Time, msg ...string) time.Time
- func (v *Validator) DateTimeShort(dv time.Time, msg ...string) time.Time
- func (v *Validator) Empty(msg ...string) *Validator
- func (v *Validator) Ensure(assertion, shouldBail bool, msg ...string) *Validator
- func (v *Validator) EnsureNot(assertion, shouldBail bool, msg ...string) *Validator
- func (v *Validator) Exist(msg ...string) *Validator
- func (v *Validator) Float(dv float64, msg ...string) float64
- func (v *Validator) Float32(dv float32, msg ...string) float32
- func (v *Validator) In(values []string, msg ...string) *Validator
- func (v *Validator) InInts(values []int, msg ...string) *Validator
- func (v *Validator) Int(dv int, msg ...string) int
- func (v *Validator) Int64(dv int64, msg ...string) int64
- func (v *Validator) IsASCII(msg ...string) *Validator
- func (v *Validator) IsAlpha(msg ...string) *Validator
- func (v *Validator) IsAlphanumeric(msg ...string) *Validator
- func (v *Validator) IsBool(msg ...string) *Validator
- func (v *Validator) IsEmail(msg ...string) *Validator
- func (v *Validator) IsFilePath(msg ...string) *Validator
- func (v *Validator) IsFloat(msg ...string) *Validator
- func (v *Validator) IsIP(msg ...string) *Validator
- func (v *Validator) IsInt(msg ...string) *Validator
- func (v *Validator) IsJSON(msg ...string) *Validator
- func (v *Validator) IsLowerCase(msg ...string) *Validator
- func (v *Validator) IsNumeric(msg ...string) *Validator
- func (v *Validator) IsTime(format string, msg ...string) *Validator
- func (v *Validator) IsUpperCase(msg ...string) *Validator
- func (v *Validator) IsUrl(msg ...string) *Validator
- func (v *Validator) Json(r interface{}, msg ...string)
- func (v *Validator) Len(min, max int, msg ...string) *Validator
- func (v *Validator) Match(reg string, msg ...string) *Validator
- func (v *Validator) NotBlank(msg ...string) *Validator
- func (v *Validator) NotEmpty(msg ...string) *Validator
- func (v *Validator) NotMatch(reg string, msg ...string) *Validator
- func (v *Validator) Optional() *Validator
- func (v *Validator) Present() bool
- func (v *Validator) SanitizeHtml() string
- func (v *Validator) String(dv ...string) string
- func (v *Validator) Time(dv time.Time, msg ...string) time.Time
- func (v *Validator) TimeShort(dv time.Time, msg ...string) time.Time
- func (v *Validator) Trim() *Validator
- type ValidatorFile
- func (v *ValidatorFile) Copy(dstFile string)
- func (v *ValidatorFile) Empty(msg ...string) *ValidatorFile
- func (v *ValidatorFile) ExtIn(exts []string, msg ...string) *ValidatorFile
- func (v *ValidatorFile) IsImage(msg ...string) *ValidatorFile
- func (v *ValidatorFile) Len(min, max int64, msg ...string) *ValidatorFile
- func (v *ValidatorFile) NotEmpty(msg ...string) *ValidatorFile
- func (v *ValidatorFile) Optional() *ValidatorFile
- type ValidatorValues
- func (v *ValidatorValues) Empty(msg ...string) *ValidatorValues
- func (v *ValidatorValues) Ensure(assertion, shouldBail bool, msg ...string) *ValidatorValues
- func (v *ValidatorValues) EnsureNot(assertion, shouldBail bool, msg ...string) *ValidatorValues
- func (v *ValidatorValues) Float32(dv []float32, msg ...string) []float32
- func (v *ValidatorValues) Floats(dv []float64, msg ...string) []float64
- func (v *ValidatorValues) Ints(dv []int, msg ...string) []int
- func (v *ValidatorValues) Len(min, max int, msg ...string) *ValidatorValues
- func (v *ValidatorValues) Match(reg string, msg ...string) *ValidatorValues
- func (v *ValidatorValues) NotEmpty(msg ...string) *ValidatorValues
- func (v *ValidatorValues) NotMatch(reg string, msg ...string) *ValidatorValues
- func (v *ValidatorValues) Optional() *ValidatorValues
- func (v *ValidatorValues) Strings(dv []string, msg ...string) []string
Constants ¶
View Source
const ( RequestKeyParamErrors = "ParamErrors" RequestKeyScripts = "Scripts" )
View Source
const (
TypeCastError = 1 + iota
)
Variables ¶
This section is empty.
Functions ¶
func ComputePages ¶
Types ¶
type Context ¶
type Context struct { context.Context BeforeView func(ctx *Context, tplFile string) SessionProvider SessionProvider }
type H map[string]interface{}
func (*Context) AddParamError ¶
func (*Context) AppendViewData ¶
func (*Context) CheckBodyValues ¶
func (ctx *Context) CheckBodyValues(field string) *ValidatorValues
func (*Context) CheckFile ¶
func (ctx *Context) CheckFile(field string) *ValidatorFile
func (*Context) CheckQuery ¶
func (*Context) GetUidInt64 ¶ added in v0.0.3
func (*Context) GetUidString ¶ added in v0.0.3
func (*Context) ParamErrors ¶
func (*Context) PathParent ¶
func (*Context) QueryString ¶
func (*Context) ReadValidate ¶
func (*Context) RedirectSignin ¶
func (*Context) RedirectWithFrom ¶
func (*Context) RemoveCookieLocal ¶
func (*Context) SetCookieLocal ¶
type SessionProvider ¶ added in v0.0.3
type Validator ¶
type Validator struct {
// contains filtered or unexported fields
}
func NewValidator ¶
func (*Validator) DateFormat ¶
func (*Validator) DateTimeShort ¶
func (*Validator) IsAlphanumeric ¶
func (*Validator) IsFilePath ¶
func (*Validator) IsLowerCase ¶
func (*Validator) IsUpperCase ¶
type ValidatorFile ¶
type ValidatorFile struct {
// contains filtered or unexported fields
}
func NewValidatorFile ¶
func NewValidatorFile(ctx *Context, key string, file multipart.File, header *multipart.FileHeader, exists bool) *ValidatorFile
func (*ValidatorFile) Copy ¶
func (v *ValidatorFile) Copy(dstFile string)
func (*ValidatorFile) Empty ¶
func (v *ValidatorFile) Empty(msg ...string) *ValidatorFile
func (*ValidatorFile) ExtIn ¶
func (v *ValidatorFile) ExtIn(exts []string, msg ...string) *ValidatorFile
ExtIn exts {"jpg","png"}
func (*ValidatorFile) IsImage ¶
func (v *ValidatorFile) IsImage(msg ...string) *ValidatorFile
func (*ValidatorFile) Len ¶
func (v *ValidatorFile) Len(min, max int64, msg ...string) *ValidatorFile
func (*ValidatorFile) NotEmpty ¶
func (v *ValidatorFile) NotEmpty(msg ...string) *ValidatorFile
func (*ValidatorFile) Optional ¶
func (v *ValidatorFile) Optional() *ValidatorFile
type ValidatorValues ¶
type ValidatorValues struct {
// contains filtered or unexported fields
}
func NewValidatorValues ¶
func NewValidatorValues(ctx *Context, key string, values []string, exists bool) *ValidatorValues
func (*ValidatorValues) Empty ¶
func (v *ValidatorValues) Empty(msg ...string) *ValidatorValues
func (*ValidatorValues) Ensure ¶
func (v *ValidatorValues) Ensure(assertion, shouldBail bool, msg ...string) *ValidatorValues
func (*ValidatorValues) EnsureNot ¶
func (v *ValidatorValues) EnsureNot(assertion, shouldBail bool, msg ...string) *ValidatorValues
func (*ValidatorValues) Float32 ¶
func (v *ValidatorValues) Float32(dv []float32, msg ...string) []float32
func (*ValidatorValues) Floats ¶
func (v *ValidatorValues) Floats(dv []float64, msg ...string) []float64
func (*ValidatorValues) Len ¶
func (v *ValidatorValues) Len(min, max int, msg ...string) *ValidatorValues
func (*ValidatorValues) Match ¶
func (v *ValidatorValues) Match(reg string, msg ...string) *ValidatorValues
func (*ValidatorValues) NotEmpty ¶
func (v *ValidatorValues) NotEmpty(msg ...string) *ValidatorValues
func (*ValidatorValues) NotMatch ¶
func (v *ValidatorValues) NotMatch(reg string, msg ...string) *ValidatorValues
func (*ValidatorValues) Optional ¶
func (v *ValidatorValues) Optional() *ValidatorValues
Click to show internal directories.
Click to hide internal directories.