thinkgo: github.com/thinkoner/thinkgo/session Index | Files

package session

import "github.com/thinkoner/thinkgo/session"

Index

Package Files

cookie-handler.go file-handler.go handler.go http.go manager.go store.go

type Config Uses

type Config struct {
    //Default Session Driver
    Driver string

    CookieName string

    //Session Lifetime
    Lifetime time.Duration

    //Session Encryption
    Encrypt bool

    //Session File Location
    Files string
}

type CookieHandler Uses

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

func NewCookieHandler Uses

func NewCookieHandler() *CookieHandler

func (*CookieHandler) Read Uses

func (c *CookieHandler) Read(id string) string

func (*CookieHandler) SetRequest Uses

func (c *CookieHandler) SetRequest(req Request)

func (*CookieHandler) SetResponse Uses

func (c *CookieHandler) SetResponse(res Response)

func (*CookieHandler) Write Uses

func (c *CookieHandler) Write(id string, data string)

type FileHandler Uses

type FileHandler struct {
    Path     string
    Lifetime time.Duration
}

func (*FileHandler) Read Uses

func (c *FileHandler) Read(id string) string

func (*FileHandler) Write Uses

func (c *FileHandler) Write(id string, data string)

type Handler Uses

type Handler interface {
    Read(id string) string
    Write(id string, data string)
}

type Manager Uses

type Manager struct {
    Config *Config
    // contains filtered or unexported fields
}

func NewManager Uses

func NewManager(config *Config) *Manager

func (*Manager) SessionSave Uses

func (m *Manager) SessionSave(res Response) *Store

func (*Manager) SessionStart Uses

func (m *Manager) SessionStart(req Request) *Store

type Request Uses

type Request interface {
    Cookie(key string, value ...string) (string, error)
}

type Response Uses

type Response interface {
    Cookie(name interface{}, params ...interface{}) error
}

type Store Uses

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

func NewStore Uses

func NewStore(name string, handler Handler) *Store

func (*Store) All Uses

func (s *Store) All() map[string]interface{}

func (*Store) Clear Uses

func (s *Store) Clear()

func (*Store) Forget Uses

func (s *Store) Forget(names ...string)

func (*Store) Get Uses

func (s *Store) Get(name string, value ...interface{}) interface{}

func (*Store) GetHandler Uses

func (s *Store) GetHandler() Handler

func (*Store) GetId Uses

func (s *Store) GetId() string

func (*Store) GetName Uses

func (s *Store) GetName() string

func (*Store) Remove Uses

func (s *Store) Remove(name string) interface{}

func (*Store) Save Uses

func (s *Store) Save()

func (*Store) Set Uses

func (s *Store) Set(name string, value interface{})

func (*Store) SetId Uses

func (s *Store) SetId(id string)

func (*Store) Start Uses

func (s *Store) Start()

Package session imports 10 packages (graph) and is imported by 1 packages. Updated 2019-02-16. Refresh now. Tools for package owners.