adaptors

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInMemoryAdapter

func NewInMemoryAdapter() auth.SessionAdapter

Types

type InMemoryAdapter

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

func (*InMemoryAdapter) DeleteSession

func (a *InMemoryAdapter) DeleteSession(ctx context.Context, sessionID string) error

func (*InMemoryAdapter) DeleteSessionsByUserID

func (a *InMemoryAdapter) DeleteSessionsByUserID(ctx context.Context, userID string) error

func (*InMemoryAdapter) GetSession

func (a *InMemoryAdapter) GetSession(ctx context.Context, sessionID string) (auth.Session, error)

func (*InMemoryAdapter) InsertSession

func (a *InMemoryAdapter) InsertSession(ctx context.Context, newSession auth.Session) error

func (*InMemoryAdapter) UpdateSession

func (a *InMemoryAdapter) UpdateSession(ctx context.Context, newSession auth.Session) error

type Session

type Session struct {
	SessionID    string    `json:"-" xml:"-" yaml:"-"`
	UserID       string    `json:"-" xml:"-" yaml:"-"`
	ExpiresAt    time.Time `json:"-" xml:"-" yaml:"-"`
	RefreshUntil time.Time `json:"-" xml:"-" yaml:"-"`
}

func (*Session) Copy

func (s *Session) Copy() auth.Session

func (*Session) GetExpiresAt

func (s *Session) GetExpiresAt() time.Time

func (*Session) GetRefreshUntil

func (s *Session) GetRefreshUntil() time.Time

func (*Session) GetSessionID

func (s *Session) GetSessionID() string

func (*Session) GetUserID

func (s *Session) GetUserID() string

func (*Session) SetExpiresAt

func (s *Session) SetExpiresAt(expiresAt time.Time)

func (*Session) SetSessionID

func (s *Session) SetSessionID(sessionID string)

Jump to

Keyboard shortcuts

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