Watch 1 Star 2 Fork 0

flygotm / redistokenGoApache-2.0

Create your Gitee Account
Explore and code with more than 5 million developers,Free private repositories !:)
Sign up
A simple authorization with redis middleware for flygo spread retract

Clone or download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

redistoken

A simple authorization with redis middleware for flygo

Usage


//Create new app
app := flygo.NewApp()

//Create RedisAuth

app := flygo.NewApp()

redisToken := New().Options(&redis.Options{
    Addr:     "192.168.1.8:6379",
    Password: "123",
    DB:       0,
})

app.Use(redisToken)

app.Run()

Config

  • Set redis key prefix for stored token
redistoken.Key(KEY)
  • Set redis apps key
redistoken.AppKey(APPKEY)
  • Set redis key expires
redistoken.Expires(EXPIRES)
  • Set token length
redistoken.Length(LENGTH)
  • Set msg
redistoken.Msg(MSG)
  • Set code
redistoken.Code(CODE)

Comments ( 0 )

Sign in for post a comment

Go
1
https://gitee.com/flygotm/redistoken.git
git@gitee.com:flygotm/redistoken.git
flygotm
redistoken
redistoken
master

Search