Documentation
¶
Overview ¶
Package nextnode ports packages/chord/src/next-node: compression for Chord v2 hosts (§22, slice 4b), the synchronous compressor `createHost({ compression })` takes. Upstream keeps it outside `src/next` because `next` imports no Node module; Go's compress/flate plays the role of Node's zlib, so the split carries no constraint and the package exists to mirror the upstream layout.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var NoLimit = math.Inf(1)
NoLimit is `Number.POSITIVE_INFINITY`: an inflate limit that never bounds the output.
Functions ¶
This section is empty.
Types ¶
type Compression ¶
type Compression interface {
Deflate(bytes []byte) []byte
Inflate(bytes []byte, limit float64) Inflated
}
Compression is the synchronous compressor `createHost({ compression })` takes (packages/chord/src/next/link/part.ts). Deflate is raw deflate at level 1. Inflate gives at most limit bytes (NoLimit: no limit; 0 allowed), too_large when the output would be larger, corrupt for data that is no raw deflate stream.
var NodeCompression Compression = nodeCompression{}
NodeCompression is upstream's `nodeCompression`: raw deflate at level 1 and inflate bounded by the limit.
type Inflated ¶
type Inflated struct {
Kind InflatedKind
Bytes []byte
Error error
}
Inflated is the outcome of Compression.Inflate, tagged by Kind: Bytes is set for InflatedBytes, Error for InflatedCorrupt.
type InflatedKind ¶
type InflatedKind string
InflatedKind tags an Inflated outcome.
const ( // InflatedBytes is an inflate that fit the limit. InflatedBytes InflatedKind = "bytes" // InflatedTooLarge is an inflate whose output would be larger than the limit. InflatedTooLarge InflatedKind = "too_large" // InflatedCorrupt is data that is no raw deflate stream. InflatedCorrupt InflatedKind = "corrupt" )
Directories
¶
| Path | Synopsis |
|---|---|
|
Package http ports packages/chord/src/next-node/http (Chord v2's HTTP component, slice 10 §2): a Web-standard `fetch` handler built from the routes, wraps and sockets plugins contribute to the registry `Http`, with the security baseline on by default, Chord's own listener, an upgrade adapter and the request conversion for apps that mount it.
|
Package http ports packages/chord/src/next-node/http (Chord v2's HTTP component, slice 10 §2): a Web-standard `fetch` handler built from the routes, wraps and sockets plugins contribute to the registry `Http`, with the security baseline on by default, Chord's own listener, an upgrade adapter and the request conversion for apps that mount it. |
|
Package plugins ports packages/chord/src/next-node/plugins: the plugins component of Chord v2 (slice 7c, design §21 "Loading plugins and the reload loop"), the plugin directories found, each facet built, evaluated, loaded and reloaded per plugin, watched and rolled out.
|
Package plugins ports packages/chord/src/next-node/plugins: the plugins component of Chord v2 (slice 7c, design §21 "Loading plugins and the reload loop"), the plugin directories found, each facet built, evaluated, loaded and reloaded per plugin, watched and rolled out. |
|
Package workers ports packages/chord/src/next-node/workers: Chord v2's workers component (slice 10 §3, §4), a worker process per address of a host kind, started on demand, stopped when idle, never restarted by itself, its plugins shipped from the server; `WorkerMain` is the worker's side.
|
Package workers ports packages/chord/src/next-node/workers: Chord v2's workers component (slice 10 §3, §4), a worker process per address of a host kind, started on demand, stopped when idle, never restarted by itself, its plugins shipped from the server; `WorkerMain` is the worker's side. |