testsession

package
v0.0.0-...-e8f72f8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: MIT Imports: 5 Imported by: 0

README

testsession

为 github.com/herb-go/externalauth 提供的测试用session

所有数据直接明文存放在cookie内,不应该在开发或者生产环境中使用。

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ContextField = SessionRequestContextType("Session")
View Source
var ErrNotFound = errors.New("not found")

Functions

This section is empty.

Types

type CookieWriter

type CookieWriter struct {
	http.ResponseWriter

	Session *TestCookieSession
	// contains filtered or unexported fields
}

func (*CookieWriter) Write

func (w *CookieWriter) Write(data []byte) (int, error)

func (*CookieWriter) WriteHeader

func (w *CookieWriter) WriteHeader(status int)

type SessionData

type SessionData map[string][]byte

type SessionRequestContextType

type SessionRequestContextType string

type TestCookieSession

type TestCookieSession struct {
	Name string
	Path string
}

func (*TestCookieSession) Del

func (t *TestCookieSession) Del(r *http.Request, fieldname string) error

func (*TestCookieSession) Get

func (t *TestCookieSession) Get(r *http.Request, fieldname string, v interface{}) error

func (*TestCookieSession) IsNotFoundError

func (t *TestCookieSession) IsNotFoundError(err error) bool

func (*TestCookieSession) MustLoad

func (t *TestCookieSession) MustLoad(w http.ResponseWriter, r *http.Request)

func (*TestCookieSession) MustSave

func (t *TestCookieSession) MustSave(w http.ResponseWriter, r *http.Request)

func (*TestCookieSession) SessionData

func (t *TestCookieSession) SessionData(r *http.Request) SessionData

func (*TestCookieSession) Set

func (t *TestCookieSession) Set(r *http.Request, fieldname string, v interface{}) error

func (*TestCookieSession) SetSessionData

func (t *TestCookieSession) SetSessionData(r *http.Request, data SessionData)

func (*TestCookieSession) Wrap

Jump to

Keyboard shortcuts

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