session

package
v0.0.0-...-4f702ff Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 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 Repository

type Repository interface {
	// Get returns the session with the specified user ID.
	Get(ctx context.Context, ID string) (*Session, error)
	// Create saves a new entity in the storage.
	Set(ctx context.Context, entity *Session) error
	// Delete removes the entity with given ID from the storage.
	Delete(ctx context.Context, ID string) error
}

Repository encapsulates the logic to access session from the data source.

type Session

type Session struct {
	ID              string                   // обязательное
	AccountSettings *account.AccountSettings // обязательное
	JwtClaims       *jwt.Claims              // только после первой аутентификации (но факт аутентификации проверяем по переменной в контексте isAuth)
	User            *user.User               // только после первой аутентификации (но факт аутентификации проверяем по переменной в контексте isAuth)
}

func New

func New(ID string, accountSettings *account.AccountSettings, jwtClaims *jwt.Claims, user *user.User) (*Session, error)

New func is a constructor for the Session

Jump to

Keyboard shortcuts

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