session

package
v0.0.0-...-8a57dd0 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: AGPL-3.0 Imports: 14 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 {
	UserID      distype.Snowflake
	GuildIDs    []distype.Snowflake
	AccessToken string
	CreatedAt   time.Time
	ExpiresAt   time.Time
}

func GetSession

func GetSession(c *fiber.Ctx) *Session

type SessionManager

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

func New

func New(store store.SessionStore) *SessionManager

func (*SessionManager) CreatePendingSession

func (s *SessionManager) CreatePendingSession(ctx context.Context) (string, error)

func (*SessionManager) CreateSession

func (s *SessionManager) CreateSession(ctx context.Context, sessionType model.SessionType, userID distype.Snowflake, guildIDs []distype.Snowflake, accessToken string) (string, error)

func (*SessionManager) CreateSessionCookie

func (s *SessionManager) CreateSessionCookie(c *fiber.Ctx, sessionType model.SessionType, userID distype.Snowflake, guildIDs []distype.Snowflake, accessToken string) error

func (*SessionManager) DeleteSession

func (s *SessionManager) DeleteSession(c *fiber.Ctx) error

func (*SessionManager) GetPendingSession

func (s *SessionManager) GetPendingSession(ctx context.Context, code string) (*model.PendingSession, error)

func (*SessionManager) GetSession

func (s *SessionManager) GetSession(c *fiber.Ctx) (*Session, error)

func (*SessionManager) UpdatePendingSession

func (s *SessionManager) UpdatePendingSession(ctx context.Context, code string, token string) error

type SessionMiddleware

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

func NewMiddleware

func NewMiddleware(manager *SessionManager) *SessionMiddleware

func (*SessionMiddleware) SessionOptional

func (m *SessionMiddleware) SessionOptional() func(c *fiber.Ctx) error

func (*SessionMiddleware) SessionRequired

func (m *SessionMiddleware) SessionRequired() func(c *fiber.Ctx) error

Jump to

Keyboard shortcuts

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