ctxns

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

@index context.Context에 namespace를 전파하고 namespace-scoped DB/search/query 호출의 기본값을 정규화하는 유틸리티 패키지.

Index

Constants

View Source
const DefaultNamespace = "default"

Variables

This section is empty.

Functions

func FromContext

func FromContext(ctx context.Context) string

FromContext는 context에서 namespace를 추출한다. @intent store 내부에서 context로부터 namespace를 꺼내 쿼리 필터에 적용한다. @return namespace가 설정되지 않았으면 빈 문자열을 반환한다.

func Normalize

func Normalize(ns string) string

Normalize replaces an empty namespace with DefaultNamespace, leaving other values unchanged. @intent normalize namespace query parameter values so store and DB-backed search layers always observe a non-empty namespace string.

func WithNamespace

func WithNamespace(ctx context.Context, ns string) context.Context

WithNamespace는 context에 namespace 값을 설정한다. @intent 호출자 시그니처 변경 없이 store 레이어까지 namespace를 전달한다.

Types

This section is empty.

Jump to

Keyboard shortcuts

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