session

package
v0.0.0-...-e417875 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// HarborProviderName is the harbor session provider name
	HarborProviderName = "harbor"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Provider

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

Provider redis session provider

func (*Provider) SessionAll

func (rp *Provider) SessionAll(_ context.Context) int

SessionAll return all activeSession

func (*Provider) SessionDestroy

func (rp *Provider) SessionDestroy(ctx context.Context, sid string) error

SessionDestroy delete redis session by id

func (*Provider) SessionExist

func (rp *Provider) SessionExist(ctx context.Context, sid string) (bool, error)

SessionExist check redis session exist by sid

func (*Provider) SessionGC

func (rp *Provider) SessionGC(_ context.Context)

SessionGC Implement method, no used.

func (*Provider) SessionInit

func (rp *Provider) SessionInit(ctx context.Context, maxlifetime int64, url string) (err error)

SessionInit init redis session

func (*Provider) SessionRead

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

SessionRead read redis session by sid

func (*Provider) SessionRegenerate

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

SessionRegenerate generate new sid for redis session

type Store

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

Store redis session store

func (*Store) Delete

func (rs *Store) Delete(_ context.Context, key interface{}) error

Delete value in redis session

func (*Store) Flush

func (rs *Store) Flush(_ context.Context) error

Flush clear all values in redis session

func (*Store) Get

func (rs *Store) Get(_ context.Context, key interface{}) interface{}

Get value in redis session

func (*Store) SessionID

func (rs *Store) SessionID(_ context.Context) string

SessionID get redis session id

func (*Store) SessionRelease

func (rs *Store) SessionRelease(ctx context.Context, _ http.ResponseWriter)

SessionRelease save session values to redis

func (*Store) Set

func (rs *Store) Set(_ context.Context, key, value interface{}) error

Set value in redis session

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL