Documentation ¶
Index ¶
- type Session
- type SessionManager
- func (s *SessionManager) CreatePendingSession(ctx context.Context) (string, error)
- func (s *SessionManager) CreateSession(ctx context.Context, sessionType model.SessionType, userID distype.Snowflake, ...) (string, error)
- func (s *SessionManager) CreateSessionCookie(c *fiber.Ctx, sessionType model.SessionType, userID distype.Snowflake, ...) error
- func (s *SessionManager) DeleteSession(c *fiber.Ctx) error
- func (s *SessionManager) GetPendingSession(ctx context.Context, code string) (*model.PendingSession, error)
- func (s *SessionManager) GetSession(c *fiber.Ctx) (*Session, error)
- func (s *SessionManager) UpdatePendingSession(ctx context.Context, code string, token string) error
- type SessionMiddleware
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 (*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 ¶
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
Click to show internal directories.
Click to hide internal directories.