src/metadata.bend checks
raw source on the hub · import bendonnect-rpc@0.1.0.0/src/metadata.bend as Metadata
Header / trailer metadata helpers. Pure. Metadata maps are Map<&2, List<&2, String>> with lowercase keys.
1 import
import Base
Definitions
def trailer_prefix source · line 5 · raw
String
def trailers_to_headers.go source · line 8 · raw
@xs:List<&2, Sigma<&2, &2, String, _ => List<&2, String>>> -> @acc:Map<&2, List<&2, String>> -> Map<&2, List<&2, String>>
def trailers_to_headers source · line 16 · raw
@m:Map<&2, List<&2, String>> -> Map<&2, List<&2, String>>
Every key gets the "trailer-" prefix (unary responses carry trailers as headers).
def bool_eq source · line 20 · raw
@a:Bool -> @+b:Bool -> Bool
Adds k (with prefix stripped when want) when its prefix status equals want.
def split.add source · line 23 · raw
@take:Bool -> @+want:Bool -> @+k:String -> @v:List<&2, String> -> @acc:Map<&2, List<&2, String>> -> Map<&2, List<&2, String>>
def split.go source · line 30 · raw
@xs:List<&2, Sigma<&2, &2, String, _ => List<&2, String>>> -> @+want:Bool -> @acc:Map<&2, List<&2, String>> -> Map<&2, List<&2, String>>
def split_trailers source · line 38 · raw
@h:Map<&2, List<&2, String>> -> Pair(Map<&2, List<&2, String>>, Map<&2, List<&2, String>>)
(non-trailer headers, trailers with the "trailer-" prefix stripped)
def is_reserved source · line 43 · raw
@+key:String -> Bool
Keys starting with "connect-" belong to the protocol.
def is_binary source · line 47 · raw
@+key:String -> Bool
Keys ending in "-bin" carry base64 values.
def key_char source · line 50 · raw
@+c:U32 -> Bool
def key_chars source · line 55 · raw
@s:String -> Bool
def valid_key source · line 63 · raw
@+key:String -> Bool
1*[0-9a-z_.-]