Documentation
¶
Index ¶
Constants ¶
const (
COOKIE_NAME = "GSESSION"
)
Variables ¶
This section is empty.
Functions ¶
func ResourcesHandler ¶
ResourcesHandler creates a handler that serves files from a folder. If the broowser accepts gzip encoding, it will first try to serve the gzipped version of the file. If absent it will serve the non-gizzepd file. The gzip file name is the original file nane concatenated with '.gz'. Ex: index.html -> index.html.gz
Types ¶
type BufferedResponse ¶
type BufferedResponse struct {
Body *bytes.Buffer
Code int
// contains filtered or unexported fields
}
func NewBufferedResponse ¶
func NewBufferedResponse() *BufferedResponse
func (*BufferedResponse) Flush ¶
func (this *BufferedResponse) Flush(w http.ResponseWriter)
func (*BufferedResponse) Header ¶
func (this *BufferedResponse) Header() http.Header
func (*BufferedResponse) WriteBefore ¶
func (this *BufferedResponse) WriteBefore(data []byte) error
WriteBefore writes data at the beginning of the buffer. It does this by copying the original data, truncating the buffer, then writing what we want and then write the original data.
func (*BufferedResponse) WriteHeader ¶
func (this *BufferedResponse) WriteHeader(code int)
type NeuteredReadirFile ¶
type OnlyFilesFS ¶
type OnlyFilesFS struct {
Fs http.FileSystem
}
blocks directory listing and accessing content outside the document base (root)
type Session ¶
type Session struct {
Id string
Attributes map[interface{}]interface{}
Invalid bool // if true it will be invalidate (removal from Sessions) at the end of the request.
}
func NewSession ¶
func NewSession() *Session
func (*Session) Invalidate ¶
func (this *Session) Invalidate()
type Sessions ¶
type Sessions struct {
// contains filtered or unexported fields
}
func NewSessions ¶
func NewSessions(config SessionsConfig) *Sessions
func (*Sessions) CreateNewSession ¶
func (*Sessions) GetIfPresent ¶
func (*Sessions) GetOrCreate ¶
gets the session identified by id. If not found and if 'create' equals to 'true' then creates a new session