Skip to content

Inasayang/redis

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Redis Storage for OAuth 2.0

Build Codecov ReportCard GoDoc License

Install

$ go get -u -v github.com/Inasayang/redis/v4

Usage

package main

import (
	"github.com/redis/go-redis/v9"
	oredis "github.com/Inasayang/redis/v4"
	"github.com/go-oauth2/oauth2/v4/manage"
)

func main() {
	manager := manage.NewDefaultManager()
	
	// use redis token store
	manager.MapTokenStorage(oredis.NewRedisStore(&redis.Options{
		Addr: "127.0.0.1:6379",
		DB: 15,
	}))

	// use redis cluster store
	// manager.MapTokenStorage(oredis.NewRedisClusterStore(&redis.ClusterOptions{
	// 	Addrs: []string{"127.0.0.1:6379"},
	// 	DB: 15,
	// }))
}

MIT License

Copyright (c) 2020 Lyric

About

Redis storage for OAuth 2.0

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 100.0%