repo

package
v0.0.0-...-9265221 Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InMemorySessionRepository

type InMemorySessionRepository []models.Session

func NewInMemorySessionRepository

func NewInMemorySessionRepository(sessions []models.Session) *InMemorySessionRepository

func (*InMemorySessionRepository) CreateSession

func (repo *InMemorySessionRepository) CreateSession(session models.Session) (models.Session, error)

func (*InMemorySessionRepository) DeleteSession

func (repo *InMemorySessionRepository) DeleteSession(id string) error

func (*InMemorySessionRepository) Find

func (repo *InMemorySessionRepository) Find(realm, userID string) []models.Session

func (*InMemorySessionRepository) GetSessionByID

func (repo *InMemorySessionRepository) GetSessionByID(id string) (models.Session, bool)

type SessionRepository

type SessionRepository interface {
	GetSessionByID(id string) (models.Session, bool)
	DeleteSession(id string) error
	CreateSession(session models.Session) (models.Session, error)
	Find(realm, userID string) []models.Session
}

type SessionRepositoryRedis

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

func NewSessionRepositoryRedis

func NewSessionRepositoryRedis(addr, pass string, db int) SessionRepositoryRedis

func (*SessionRepositoryRedis) CreateSession

func (repo *SessionRepositoryRedis) CreateSession(session models.Session) (models.Session, error)

func (*SessionRepositoryRedis) DeleteSession

func (repo *SessionRepositoryRedis) DeleteSession(id string) error

func (*SessionRepositoryRedis) Find

func (repo *SessionRepositoryRedis) Find(realm, userID string) []models.Session

func (*SessionRepositoryRedis) GetSessionByID

func (repo *SessionRepositoryRedis) GetSessionByID(id string) (models.Session, bool)

Jump to

Keyboard shortcuts

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