Documentation
¶
Overview ¶
Package runtimecontext supplies an optional, process-scoped request context.
Index ¶
Constants ¶
const ( HeaderName = requestmeta.DingTalkExtHeader PayloadVersion = runtimepayload.PayloadVersion Environment = "online" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Result ¶
type Result struct {
State State `json:"state"`
PayloadVersion string `json:"payload_version"`
Environment string `json:"environment"`
Elapsed time.Duration `json:"-"`
ErrorCategory string `json:"error_category,omitempty"`
// contains filtered or unexported fields
}
Result is the immutable process result. Sensitive values stay private and cannot be serialized or formatted accidentally.
func ReadyResultForTest ¶
ReadyResultForTest constructs a ready result for cross-package tests. Production code must obtain Result values from Resolve.
func Resolve ¶
func Resolve() Result
Resolve initializes and returns the process-scoped context. It never retries: every caller observes the same immutable outcome.
func (Result) AttachToURL ¶
AttachToURL attaches the private runtime value to a login authorization URL. The URL may be opened in a browser or shown as a manual login link. Callers must never send it to diagnostic logs or persist it as application state.
func (Result) DiagnosticDetail ¶
DiagnosticDetail returns redacted, stable diagnostic fields.
func (Result) HeaderValue ¶
HeaderValue returns the compact request header payload when initialization completed successfully.