memory

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: GPL-3.0 Imports: 12 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package memory implements process-local AstraEngine repositories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminAuthRepo added in v2.0.1

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

func NewAdminAuthRepository added in v2.0.1

func NewAdminAuthRepository() *AdminAuthRepo

func (*AdminAuthRepo) AdminSessions added in v2.0.1

func (r *AdminAuthRepo) AdminSessions() storage.AdminSessionRepository

func (*AdminAuthRepo) LoginGrants added in v2.0.1

type ChatRepo

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

func (*ChatRepo) FilterOptions added in v2.0.1

func (r *ChatRepo) FilterOptions(ctx context.Context, limit int) (storage.ChatFilterOptions, error)

func (*ChatRepo) FindByPlatformID

func (r *ChatRepo) FindByPlatformID(ctx context.Context, platform, chatID string) (*storage.Chat, error)

func (*ChatRepo) List

func (r *ChatRepo) List(ctx context.Context) ([]storage.Chat, error)

func (*ChatRepo) Save

func (r *ChatRepo) Save(ctx context.Context, chat *storage.Chat) error

type ControlTicketRepo added in v2.0.1

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

func NewControlTicketRepository added in v2.0.1

func NewControlTicketRepository() *ControlTicketRepo

func (*ControlTicketRepo) Consume added in v2.0.1

func (r *ControlTicketRepo) Consume(_ context.Context, audience string, hash []byte, now time.Time) (*storage.ControlTicket, error)

func (*ControlTicketRepo) Create added in v2.0.1

type OperationRepo added in v2.0.1

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

func NewOperationRepository added in v2.0.1

func NewOperationRepository() *OperationRepo

func (*OperationRepo) Claim added in v2.0.1

func (*OperationRepo) Complete added in v2.0.1

func (r *OperationRepo) Complete(_ context.Context, principal, operation string, version uint, hash []byte, executionID string, state storage.OperationState, result []byte, code, message string, retryable bool, now time.Time) (*storage.OperationRecord, error)

func (*OperationRepo) Lookup added in v2.0.1

func (r *OperationRepo) Lookup(_ context.Context, principal, operation string, version uint, hash []byte, now time.Time) (*storage.OperationRecord, error)

func (*OperationRepo) UpdateProgress added in v2.0.1

func (r *OperationRepo) UpdateProgress(_ context.Context, principal, operation string, version uint, hash []byte, executionID string, update storage.OperationProgressUpdate, now time.Time) (*storage.OperationRecord, error)

type PrincipalRepo added in v2.0.1

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

PrincipalRepo is an in-memory identity and principal repository.

func NewPrincipalRepository added in v2.0.1

func NewPrincipalRepository() *PrincipalRepo

NewPrincipalRepository creates an empty process-local principal repository.

func (*PrincipalRepo) FindByID added in v2.0.1

func (r *PrincipalRepo) FindByID(_ context.Context, id string) (*storage.Principal, error)

func (*PrincipalRepo) Resolve added in v2.0.1

func (*PrincipalRepo) Roles added in v2.0.1

func (r *PrincipalRepo) Roles(_ context.Context, id string) ([]string, uint64, error)

func (*PrincipalRepo) SetRoles added in v2.0.1

func (r *PrincipalRepo) SetRoles(_ context.Context, id string, roles []string) (uint64, error)

type SessionRepo

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

func (*SessionRepo) Delete

func (r *SessionRepo) Delete(ctx context.Context, key string) error

func (*SessionRepo) Get

func (r *SessionRepo) Get(ctx context.Context, key string) ([]byte, error)

func (*SessionRepo) Set

func (r *SessionRepo) Set(ctx context.Context, key string, value []byte, ttl time.Duration) error

type Store

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

Store groups in-memory user, chat and session repositories.

func New

func New() *Store

New creates an empty in-memory store.

func (*Store) AdminAuth added in v2.0.1

func (s *Store) AdminAuth() storage.AdminAuthRepository

func (*Store) AdminMaintenance added in v2.0.1

func (s *Store) AdminMaintenance() storage.AdminMaintenance

func (*Store) Chats

func (s *Store) Chats() storage.ChatRepository

func (*Store) CleanupAdmin added in v2.0.1

func (s *Store) CleanupAdmin(ctx context.Context, now time.Time, limit int) (storage.AdminMaintenanceCounts, error)

func (*Store) ControlTickets added in v2.0.1

func (s *Store) ControlTickets() storage.ControlTicketRepository

func (*Store) Identities added in v2.0.1

func (s *Store) Identities() storage.IdentityRepository

Identities exposes optional identity support without changing storage.Store.

func (*Store) Operations added in v2.0.1

func (s *Store) Operations() storage.OperationRepository

func (*Store) Sessions

func (s *Store) Sessions() storage.SessionRepository

func (*Store) Users

func (s *Store) Users() storage.UserRepository

type UserRepo

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

func (*UserRepo) FilterOptions added in v2.0.1

func (r *UserRepo) FilterOptions(ctx context.Context, limit int) (storage.UserFilterOptions, error)

func (*UserRepo) FindByID

func (r *UserRepo) FindByID(ctx context.Context, id string) (*storage.User, error)

func (*UserRepo) FindByPlatformID

func (r *UserRepo) FindByPlatformID(ctx context.Context, platform, platformID string) (*storage.User, error)

func (*UserRepo) List

func (r *UserRepo) List(ctx context.Context) ([]storage.User, error)

func (*UserRepo) Save

func (r *UserRepo) Save(ctx context.Context, user *storage.User) error

Jump to

Keyboard shortcuts

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