repositories

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminRepositories

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

func NewAdminRepositories

func NewAdminRepositories(db bun.IDB) *AdminRepositories

func (*AdminRepositories) ImpersonationRepository

func (r *AdminRepositories) ImpersonationRepository() ImpersonationRepository

func (*AdminRepositories) SessionStateRepository

func (r *AdminRepositories) SessionStateRepository() SessionStateRepository

func (*AdminRepositories) UserStateRepository

func (r *AdminRepositories) UserStateRepository() UserStateRepository

type BunImpersonationRepository

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

func NewBunImpersonationRepository

func NewBunImpersonationRepository(db bun.IDB) *BunImpersonationRepository

func (*BunImpersonationRepository) CreateImpersonation

func (r *BunImpersonationRepository) CreateImpersonation(ctx context.Context, impersonation *types.Impersonation) error

func (*BunImpersonationRepository) EndImpersonation

func (r *BunImpersonationRepository) EndImpersonation(ctx context.Context, impersonationID string, endedByUserID *string) error

func (*BunImpersonationRepository) GetActiveImpersonationByID

func (r *BunImpersonationRepository) GetActiveImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)

func (*BunImpersonationRepository) GetAllImpersonations

func (r *BunImpersonationRepository) GetAllImpersonations(ctx context.Context) ([]types.Impersonation, error)

func (*BunImpersonationRepository) GetImpersonationByID

func (r *BunImpersonationRepository) GetImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)

func (*BunImpersonationRepository) GetLatestActiveImpersonationByActor

func (r *BunImpersonationRepository) GetLatestActiveImpersonationByActor(ctx context.Context, actorUserID string) (*types.Impersonation, error)

func (*BunImpersonationRepository) UserExists

func (r *BunImpersonationRepository) UserExists(ctx context.Context, userID string) (bool, error)

type BunSessionStateRepository

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

func NewBunSessionStateRepository

func NewBunSessionStateRepository(db bun.IDB) *BunSessionStateRepository

func (*BunSessionStateRepository) Create

func (*BunSessionStateRepository) Delete

func (r *BunSessionStateRepository) Delete(ctx context.Context, sessionID string) error

func (*BunSessionStateRepository) GetBySessionID

func (r *BunSessionStateRepository) GetBySessionID(ctx context.Context, sessionID string) (*types.AdminSessionState, error)

func (*BunSessionStateRepository) GetByUserID

func (r *BunSessionStateRepository) GetByUserID(ctx context.Context, userID string) ([]types.AdminUserSession, error)

func (*BunSessionStateRepository) GetRevoked

func (*BunSessionStateRepository) SessionExists

func (r *BunSessionStateRepository) SessionExists(ctx context.Context, sessionID string) (bool, error)

func (*BunSessionStateRepository) Update

func (*BunSessionStateRepository) Upsert

type BunUserStateRepository

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

func NewBunUserStateRepository

func NewBunUserStateRepository(db bun.IDB) *BunUserStateRepository

func (*BunUserStateRepository) Create

func (*BunUserStateRepository) Delete

func (r *BunUserStateRepository) Delete(ctx context.Context, userID string) error

func (*BunUserStateRepository) GetBanned

func (*BunUserStateRepository) GetByUserID

func (r *BunUserStateRepository) GetByUserID(ctx context.Context, userID string) (*types.AdminUserState, error)

func (*BunUserStateRepository) Update

func (*BunUserStateRepository) Upsert

type ImpersonationRepository

type ImpersonationRepository interface {
	CreateImpersonation(ctx context.Context, impersonation *types.Impersonation) error
	GetAllImpersonations(ctx context.Context) ([]types.Impersonation, error)
	GetImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)
	GetActiveImpersonationByID(ctx context.Context, impersonationID string) (*types.Impersonation, error)
	GetLatestActiveImpersonationByActor(ctx context.Context, actorUserID string) (*types.Impersonation, error)
	EndImpersonation(ctx context.Context, impersonationID string, endedByUserID *string) error
	UserExists(ctx context.Context, userID string) (bool, error)
}

type SessionStateRepository

type SessionStateRepository interface {
	GetBySessionID(ctx context.Context, sessionID string) (*types.AdminSessionState, error)
	Create(ctx context.Context, state *types.AdminSessionState) error
	Update(ctx context.Context, state *types.AdminSessionState) error
	Upsert(ctx context.Context, state *types.AdminSessionState) error
	Delete(ctx context.Context, sessionID string) error
	GetRevoked(ctx context.Context) ([]types.AdminSessionState, error)
	SessionExists(ctx context.Context, sessionID string) (bool, error)
	GetByUserID(ctx context.Context, userID string) ([]types.AdminUserSession, error)
}

type UserStateRepository

type UserStateRepository interface {
	GetByUserID(ctx context.Context, userID string) (*types.AdminUserState, error)
	Create(ctx context.Context, state *types.AdminUserState) error
	Update(ctx context.Context, state *types.AdminUserState) error
	Upsert(ctx context.Context, state *types.AdminUserState) error
	Delete(ctx context.Context, userID string) error
	GetBanned(ctx context.Context) ([]types.AdminUserState, error)
}

Jump to

Keyboard shortcuts

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