session

package
v0.0.0-...-b5fb6d8 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SessionClient

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

func NewClient

func NewClient() *SessionClient

func (SessionClient) CreateLoginSession

func (sc SessionClient) CreateLoginSession(ctx context.Context, userId string) (string, error)

func (SessionClient) CreateOTPSession

func (sc SessionClient) CreateOTPSession(ctx context.Context, userId string) (string, error)

func (SessionClient) Del

func (sc SessionClient) Del(ctx context.Context, key string) error

func (SessionClient) Expire

func (sc SessionClient) Expire(ctx context.Context, key string, ttl time.Duration) error

func (SessionClient) Get

func (sc SessionClient) Get(ctx context.Context, key string) (string, error)

func (SessionClient) GetLoginSession

func (sc SessionClient) GetLoginSession(ctx context.Context, sessionId string) (userId string, err error)

func (SessionClient) GetOTPSession

func (sc SessionClient) GetOTPSession(ctx context.Context, sessionId string) (userId string, err error)

func (SessionClient) GetUsedOTPs

func (sc SessionClient) GetUsedOTPs(ctx context.Context, userId string) []string

func (SessionClient) LPop

func (sc SessionClient) LPop(ctx context.Context, key string, values ...interface{}) (string, error)

func (SessionClient) LPush

func (sc SessionClient) LPush(ctx context.Context, key string, values ...interface{}) error

func (SessionClient) LTrim

func (sc SessionClient) LTrim(ctx context.Context, key string, start int64, stop int64) error

func (SessionClient) NewSessionId

func (sc SessionClient) NewSessionId() string

func (SessionClient) Set

func (sc SessionClient) Set(ctx context.Context, key string, value interface{}, expiration time.Duration) error

func (SessionClient) SetUsedOTP

func (sc SessionClient) SetUsedOTP(ctx context.Context, userId string, otp string) error

Jump to

Keyboard shortcuts

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