Documentation ¶
Overview ¶
Package phpsessgo is a generated GoMock package.
Index ¶
- Constants
- type MockSessionManager
- func (m *MockSessionManager) EXPECT() *MockSessionManagerMockRecorder
- func (m *MockSessionManager) Encoder() SessionEncoder
- func (m *MockSessionManager) Handler() SessionHandler
- func (m *MockSessionManager) SIDCreator() SessionIDCreator
- func (m *MockSessionManager) Save(session *Session) error
- func (m *MockSessionManager) SessionName() string
- func (m *MockSessionManager) SetCookieString(arg0 string) string
- func (m *MockSessionManager) Start(w http.ResponseWriter, r *http.Request) (*Session, error)
- type MockSessionManagerMockRecorder
- func (mr *MockSessionManagerMockRecorder) Encoder() *gomock.Call
- func (mr *MockSessionManagerMockRecorder) Handler() *gomock.Call
- func (mr *MockSessionManagerMockRecorder) SIDCreator() *gomock.Call
- func (mr *MockSessionManagerMockRecorder) Save(session interface{}) *gomock.Call
- func (mr *MockSessionManagerMockRecorder) SessionName() *gomock.Call
- func (mr *MockSessionManagerMockRecorder) SetCookieString(arg0 interface{}) *gomock.Call
- func (mr *MockSessionManagerMockRecorder) Start(w, r interface{}) *gomock.Call
- type PHPSessionEncoder
- type RedisSessionHandler
- type Session
- type SessionEncoder
- type SessionHandler
- type SessionIDCreator
- type SessionManager
- type SessionManagerConfig
- type UUIDCreator
Constants ¶
const ( DefaultSessionName = "PHPSESSID" DefaultRedisKeyPrefix = "PHPREDIS_SESSION:" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockSessionManager ¶
type MockSessionManager struct {
// contains filtered or unexported fields
}
MockSessionManager is a mock of SessionManager interface
func NewMockSessionManager ¶
func NewMockSessionManager(ctrl *gomock.Controller) *MockSessionManager
NewMockSessionManager creates a new mock instance
func (*MockSessionManager) EXPECT ¶
func (m *MockSessionManager) EXPECT() *MockSessionManagerMockRecorder
EXPECT returns an object that allows the caller to indicate expected use
func (*MockSessionManager) Encoder ¶
func (m *MockSessionManager) Encoder() SessionEncoder
Encoder mocks base method
func (*MockSessionManager) Handler ¶
func (m *MockSessionManager) Handler() SessionHandler
Handler mocks base method
func (*MockSessionManager) SIDCreator ¶
func (m *MockSessionManager) SIDCreator() SessionIDCreator
SIDCreator mocks base method
func (*MockSessionManager) Save ¶
func (m *MockSessionManager) Save(session *Session) error
Save mocks base method
func (*MockSessionManager) SessionName ¶
func (m *MockSessionManager) SessionName() string
SessionName mocks base method
func (*MockSessionManager) SetCookieString ¶
func (m *MockSessionManager) SetCookieString(arg0 string) string
SetCookieString mocks base method
func (*MockSessionManager) Start ¶
func (m *MockSessionManager) Start(w http.ResponseWriter, r *http.Request) (*Session, error)
Start mocks base method
type MockSessionManagerMockRecorder ¶
type MockSessionManagerMockRecorder struct {
// contains filtered or unexported fields
}
MockSessionManagerMockRecorder is the mock recorder for MockSessionManager
func (*MockSessionManagerMockRecorder) Encoder ¶
func (mr *MockSessionManagerMockRecorder) Encoder() *gomock.Call
Encoder indicates an expected call of Encoder
func (*MockSessionManagerMockRecorder) Handler ¶
func (mr *MockSessionManagerMockRecorder) Handler() *gomock.Call
Handler indicates an expected call of Handler
func (*MockSessionManagerMockRecorder) SIDCreator ¶
func (mr *MockSessionManagerMockRecorder) SIDCreator() *gomock.Call
SIDCreator indicates an expected call of SIDCreator
func (*MockSessionManagerMockRecorder) Save ¶
func (mr *MockSessionManagerMockRecorder) Save(session interface{}) *gomock.Call
Save indicates an expected call of Save
func (*MockSessionManagerMockRecorder) SessionName ¶
func (mr *MockSessionManagerMockRecorder) SessionName() *gomock.Call
SessionName indicates an expected call of SessionName
func (*MockSessionManagerMockRecorder) SetCookieString ¶
func (mr *MockSessionManagerMockRecorder) SetCookieString(arg0 interface{}) *gomock.Call
SetCookieString indicates an expected call of SetCookieString
func (*MockSessionManagerMockRecorder) Start ¶
func (mr *MockSessionManagerMockRecorder) Start(w, r interface{}) *gomock.Call
Start indicates an expected call of Start
type PHPSessionEncoder ¶
type PHPSessionEncoder struct {
SessionEncoder
}
func (*PHPSessionEncoder) Decode ¶
func (e *PHPSessionEncoder) Decode(raw string) (phpencode.PhpSession, error)
func (*PHPSessionEncoder) Encode ¶
func (e *PHPSessionEncoder) Encode(session phpencode.PhpSession) (string, error)
type RedisSessionHandler ¶
type RedisSessionHandler struct { SessionHandler Expiration time.Duration Client *redis.Client RedisKeyPrefix string }
RedisSessionHandler session management using redis
type Session ¶
type Session struct { SessionID string Value phpencode.PhpSession }
Session handle creation/modification of session parametr
type SessionEncoder ¶
type SessionEncoder interface { Encode(session phpencode.PhpSession) (string, error) Decode(raw string) (phpencode.PhpSession, error) }
type SessionHandler ¶
type SessionHandler interface { Close() // Gc(maxLifeTime int) int Read(sessionID string) (string, error) Write(sessionID, sessionData string) error }
SessionHandler is adoption of PHP SessionHandlerInterface For more reference: https://www.php.net/manual/en/class.sessionhandlerinterface.php
type SessionIDCreator ¶
type SessionIDCreator interface {
CreateSID() string
}
SessionIDCreator is adoptation of PHP SessionIDInterface Reference at https://www.php.net/manual/en/class.sessionidinterface.php
type SessionManager ¶
type SessionManager interface { Start(w http.ResponseWriter, r *http.Request) (session *Session, err error) Save(session *Session) error SessionName() string SIDCreator() SessionIDCreator Handler() SessionHandler Encoder() SessionEncoder SetCookieString(string) string }
func NewRedisSessionManager ¶
func NewRedisSessionManager(client *redis.Client, config SessionManagerConfig) SessionManager
NewRedisSessionManager create new instance of SessionManager
func NewSessionManager ¶
func NewSessionManager( sessionName string, sidCreator SessionIDCreator, handler SessionHandler, encoder SessionEncoder, config SessionManagerConfig, ) SessionManager
type SessionManagerConfig ¶
type UUIDCreator ¶
type UUIDCreator struct {
SessionIDCreator
}
UUIDCreator generate session ID using UUID V4
func (*UUIDCreator) CreateSID ¶
func (c *UUIDCreator) CreateSID() string
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |