session

package
v0.0.0-...-34aff43 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2017 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorBadParameter   = errors.New("Bad Parameter")
	ErrorNotFound       = errors.New("Not Found")
	ErrorInvalidToken   = errors.New("Invalid Token")
	ErrorInvalidCommand = errors.New("Invalid Command")
	ErrorNotImplemented = errors.New("Not Implemented")
	ErrorOther          = errors.New("Other")
)

Managerが返す各エラーのインスタンスを生成します。

Functions

func WriteCookie

func WriteCookie(c echo.Context, sessionID ID) error

WriteCookie は、ブラウザのcookieにセッションIDを書き込みます。

Types

type ID

type ID string

ID はセッションを一意に識別するIDです。

func ReadCookie

func ReadCookie(c echo.Context) (ID, error)

ReadCookie は、ブラウザのcookieからセッションIDを読み込みます。

type Manager

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

Manager は Sessionの操作・管理を行います。

func (*Manager) Create

func (m *Manager) Create() (ID, error)

Create は セッションの作成を行います。

func (*Manager) Delete

func (m *Manager) Delete(sessionID ID) error

Delete は セッションの削除を行います。

func (*Manager) DeleteExpired

func (m *Manager) DeleteExpired() error

DeleteExpired は 期限切れセッションの削除を行います。

func (*Manager) LoadStore

func (m *Manager) LoadStore(sessionID ID) (Store, error)

LoadStore は データストアの読み出しを行います。

func (*Manager) SaveStore

func (m *Manager) SaveStore(sessionID ID, sessionStore Store) error

SaveStore は データストアの保存を行います。

func (*Manager) Start

func (m *Manager) Start(echo *echo.Echo)

Start は Managerの開始を行います。

func (*Manager) Stop

func (m *Manager) Stop()

Stop は Managerの停止を行います。

type Store

type Store struct {
	Data             map[string]string
	ConsistencyToken string
}

Store はセッションデータと整合性トークンを保持する構造体です。

Jump to

Keyboard shortcuts

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