Documentation ¶
Index ¶
- Constants
- Variables
- func DigestAuthParams(c *context.Context) map[string]string
- func H(data string) string
- func InfoPrepend(s string) func(err error) string
- func RandomKey() string
- type Base
- func (this *Base) CheckBasicAuth(cred string, realm string) bool
- func (this *Base) CheckDigestAuth(cred string, realm string) bool
- func (this *Base) CheckFlash(condition interface{}, mapping interface{}, to string)
- func (this *Base) CheckHtml(condition interface{}, code int, mapping interface{}, jmp ...string)
- func (this *Base) CheckJson(condition interface{}, code int, mapping interface{})
- func (this *Base) GetInts(field string) []int
- func (this *Base) GetParamBool(field string) (bool, error)
- func (this *Base) GetParamInt(field string) (int, error)
- func (this *Base) GetParamString(field string) string
- func (this *Base) NewPaginator(per, nums int) *Paginator
- func (this *Base) OkFlash(info interface{}, to string)
- func (this *Base) OkHtml(info interface{}, jmp ...string)
- func (this *Base) OkJson(info interface{})
- func (this *Base) ParseFormAndValid(form interface{}) (err error)
- func (this *Base) ParseFormAndValidCheckJson(form interface{}, mapping interface{})
- func (this *Base) ParseJson(obj interface{}) (err error)
- func (this *Base) ParseQuery(fields ...string) *orm.Condition
- func (b *Base) Prepare()
- type DigestAuth
- type ErrMap
- type Paginator
- func (p *Paginator) End() int
- func (p *Paginator) HasNext() bool
- func (p *Paginator) HasPages() bool
- func (p *Paginator) HasPrev() bool
- func (p *Paginator) IsActive(page int) bool
- func (p *Paginator) Nums() int
- func (p *Paginator) Offset() int
- func (p *Paginator) Page() int
- func (p *Paginator) PageLink(page int) string
- func (p *Paginator) PageLinkFirst() (link string)
- func (p *Paginator) PageLinkLast() (link string)
- func (p *Paginator) PageLinkNext() (link string)
- func (p *Paginator) PageLinkPrev() (link string)
- func (p *Paginator) PageNums() int
- func (p *Paginator) Pages() []int
- func (p *Paginator) SetNums(nums int)
- type SecretProvider
Constants ¶
View Source
const DefaultClientCacheSize = 1000
Default values for ClientCacheSize and ClientCacheTolerance for DigestAuth
View Source
const DefaultClientCacheTolerance = 100
Variables ¶
View Source
var DigestAuthor = NewDigestAuthenticator()
Functions ¶
func DigestAuthParams ¶
Parse Authorization header from the http.Request. Returns a map of auth parameters or nil if the header is not a valid parsable Digest auth header.
func InfoPrepend ¶
Types ¶
type Base ¶
type Base struct {
beego.Controller
}
func (*Base) CheckFlash ¶
func (*Base) GetParamString ¶
func (*Base) NewPaginator ¶
func (*Base) ParseFormAndValid ¶
func (*Base) ParseFormAndValidCheckJson ¶
func (this *Base) ParseFormAndValidCheckJson(form interface{}, mapping interface{})
type DigestAuth ¶
type DigestAuth struct { Opaque string PlainTextSecrets bool /* Approximate size of Client's Cache. When actual number of tracked client nonces exceeds ClientCacheSize+ClientCacheTolerance, ClientCacheTolerance*2 older entries are purged. */ ClientCacheSize int ClientCacheTolerance int // contains filtered or unexported fields }
func NewDigestAuthenticator ¶
func NewDigestAuthenticator() *DigestAuth
func (*DigestAuth) CheckAuth ¶
func (da *DigestAuth) CheckAuth(ctx *context.Context, se SecretProvider, realm string) (username string, authinfo *string)
Check if request contains valid authentication data. Returns a pair of username, authinfo where username is the name of the authenticated user or an empty string and authinfo is the contents for the optional Authentication-Info response header.
func (*DigestAuth) Purge ¶
func (a *DigestAuth) Purge(count int)
Remove count oldest entries from DigestAuth.clients
type Paginator ¶
type Paginator struct { Request *http.Request PerPageNums int MaxPages int // contains filtered or unexported fields }
func (*Paginator) PageLinkFirst ¶
func (*Paginator) PageLinkLast ¶
func (*Paginator) PageLinkNext ¶
func (*Paginator) PageLinkPrev ¶
type SecretProvider ¶
Click to show internal directories.
Click to hide internal directories.