memory

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrUserNotFound       = fmt.Errorf("memory auth: user not found")
	ErrRoleNotFound       = fmt.Errorf("memory roles: role not found")
	ErrAssignmentNotFound = fmt.Errorf("memory roles: assignment not found")
)

Functions

This section is empty.

Types

type ActivityStore

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

ActivityStore logs activity entries in memory and exposes query helpers.

func NewActivityStore

func NewActivityStore() *ActivityStore

NewActivityStore provisions the store.

func (*ActivityStore) ActivityStats

func (*ActivityStore) ListActivity

func (s *ActivityStore) ListActivity(_ context.Context, filter types.ActivityFilter) (types.ActivityPage, error)

func (*ActivityStore) Log

type AuthRepository

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

AuthRepository is an in-memory implementation of both the auth repository and the user inventory repository contracts. It is only intended for examples.

func NewAuthRepository

func NewAuthRepository() *AuthRepository

NewAuthRepository provisions an in-memory auth repository.

func (*AuthRepository) AllowedTransitions

func (r *AuthRepository) AllowedTransitions(context.Context, uuid.UUID) ([]types.LifecycleTransition, error)

func (*AuthRepository) Create

func (r *AuthRepository) Create(_ context.Context, input *types.AuthUser) (*types.AuthUser, error)

func (*AuthRepository) GetByID

func (r *AuthRepository) GetByID(_ context.Context, id uuid.UUID) (*types.AuthUser, error)

func (*AuthRepository) GetByIdentifier

func (r *AuthRepository) GetByIdentifier(_ context.Context, identifier string) (*types.AuthUser, error)

func (*AuthRepository) ListUsers

func (*AuthRepository) ResetPassword

func (r *AuthRepository) ResetPassword(context.Context, uuid.UUID, string) error

func (*AuthRepository) Update

func (r *AuthRepository) Update(_ context.Context, input *types.AuthUser) (*types.AuthUser, error)

func (*AuthRepository) UpdateStatus

func (r *AuthRepository) UpdateStatus(ctx context.Context, actor types.ActorRef, id uuid.UUID, next types.LifecycleState, opts ...types.TransitionOption) (*types.AuthUser, error)

type PreferenceRepository

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

PreferenceRepository persists preference records in memory.

func NewPreferenceRepository

func NewPreferenceRepository() *PreferenceRepository

NewPreferenceRepository provisions the repo.

func (*PreferenceRepository) DeletePreference

func (r *PreferenceRepository) DeletePreference(_ context.Context, userID uuid.UUID, scope types.ScopeFilter, level types.PreferenceLevel, key string) error

func (*PreferenceRepository) ListPreferences

func (*PreferenceRepository) UpsertPreference

type ProfileRepository

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

ProfileRepository stores profile rows in memory.

func NewProfileRepository

func NewProfileRepository() *ProfileRepository

NewProfileRepository provisions the repo.

func (*ProfileRepository) GetProfile

func (r *ProfileRepository) GetProfile(_ context.Context, userID uuid.UUID, scope types.ScopeFilter) (*types.UserProfile, error)

func (*ProfileRepository) UpsertProfile

func (r *ProfileRepository) UpsertProfile(_ context.Context, profile types.UserProfile) (*types.UserProfile, error)

type RoleRegistry

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

RoleRegistry is an in-memory registry used by examples.

func NewRoleRegistry

func NewRoleRegistry() *RoleRegistry

NewRoleRegistry provisions the registry.

func (*RoleRegistry) AssignRole

func (r *RoleRegistry) AssignRole(_ context.Context, userID, roleID uuid.UUID, scope types.ScopeFilter, actor uuid.UUID) error

func (*RoleRegistry) CreateRole

func (*RoleRegistry) DeleteRole

func (r *RoleRegistry) DeleteRole(_ context.Context, id uuid.UUID, _ types.ScopeFilter, _ uuid.UUID) error

func (*RoleRegistry) GetRole

func (*RoleRegistry) ListAssignments

func (r *RoleRegistry) ListAssignments(_ context.Context, filter types.RoleAssignmentFilter) ([]types.RoleAssignment, error)

func (*RoleRegistry) ListRoles

func (r *RoleRegistry) ListRoles(_ context.Context, filter types.RoleFilter) (types.RolePage, error)

func (*RoleRegistry) UnassignRole

func (r *RoleRegistry) UnassignRole(_ context.Context, userID, roleID uuid.UUID, scope types.ScopeFilter, _ uuid.UUID) error

func (*RoleRegistry) UpdateRole

func (r *RoleRegistry) UpdateRole(_ context.Context, id uuid.UUID, input types.RoleMutation) (*types.RoleDefinition, error)

Jump to

Keyboard shortcuts

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