jcs

package
v0.27.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 3, 2026 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package jcs declares the error codes and the sentinels of the RFC 8785 canonicalization package, internal/service/data/codec/jcs — range 0.3.102.* (ADR 0102 amendment of 2026-11-03).

The codes live in the core at the path that mirrors the package emitting them (ADR 0160 §2). Nothing here encodes or decodes.

Package jcs — the sentinel *errs.Error values, one per code. No Public and no Private below carries a byte of the document: what is signed is routinely a record holding personal data.

Index

Constants

View Source
const CodeJCSMarshalFailed errs.Code = 0x00_03_66_03 // 0.3.102.3

CodeJCSMarshalFailed identifies a Go value encoding/json/v2 refuses to encode before it is canonicalized.

View Source
const CodeJCSNotJSON errs.Code = 0x00_03_66_01 // 0.3.102.1

CodeJCSNotJSON identifies a document to canonicalize that is not exactly one I-JSON value (RFC 7493): a syntax error, a truncation, trailing data, a duplicated member name, invalid UTF-8, or nesting past the reader's bound.

View Source
const CodeJCSNumberInvalid errs.Code = 0x00_03_66_02 // 0.3.102.2

CodeJCSNumberInvalid identifies a number no IEEE 754 double holds — one past the largest finite double — which RFC 8785 §3.2.2.3 cannot write.

Variables

View Source
var (
	// NotJSON refuses a document that is not exactly one I-JSON value. Its field
	// names the byte offset where reading stopped, never what the document held.
	NotJSON = errs.Static(CodeJCSNotJSON, "NOT_JSON",
		"The document is not a JSON value",
		"service/data/codec/jcs: the document is not exactly one I-JSON value; the field names the offset, never its content",
		400,
		65)

	// NumberInvalid refuses a number past the largest finite IEEE 754 double.
	// Its field names the offset, never the number.
	NumberInvalid = errs.Static(CodeJCSNumberInvalid, "NUMBER_INVALID",
		"A number of the document has no canonical form",
		"service/data/codec/jcs: a number is past the largest finite double; the field names the offset",
		400,
		65)

	// MarshalFailed wraps encoding/json/v2's refusal of the value Marshal was given.
	MarshalFailed = errs.Static(CodeJCSMarshalFailed, "MARSHAL_FAILED",
		"The value has no JSON encoding",
		"service/data/codec/jcs: encoding/json/v2 refused the value",
		0,
		0)
)

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL