Documentation
¶
Index ¶
- func CompactJSON(raw json.RawMessage) string
- func CompactRawJSONMap(in map[string]json.RawMessage) map[string]string
- func TimeOrZero(t *time.Time) time.Time
- func TimeToPtr(t time.Time) *time.Time
- func TimeToUnix(t *time.Time) int64
- func UnixOrZero(t time.Time) int64
- func UnixToTimePtr(sec int64) *time.Time
- type LoggingTransport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompactJSON ¶
func CompactJSON(raw json.RawMessage) string
func CompactRawJSONMap ¶
func CompactRawJSONMap(in map[string]json.RawMessage) map[string]string
func TimeOrZero ¶
TimeOrZero dereferences *time.Time, returning zero value for nil. Useful for converting nullable DB timestamps to in-memory structs.
func TimeToPtr ¶
TimeToPtr converts time.Time to *time.Time, returning nil for zero values. Useful for converting in-memory timestamps to nullable DB fields.
func TimeToUnix ¶
TimeToUnix converts *time.Time to unix seconds, returning 0 for nil. Useful for converting nullable timestamps to protobuf int64 fields.
func UnixOrZero ¶
UnixOrZero returns unix seconds for non-zero time.Time, or 0 for zero time.Time.
func UnixToTimePtr ¶
UnixToTimePtr converts unix seconds to *time.Time, returning nil for zero/negative values. Useful for converting protobuf int64 timestamps to nullable DB fields.
Types ¶
type LoggingTransport ¶
type LoggingTransport struct {
Base http.RoundTripper
Label string
}
loggingTransport dumps every request and response between the BFF and MDS at klog -v=2 (verbose). Errors and non-2xx responses always log at info. Enable with `--v=2` (or env KLOG_V=2) when debugging the OpenAI SDK payloads.