Package redis for session provider

    depend on

    go install

    Usage: import(

    _ ""


    func init() {
    	globalSessions, _ = session.NewManager("redis_sentinel", “{"cookieName":"gosessionid","gclifetime":3600,"ProviderConfig":";"}“)
    	go globalSessions.GC()

    more detail about params: please check the notes on the function SessionInit in this package



    This section is empty.


    View Source
    var DefaultPoolSize = 100

      DefaultPoolSize redis_sentinel default pool size


      This section is empty.


      type Provider

      type Provider struct {
      	// contains filtered or unexported fields

        Provider redis_sentinel session provider

        func (*Provider) SessionAll

        func (rp *Provider) SessionAll() int

          SessionAll return all activeSession

          func (*Provider) SessionDestroy

          func (rp *Provider) SessionDestroy(sid string) error

            SessionDestroy delete redis session by id

            func (*Provider) SessionExist

            func (rp *Provider) SessionExist(sid string) bool

              SessionExist check redis_sentinel session exist by sid

              func (*Provider) SessionGC

              func (rp *Provider) SessionGC()

                SessionGC Impelment method, no used.

                func (*Provider) SessionInit

                func (rp *Provider) SessionInit(maxlifetime int64, savePath string) error

                  SessionInit init redis_sentinel session savepath like redis sentinel addr,pool size,password,dbnum,masterName e.g.;,100,1qaz2wsx,0,mymaster

                  func (*Provider) SessionRead

                  func (rp *Provider) SessionRead(sid string) (session.Store, error)

                    SessionRead read redis_sentinel session by sid

                    func (*Provider) SessionRegenerate

                    func (rp *Provider) SessionRegenerate(oldsid, sid string) (session.Store, error)

                      SessionRegenerate generate new sid for redis_sentinel session

                      type SessionStore

                      type SessionStore struct {
                      	// contains filtered or unexported fields

                        SessionStore redis_sentinel session store

                        func (*SessionStore) Delete

                        func (rs *SessionStore) Delete(key interface{}) error

                          Delete value in redis_sentinel session

                          func (*SessionStore) Flush

                          func (rs *SessionStore) Flush() error

                            Flush clear all values in redis_sentinel session

                            func (*SessionStore) Get

                            func (rs *SessionStore) Get(key interface{}) interface{}

                              Get value in redis_sentinel session

                              func (*SessionStore) SessionID

                              func (rs *SessionStore) SessionID() string

                                SessionID get redis_sentinel session id

                                func (*SessionStore) SessionRelease

                                func (rs *SessionStore) SessionRelease(w http.ResponseWriter)

                                  SessionRelease save session values to redis_sentinel

                                  func (*SessionStore) Set

                                  func (rs *SessionStore) Set(key, value interface{}) error

                                    Set value in redis_sentinel session