Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A session store backend for gorilla/sessions using Redis.

License

NotificationsYou must be signed in to change notification settings

no-src/redistore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

89 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BuildLicenseGo ReferenceGo Report CardcodecovRelease

A session store backendforgorilla/sessions -src.

The redistore project is a fork ofredistore.The purpose of this fork is to replace theredigowithgo-redis as the driver of redis store.

Requirements

Depends on thego-redis Redis library.

Installation

go get -u github.com/no-src/redistore

Documentation

Available onpkg.go.dev.

Seehttps://github.com/gorilla/sessions for full documentation on underlying interface.

Example

// Fetch new store.store,err:=NewRediStore(10,"tcp",":6379","", []byte("secret-key"))iferr!=nil {panic(err)}deferstore.Close()// Get a session.session,err=store.Get(req,"session-key")iferr!=nil {log.Error(err.Error())}// Add a value.session.Values["foo"]="bar"// Save.iferr=sessions.Save(req,rsp);err!=nil {t.Fatalf("Error saving session: %v",err)}// Delete session.session.Options.MaxAge=-1iferr=sessions.Save(req,rsp);err!=nil {t.Fatalf("Error saving session: %v",err)}// Change session storage configuration for MaxAge = 10 days.store.SetMaxAge(10*24*3600)

About

A session store backend for gorilla/sessions using Redis.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors15

Languages


[8]ページ先頭

©2009-2025 Movatter.jp