Sessions
Technical reference of Sesiones.
This API is used in Sessions.
Symbols
| Symbol | Class | Description |
|---|---|---|
| Session | type | Session defines a public type of API. |
| ExpireSession | type | ExpireSession defines a public type of API. |
| SessionRegistryBindings | type | SessionRegistryBindings defines a public type of API. |
| SessionRegistry | type | SessionRegistry defines a public type of API. |
| Sessions | var | Sessions it exposes a shared value of the package. |
| SessionRegistry.Get | func | It gets the first value associated with a key. |
Session
Declaration:
type Session = server.Session Session defines a public type of API.
ExpireSession
Declaration:
type ExpireSession = server.ExpireSession ExpireSession defines a public type of API.
SessionRegistryBindings
Declaration:
type SessionRegistryBindings struct {
Get func(sessionID string) (*Session, error)
} SessionRegistryBindings defines a public type of API.
Fields
| Field | Type | Description |
|---|---|---|
Get | func(sessionID string) (*Session, error) | Query callback. |
SessionRegistry
Declaration:
type SessionRegistry struct {
// contiene campos internos
} SessionRegistry defines a public type of API.
Sessions
Declaration:
var Sessions = newSessionRegistry() Sessions it exposes a shared value of the package.
SessionRegistry.Get
Declaration:
func (s *SessionRegistry) Get(sessionID string) (*Session, error) It gets the first value associated with a key.
Parameters
| Parameter | Type | Description |
|---|---|---|
sessionID | string | Type value string required by the operation. |
Returns
| Return | Type | Description |
|---|---|---|
value | *Session | Type value *Session produced by the operation. |
err | error | nil if the operation ends correctly; otherwise, the error produced. |
Behavior
When the key does not exist, it returns the zero value of T and false.
Errors
Get returns an error when the arguments, the status of the receiver or the underlying operation make it impossible to complete the call.
Usage syntax
value, err := sessionRegistry.Get(value)