]> gitweb.factorcode.org Git - factor.git/blob - extra/http2/hpack/hpack-docs.factor
factor: trim using lists
[factor.git] / extra / http2 / hpack / hpack-docs.factor
1 ! Copyright (C) 2021 Your name.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: byte-arrays help.markup help.syntax sequences strings ;
4 IN: http2.hpack
5
6 HELP: hpack-context
7 { $class-description "Stores the context for a hpack decoder or encoder. This is primarily the current state of the dynamic table." } ;
8
9 HELP: hpack-decode
10 { $values
11     { "decode-context" hpack-context } { "block" byte-array }
12     { "updated-context" hpack-context } { "decoded" sequence }
13 }
14 { $description "Decodes the given byte array (or byte vector) in the given hpack context. Outputs the updated context, and the decoded header block as a sequence of pairs." } ;
15
16 HELP: hpack-decode-error
17 { $values
18     { "error-msg" string }
19 }
20 { $description "Throws a " { $link hpack-decode-error } " error." }
21 { $error-description "Thrown for any of the possible errors specified in RFC7541 for decoding hpack encoded byte strings." } ;
22
23 HELP: hpack-encode
24 { $values
25     { "encode-context" hpack-context } { "headers" sequence }
26     { "updated-context" hpack-context } { "block" byte-array }
27 }
28 { $description "Encodes the sequence of headers using the given context. Outputs the updated context and the encoded header block, as a byte array." } ;
29
30 ARTICLE: "http2.hpack" "HTTP/2 HPACK"
31 { $vocab-link "http2.hpack" }
32 ;
33
34 { hpack-encode hpack-decode } related-words
35
36 ABOUT: "http2.hpack"