Documentation ¶
Index ¶
- type Config
- type Sessiongate
- func (sessiongate *Sessiongate) End(token []byte) error
- func (sessiongate *Sessiongate) Expire(token []byte, ttl int) error
- func (sessiongate *Sessiongate) PDel(token, name []byte) error
- func (sessiongate *Sessiongate) PGet(token, name []byte) ([]byte, error)
- func (sessiongate *Sessiongate) PSet(token, name, payload []byte) error
- func (sessiongate *Sessiongate) Start(ttl int) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SignKey []byte Addr string // The Redis address MaxIdle int // The max idle time for a Redis connection IdleTimeout time.Duration // The idle timeout for a Redis connection }
Config represents a configuration passed to the Sessiongate initializer
type Sessiongate ¶
type Sessiongate struct {
// contains filtered or unexported fields
}
A Sessiongate represents a connection to the SessionGate module loaded in the Redis server.
func NewSessiongate ¶
func NewSessiongate(config *Config) (*Sessiongate, error)
NewSessiongate initializes a new Sessiongate.
func (*Sessiongate) End ¶
func (sessiongate *Sessiongate) End(token []byte) error
End ends a session in the SessionGate module.
func (*Sessiongate) Expire ¶
func (sessiongate *Sessiongate) Expire(token []byte, ttl int) error
Expire sets the TTL for a session in the SessionGate module.
func (*Sessiongate) PDel ¶
func (sessiongate *Sessiongate) PDel(token, name []byte) error
PDel deletes a payload for a session in the SessionGate module name is the payload name to be used to delete.
func (*Sessiongate) PGet ¶
func (sessiongate *Sessiongate) PGet(token, name []byte) ([]byte, error)
PGet gets a payload for a session in the SessionGate module name is the payload name.
func (*Sessiongate) PSet ¶
func (sessiongate *Sessiongate) PSet(token, name, payload []byte) error
PSet sets a payload for a session in the SessionGate module name is the payload name to be used to get the payload later