gitea: code.gitea.io/gitea/modules/session Index | Files

package session

import "code.gitea.io/gitea/modules/session"

Index

Package Files

memory.go virtual.go

type MemProvider Uses

type MemProvider struct {
    // contains filtered or unexported fields
}

MemProvider represents a in-memory session provider implementation.

func (*MemProvider) Count Uses

func (p *MemProvider) Count() int

Count counts and returns number of sessions.

func (*MemProvider) Destroy Uses

func (p *MemProvider) Destroy(sid string) error

Destroy deletes a session by session ID.

func (*MemProvider) Exist Uses

func (p *MemProvider) Exist(sid string) bool

Exist returns true if session with given ID exists.

func (*MemProvider) GC Uses

func (p *MemProvider) GC()

GC calls GC to clean expired sessions.

func (*MemProvider) Init Uses

func (p *MemProvider) Init(maxLifetime int64, _ string) error

Init initializes memory session provider.

func (*MemProvider) Read Uses

func (p *MemProvider) Read(sid string) (_ session.RawStore, err error)

Read returns raw session store by session ID.

func (*MemProvider) Regenerate Uses

func (p *MemProvider) Regenerate(oldsid, sid string) (session.RawStore, error)

Regenerate regenerates a session store from old session ID to new one.

type MemStore Uses

type MemStore struct {
    // contains filtered or unexported fields
}

MemStore represents a in-memory session store implementation.

func NewMemStore Uses

func NewMemStore(sid string) *MemStore

NewMemStore creates and returns a memory session store.

func (*MemStore) Delete Uses

func (s *MemStore) Delete(key interface{}) error

Delete deletes a key from session.

func (*MemStore) Flush Uses

func (s *MemStore) Flush() error

Flush deletes all session data.

func (*MemStore) Get Uses

func (s *MemStore) Get(key interface{}) interface{}

Get gets value by given key in session.

func (*MemStore) ID Uses

func (s *MemStore) ID() string

ID returns current session ID.

func (*MemStore) Release Uses

func (*MemStore) Release() error

Release releases resource and save data to provider.

func (*MemStore) Set Uses

func (s *MemStore) Set(key, val interface{}) error

Set sets value to given key in session.

type VirtualSessionProvider Uses

type VirtualSessionProvider struct {
    // contains filtered or unexported fields
}

VirtualSessionProvider represents a shadowed session provider implementation.

func (*VirtualSessionProvider) Count Uses

func (o *VirtualSessionProvider) Count() int

Count counts and returns number of sessions.

func (*VirtualSessionProvider) Destroy Uses

func (o *VirtualSessionProvider) Destroy(sid string) error

Destroy deletes a session by session ID.

func (*VirtualSessionProvider) Exist Uses

func (o *VirtualSessionProvider) Exist(sid string) bool

Exist returns true if session with given ID exists.

func (*VirtualSessionProvider) GC Uses

func (o *VirtualSessionProvider) GC()

GC calls GC to clean expired sessions.

func (*VirtualSessionProvider) Init Uses

func (o *VirtualSessionProvider) Init(gclifetime int64, config string) error

Init initializes the cookie session provider with given root path.

func (*VirtualSessionProvider) Read Uses

func (o *VirtualSessionProvider) Read(sid string) (session.RawStore, error)

Read returns raw session store by session ID.

func (*VirtualSessionProvider) Regenerate Uses

func (o *VirtualSessionProvider) Regenerate(oldsid, sid string) (session.RawStore, error)

Regenerate regenerates a session store from old session ID to new one.

type VirtualStore Uses

type VirtualStore struct {
    // contains filtered or unexported fields
}

VirtualStore represents a virtual session store implementation.

func NewVirtualStore Uses

func NewVirtualStore(p *VirtualSessionProvider, sid string, kv map[interface{}]interface{}) *VirtualStore

NewVirtualStore creates and returns a virtual session store.

func (*VirtualStore) Delete Uses

func (s *VirtualStore) Delete(key interface{}) error

Delete delete a key from session.

func (*VirtualStore) Flush Uses

func (s *VirtualStore) Flush() error

Flush deletes all session data.

func (*VirtualStore) Get Uses

func (s *VirtualStore) Get(key interface{}) interface{}

Get gets value by given key in session.

func (*VirtualStore) ID Uses

func (s *VirtualStore) ID() string

ID returns current session ID.

func (*VirtualStore) Release Uses

func (s *VirtualStore) Release() error

Release releases resource and save data to provider.

func (*VirtualStore) Set Uses

func (s *VirtualStore) Set(key, val interface{}) error

Set sets value to given key in session.

Package session imports 12 packages (graph) and is imported by 2 packages. Updated 2019-08-27. Refresh now. Tools for package owners.