context

package
v0.0.0-...-3b39f08 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Context

type Context struct {
	// contains filtered or unexported fields
}

Context contains helper functions related to the current request.

func New

func New(r *http.Request) *Context

New creates a new Context.

func (*Context) CSRF

func (c *Context) CSRF() string

CSRF returns the current CSRF token.

func (*Context) FlashErrorMessage

func (c *Context) FlashErrorMessage() string

FlashErrorMessage returns the message error message if any.

func (*Context) FlashMessage

func (c *Context) FlashMessage() string

FlashMessage returns the message message if any.

func (*Context) IsAdminUser

func (c *Context) IsAdminUser() bool

IsAdminUser checks if the logged user is administrator.

func (*Context) IsAuthenticated

func (c *Context) IsAuthenticated() bool

IsAuthenticated returns a boolean if the user is authenticated.

func (*Context) OAuth2State

func (c *Context) OAuth2State() string

OAuth2State returns the current OAuth2 state.

func (*Context) PocketRequestToken

func (c *Context) PocketRequestToken() string

PocketRequestToken returns the Pocket Request Token if any.

func (*Context) SessionID

func (c *Context) SessionID() string

SessionID returns the current session ID.

func (*Context) UserID

func (c *Context) UserID() int64

UserID returns the UserID of the logged user.

func (*Context) UserLanguage

func (c *Context) UserLanguage() string

UserLanguage get the locale used by the current logged user.

func (*Context) UserSessionToken

func (c *Context) UserSessionToken() string

UserSessionToken returns the current user session token.

func (*Context) UserTimezone

func (c *Context) UserTimezone() string

UserTimezone returns the timezone used by the logged user.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL