Documentation
¶
Index ¶
Constants ¶
const ( ContextKeyAPIRequestInfo = "_api_request_info" ContextKeyAPIResponseInfo = "_api_response_info" ContextKeyAPIError = "_api_error" ContextKeyCredential = "_credential" ContextKeySession = "_session" ContextKeyNamespace = "_namespace" ContextKeyDB = "_db" ContextKeyTX = "_tx" ContextKeyLogger = "_logger" ContextKeyTrace = "_trace" ContextKeyConfig = "_config" )
const (
RedactMask = "REDACTED XXXX"
)
const (
TimeFormat = "2006-01-02 15:04:05.00"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Daemon ¶
Daemon is a service that runs. Start and Stop are called on one instance, and more than once.
Stop ends what Start began: it takes no new work, cancels the work going on, and waits for all of it to end, what an earlier Stop left included, until ctx ends. If ctx ends first, it ends the work hard where it can and returns an error wrapping ctx's, leaving the rest to end on its own; an ended ctx makes it a forced stop. Either way it returns only once whatever takes new work has returned. Start works right after any Stop, and what a Stop left must not reach into it.
type Debuggable ¶
type Initializable ¶
Initializable is implemented by services that require initialization. Init is called on first startup and on every restart, making it the appropriate place to load dynamic configuration that may change between runs.
type Liveness ¶ added in v0.3.0
Liveness and Readiness probes take the caller's context: probes may do I/O (a database ping), and the caller owns the deadline budget and the shutdown signal. Implementations may layer their own tighter timeout on top, never a looser one.
type MessageHandler ¶ added in v0.2.16
type MessageSender ¶ added in v0.2.16
type Pair ¶
type Pair[K comparable, V any] interface { SetKey(key K) SetValue(value V) GetKey() K GetValue() V String() string }
func NewPair ¶
func NewPair[K comparable, V any](key K, value V) Pair[K, V]