resolver

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package resolver provides RecipientResolver and UserResolver implementations.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Static

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

Static is a map-based RecipientResolver for testing and simple deployments. It resolves user IDs from an in-memory map. Safe for concurrent use (read-only after creation).

func NewStatic

func NewStatic(recipients map[string]*mailbox.Recipient) *Static

NewStatic creates a Static resolver from a map of user ID to Recipient. The map is copied to prevent external mutation.

func (*Static) Resolve

func (s *Static) Resolve(_ context.Context, userID string) (*mailbox.Recipient, error)

Resolve returns recipient information for a single user ID. It returns mailbox.ErrRecipientNotFound (wrapped with the user ID) when the ID is not present, honoring the RecipientResolver contract.

func (*Static) ResolveBatch

func (s *Static) ResolveBatch(_ context.Context, userIDs []string) ([]*mailbox.Recipient, error)

ResolveBatch returns recipient information for multiple user IDs. Unknown IDs have nil entries in the returned slice.

type StaticUserResolver added in v0.7.1

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

StaticUserResolver is a map-based UserResolver for testing and simple deployments. It resolves user IDs from an in-memory map. Safe for concurrent use (read-only after creation).

func NewStaticUserResolver added in v0.7.1

func NewStaticUserResolver(users map[string]*UserEntry) *StaticUserResolver

NewStaticUserResolver creates a StaticUserResolver from a map of user ID to UserEntry. The map is copied to prevent external mutation.

func (*StaticUserResolver) ResolveUser added in v0.7.1

func (s *StaticUserResolver) ResolveUser(_ context.Context, userID string) (mailbox.User, error)

ResolveUser returns the full User principal for a given user ID.

type UserEntry added in v0.7.1

type UserEntry struct {
	FirstName    string
	LastName     string
	Email        string
	Type         string            // "human" | "agent" | "service" | ""
	PublicKey    string            // Ed25519 base64-encoded; empty for humans
	Capabilities map[string]string // skills, endpoint, region, model, …
}

UserEntry holds user identity and capability fields for StaticUserResolver.

Jump to

Keyboard shortcuts

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