docs: align the remaining Decoder and Encoder mentions with the options API
Test / test (push) Successful in 1m41s
Test / test (push) Successful in 1m41s
Assisted-by: GLM 5.3 Flash
This commit is contained in:
@@ -35,7 +35,7 @@ strict validation.
|
||||
|
||||
| Path | Responsibility |
|
||||
|---|---|
|
||||
| `.` (package `interpres`) | The whole library. `interpres.go` declares the exported surface (`Parse`, `Unmarshal`, `Marshal`, the `*Context` variants, `Decoder`, `Encoder`, `Marshaler`, `Unmarshaler`, `SyntaxError`, the local date-time types); everything below it is unexported. |
|
||||
| `.` (package `interpres`) | The whole library. `interpres.go` declares the exported surface (`Parse`, `Unmarshal`, `Marshal`, the `*Context` variants, the option constructors, `Marshaler`, `Unmarshaler`, `SyntaxError`, the local date-time types); everything below it is unexported. |
|
||||
| `cmd/interpres-decode` | The toml-test adapter, both directions. Reads TOML on stdin, writes tagged JSON on stdout; with `-encode` it reads tagged JSON and writes TOML. Owns no parsing logic and no emission logic. |
|
||||
| `examples/basic` | A runnable tour of the API. Documentation in executable form, not part of the library. |
|
||||
|
||||
@@ -96,10 +96,9 @@ sequenceDiagram
|
||||
|
||||
## State and lifetime
|
||||
|
||||
- The exported `Decoder` and `Encoder` hold configuration only. Every
|
||||
`Decode`, `DecodeContext`, `Marshal` and `MarshalContext` call allocates its
|
||||
own unexported worker, so a configured type is safe for concurrent use; the
|
||||
setter methods are not, and must finish before the value is shared.
|
||||
- The option values are stateless: every `Unmarshal`, `Marshal` and their
|
||||
variants apply their own options into a per-call unexported worker, so the
|
||||
entries are safe for concurrent use.
|
||||
- The parser is allocated per `ParseContext` call; the parser itself caches
|
||||
nothing between documents.
|
||||
- The shared state is a set of caches and pools whose entries are immutable
|
||||
|
||||
Reference in New Issue
Block a user