Documentation ¶
Index ¶
- Constants
- func Sessions(name string, store sessions.Store) gin.HandlerFunc
- func SessionsMany(names []string, store sessions.Store) gin.HandlerFunc
- type MockSession
- func (_m *MockSession) AddFlash(value interface{}, vars ...string)
- func (_m *MockSession) Clear()
- func (_m *MockSession) Delete(key interface{})
- func (_m *MockSession) Flashes(vars ...string) []interface{}
- func (_m *MockSession) Get(key interface{}) interface{}
- func (_m *MockSession) Options(*sessions.Options)
- func (_m *MockSession) Save() error
- func (_m *MockSession) Session() *sessions.Session
- func (_m *MockSession) Set(key interface{}, val interface{})
- type Session
Constants ¶
View Source
const (
DefaultKey = "github.com/gin-contrib/sessions"
)
Variables ¶
This section is empty.
Functions ¶
func SessionsMany ¶
func SessionsMany(names []string, store sessions.Store) gin.HandlerFunc
Types ¶
type MockSession ¶
func (*MockSession) AddFlash ¶
func (_m *MockSession) AddFlash(value interface{}, vars ...string)
func (*MockSession) Clear ¶
func (_m *MockSession) Clear()
func (*MockSession) Delete ¶
func (_m *MockSession) Delete(key interface{})
func (*MockSession) Flashes ¶
func (_m *MockSession) Flashes(vars ...string) []interface{}
func (*MockSession) Get ¶
func (_m *MockSession) Get(key interface{}) interface{}
func (*MockSession) Options ¶
func (_m *MockSession) Options(*sessions.Options)
func (*MockSession) Save ¶
func (_m *MockSession) Save() error
func (*MockSession) Session ¶
func (_m *MockSession) Session() *sessions.Session
func (*MockSession) Set ¶
func (_m *MockSession) Set(key interface{}, val interface{})
type Session ¶
type Session interface { // Get returns the session value associated to the given key. Get(key interface{}) interface{} // Set sets the session value associated to the given key. Set(key interface{}, val interface{}) // Delete removes the session value associated to the given key. Delete(key interface{}) // Clear deletes all values in the session. Clear() // AddFlash adds a flash message to the session. // A single variadic argument is accepted, and it is optional: it defines the flash key. // If not defined "_flash" is used by default. AddFlash(value interface{}, vars ...string) // Flashes returns a slice of flash messages from the session. // A single variadic argument is accepted, and it is optional: it defines the flash key. // If not defined "_flash" is used by default. Flashes(vars ...string) []interface{} // Options sets configuration for a session. Options(*sessions.Options) // Save saves all sessions used during the current request. Save() error Session() *sessions.Session }
Click to show internal directories.
Click to hide internal directories.