ref: a77a83ee673ab4bef38e336345f3196c814bdcf7
dir: /lib/http/types.myr/
use std use bio pkg http = type status = int const Ok = 200 type session = struct f : bio.file# host : byte[:] port : uint16 srvname : byte[:] ua : byte[:] err : bool ;; type server = struct lfd : std.fd quit : bool ;; type router = struct paths : route[:] ;; type ctx = struct fd : byte[:] ;; type route = struct path : byte[:] render : (ctx : ctx# -> status) ;; type url = struct schema : schema port : uint16 host : byte[:] path : byte[:] params : (byte[:], byte[:])[:] ;; type err = union `Ewat `Eunsupp `Econn `Ehttp int `Ehdr `Eproto `Eshort `Esyntax `Eenc ;; type schema = union `Http `Https ;; type method = union `Get `Head `Put `Post `Delete `Trace `Options ;; type encoding = union `Length `Chunked `Compress `Deflate `Gzip ;; type req = struct url : url# hdrs : (byte[:], byte[:])[:] err : std.option(err) method : method ;; type resp = struct status : int hdrs : (byte[:], byte[:])[:] len : std.size err : std.option(err) reason : byte[:] body : byte[:] enc : encoding ;; ;;