Documentation ¶
Index ¶
- func NewMockContext(req *http.Request) (*rungoCtx.Context, *httptest.ResponseRecorder)
- type SessionProvider
- func (s *SessionProvider) SessionAll(ctx context.Context) int
- func (s *SessionProvider) SessionDestroy(ctx context.Context, sid string) error
- func (s *SessionProvider) SessionExist(ctx context.Context, sid string) (bool, error)
- func (s *SessionProvider) SessionGC(ctx context.Context)
- func (s *SessionProvider) SessionInit(ctx context.Context, gclifetime int64, config string) error
- func (s *SessionProvider) SessionRead(ctx context.Context, sid string) (session.Store, error)
- func (s *SessionProvider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error)
- type SessionStore
- func (s *SessionStore) Delete(ctx context.Context, key interface{}) error
- func (s *SessionStore) Flush(ctx context.Context) error
- func (s *SessionStore) Get(ctx context.Context, key interface{}) interface{}
- func (s *SessionStore) SessionID(ctx context.Context) string
- func (s *SessionStore) SessionRelease(_ context.Context, _ http.ResponseWriter)
- func (*SessionStore) SessionReleaseIfPresent(_ context.Context, _ http.ResponseWriter)
- func (s *SessionStore) Set(ctx context.Context, key, value interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMockContext ¶
Types ¶
type SessionProvider ¶
type SessionProvider struct {
Store *SessionStore
}
SessionProvider will replace session provider with "mock" provider
func NewSessionProvider ¶
func NewSessionProvider(name string) *SessionProvider
NewSessionProvider create new SessionProvider and you could use it to mock data Parameter "name" is the real SessionProvider you used
func (*SessionProvider) SessionAll ¶
func (s *SessionProvider) SessionAll(ctx context.Context) int
SessionAll return 0
func (*SessionProvider) SessionDestroy ¶
func (s *SessionProvider) SessionDestroy(ctx context.Context, sid string) error
SessionDestroy reset Store to nil
func (*SessionProvider) SessionExist ¶
SessionExist always return true
func (*SessionProvider) SessionGC ¶
func (s *SessionProvider) SessionGC(ctx context.Context)
SessionGC do nothing
func (*SessionProvider) SessionInit ¶
SessionInit do nothing
func (*SessionProvider) SessionRead ¶
SessionRead return Store
func (*SessionProvider) SessionRegenerate ¶
func (s *SessionProvider) SessionRegenerate(ctx context.Context, oldsid, sid string) (session.Store, error)
SessionRegenerate create new Store
type SessionStore ¶
type SessionStore struct {
// contains filtered or unexported fields
}
func (*SessionStore) Delete ¶
func (s *SessionStore) Delete(ctx context.Context, key interface{}) error
func (*SessionStore) Get ¶
func (s *SessionStore) Get(ctx context.Context, key interface{}) interface{}
func (*SessionStore) SessionRelease ¶
func (s *SessionStore) SessionRelease(_ context.Context, _ http.ResponseWriter)
SessionRelease do nothing
func (*SessionStore) SessionReleaseIfPresent ¶
func (*SessionStore) SessionReleaseIfPresent(_ context.Context, _ http.ResponseWriter)
SessionReleaseIfPresent do nothing
Click to show internal directories.
Click to hide internal directories.