Documentation
¶
Overview ¶
Package org provides KV-cached org resolution from gateway-supplied X-Org-Id headers. The trust boundary lives in pkg/auth — this package is the lookup-side cache, separate so callers can bind a KV without pulling in the auth middleware.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Resolve ¶
func Resolve(ctx context.Context, name string) (*organization.Organization, error)
Resolve loads an organization from a gateway-supplied owner name. It reads-through the KV cache and falls back to GetOrCreate, which auto- provisions the org record on first encounter.
Caller is responsible for providing the right context — typically a request-scoped context.WithTimeout from the handler.
Types ¶
type KVCache ¶
type KVCache interface {
Get(ctx context.Context, key string) (string, error)
Set(ctx context.Context, key string, value string, ttl time.Duration) error
Delete(ctx context.Context, keys ...string) error
}
KVCache is the minimal interface required for org-id caching. *infra.KVClient satisfies it.
Click to show internal directories.
Click to hide internal directories.