Versions in this module Expand all Collapse all v0 v0.3.3 Nov 6, 2026 Changes in this version + const HardMaxBodyLines + const HardMaxMessageBytes + func CanonicalHeaderName(name string) (string, bool) + func IsParserErrorCode(err error, code ErrorCode) bool + type Body struct + func NewBody(data []byte, lines BodyLineIndex) (Body, error) + func NewReconstructedBody(data []byte, options ParserOptions) (Body, error) + func (b Body) Bytes() []byte + func (b Body) Equal(other Body) bool + func (b Body) Initialized() bool + func (b Body) Len() int + func (b Body) LineBytes(index int) ([]byte, bool) + func (b Body) LineCount() int + func (b Body) LineEncodedLen(index int) (int, bool) + func (b Body) Lines() BodyLineIndex + func (b Body) VisitLines(visit func(BodyLineView) error) error + type BodyLine struct + func NewBodyLine(index int, startOffset int, endOffset int, lineEndingWidth int) (BodyLine, error) + func (l BodyLine) EndOffset() int + func (l BodyLine) Index() int + func (l BodyLine) LineEndingWidth() int + func (l BodyLine) StartOffset() int + type BodyLineIndex struct + func NewBodyLineIndex(lines []BodyLine) (BodyLineIndex, error) + func (i BodyLineIndex) Len() int + func (i BodyLineIndex) Line(index int) (BodyLine, bool) + func (i BodyLineIndex) Lines() []BodyLine + type BodyLineView struct + func (v BodyLineView) ContentLen() int + func (v BodyLineView) EncodedCopy() []byte + func (v BodyLineView) EncodedLen() int + func (v BodyLineView) Terminated() bool + type ErrorCode string + const ErrorCodeBareCR + const ErrorCodeBareLF + const ErrorCodeInvalidInvariant + const ErrorCodeInvalidTransportForm + const ErrorCodeLimitExceeded + const ErrorCodeMalformedHeader + const ErrorCodeMissingDelimiter + const ErrorCodeMixedLineEndings + const ErrorCodeUnsupportedPolicy + type ErrorLocation struct + Column int + Line int + Offset int + type ErrorReasonClass string + const ErrorReasonInvariant + const ErrorReasonLimit + const ErrorReasonMalformed + const ErrorReasonPolicy + type HeaderBlock struct + func NewHeaderBlock(fields []HeaderField, originalBytes []byte) (HeaderBlock, error) + func NewReconstructedHeaderBlock(fieldBytes [][]byte, options ParserOptions) (HeaderBlock, error) + func (h HeaderBlock) Field(index int) (HeaderField, bool) + func (h HeaderBlock) Fields() []HeaderField + func (h HeaderBlock) FieldsByName(name string) []HeaderField + func (h HeaderBlock) Initialized() bool + func (h HeaderBlock) LastFieldByName(name string) (HeaderField, bool) + func (h HeaderBlock) Len() int + func (h HeaderBlock) OriginalByteLen() int + func (h HeaderBlock) OriginalBytes() []byte + func (h HeaderBlock) VisitFieldsReverse(visit func(HeaderFieldView) error) error + type HeaderField struct + func NewHeaderField(index int, rawName []byte, rawValue []byte, unfoldedValue []byte, ...) (HeaderField, error) + func (f HeaderField) Index() int + func (f HeaderField) NameLower() string + func (f HeaderField) OriginalBytes() []byte + func (f HeaderField) RawName() []byte + func (f HeaderField) RawValue() []byte + func (f HeaderField) UnfoldedValue() []byte + type HeaderFieldView struct + func (v HeaderFieldView) MaximumPhysicalLineBytes() int + func (v HeaderFieldView) NameLower() string + func (v HeaderFieldView) OriginalByteLen() int + func (v HeaderFieldView) UnfoldedValueCopy() []byte + func (v HeaderFieldView) UnfoldedValueLen() int + type InsertionRequest struct + Fields [][]byte + Message Message + Options ParserOptions + TransportForm TransportForm + func (r InsertionRequest) Format(state fmt.State, _ rune) + func (r InsertionRequest) GoString() string + func (r InsertionRequest) String() string + type LineEndingPolicy string + const LineEndingPolicyNormalizeLF + const LineEndingPolicyStrictCRLF + type Message struct + func NewMessage(rawBytes []byte, headers HeaderBlock, body Body, metadata ParserMetadata) (Message, error) + func NewReconstructedMessage(headers HeaderBlock, body Body, options ParserOptions) (Message, error) + func NewReconstructedMessageWithFraming(headers HeaderBlock, body Body, options ParserOptions, framing MessageFraming) (Message, error) + func Parse(data []byte) (Message, error) + func ParseWithOptions(data []byte, options ParserOptions) (Message, error) + func PrependValidatedFields(request InsertionRequest) (Message, error) + func (m Message) Body() Body + func (m Message) Framing() MessageFraming + func (m Message) Headers() HeaderBlock + func (m Message) Initialized() bool + func (m Message) Metadata() ParserMetadata + func (m Message) RawBytes() []byte + type MessageFraming string + const MessageFramingDelimited + const MessageFramingHeaderOnly + func (f MessageFraming) Known() bool + type ParserError struct + func NewParserError(code ErrorCode, location ErrorLocation, details ParserErrorDetails) *ParserError + func (e *ParserError) Code() ErrorCode + func (e *ParserError) Error() string + func (e *ParserError) Is(target error) bool + func (e *ParserError) Limit() int + func (e *ParserError) LimitName() string + func (e *ParserError) Location() ErrorLocation + func (e *ParserError) PolicyName() string + func (e *ParserError) ReasonClass() ErrorReasonClass + type ParserErrorDetails struct + Limit int + LimitName string + PolicyName string + Reason ErrorReasonClass + type ParserMetadata struct + BodyBytes int + HeaderBytes int + HeaderFields int + LineEndingPolicy LineEndingPolicy + NormalizedInput bool + OriginalBytes int + StoredBytes int + func NewParserMetadata(policy LineEndingPolicy, normalized bool, originalBytes int, storedBytes int, ...) ParserMetadata + type ParserOptions struct + LineEndingPolicy LineEndingPolicy + MaxBodyLineBytes int + MaxBodyLines int + MaxHeaderBytes int + MaxHeaderFieldBytes int + MaxHeaderFields int + MaxHeaderLineBytes int + MaxMessageBytes int + RecordNormalizedInput bool + func DefaultParserOptions() ParserOptions + func (o ParserOptions) Validate() error + type TransportForm string + const TransportFormFinalNetworkPreDotStuffing + func (f TransportForm) Known() bool