session

package
v0.0.0-...-2fe0e47 Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Session

type Session struct {
	Login     string
	SID       string
	ExpiresAt time.Time
}

type SessionRepo

type SessionRepo struct {
	Connection bool
	// contains filtered or unexported fields
}

func GetSessionRepo

func GetSessionRepo(sessionCfg configs.DbRedisCfg, lg *slog.Logger) (*SessionRepo, error)

func (*SessionRepo) AddSession

func (redisRepo *SessionRepo) AddSession(ctx context.Context, active Session, lg *slog.Logger) (bool, error)

func (*SessionRepo) CheckActiveSession

func (redisRepo *SessionRepo) CheckActiveSession(ctx context.Context, sid string, lg *slog.Logger) (bool, error)

func (*SessionRepo) CheckRedisSessionConnection

func (redisRepo *SessionRepo) CheckRedisSessionConnection(sessionCfg configs.DbRedisCfg)

func (*SessionRepo) DeleteSession

func (redisRepo *SessionRepo) DeleteSession(ctx context.Context, sid string, lg *slog.Logger) (bool, error)

func (*SessionRepo) GetUserLogin

func (redisRepo *SessionRepo) GetUserLogin(ctx context.Context, sid string, lg *slog.Logger) (string, error)

Jump to

Keyboard shortcuts

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