Documentation
¶
Overview ¶
Package jsonbody holds small stdlib helpers for JSON HTTP bodies: marshal a value into a request-body reader (with its content type) and unmarshal response bytes back into a value. It is byte-level wire framing only — it knows nothing about LLM messages, tools, usage, or provider semantics.
Index ¶
Constants ¶
View Source
const ContentType = "application/json"
ContentType is the media type a JSON body advertises. Exported so callers (codecs, custom encoders) set the request Content-Type from a single source of truth.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DecodeError ¶
type DecodeError struct {
Err error
}
DecodeError wraps a JSON unmarshal failure. Typed per the repo rule.
func (*DecodeError) Error ¶
func (e *DecodeError) Error() string
func (*DecodeError) Unwrap ¶
func (e *DecodeError) Unwrap() error
type EncodeError ¶
type EncodeError struct {
Err error
}
EncodeError wraps a JSON marshal failure. Typed per the repo rule so callers can errors.As it rather than string-matching.
func (*EncodeError) Error ¶
func (e *EncodeError) Error() string
func (*EncodeError) Unwrap ¶
func (e *EncodeError) Unwrap() error
Click to show internal directories.
Click to hide internal directories.