~/bend-docscommunity

http.bend relies on unsafe/foreign

raw source on the hub · import bend-kit-storage@0.7.0.1/http.bend as Http

6 imports
import Base
import ./storage.bend as S
import bend-kit-http@0.40.0.1/http.bend as Http
import bend-kit-http@0.40.0.1/completion.bend as Completion
import bend-kit-files@0.4.0.1/files.bend as Files
import bend-kit-bytes@0.3.3.1/bytes.bend as Bytes

Types

type Step source · line 261 · raw

Type

Definitions

def response source · line 9 · raw

@status:U32 -> @body:0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body -> 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Reply

Git's dumb HTTP object walk: immutable objects are fetched by digest from a known root.

def served source · line 12 · raw

@result:Result<&1, &1, Pair(U32, String), 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body> -> IO(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Reply)

def object source · line 19 · raw

@+dir:String -> @digest:Maybe<&2, 0x88da2e2929173b81753c8775817c2913/storage.Digest> -> IO(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Reply)

def route source · line 28 · raw

@valid:Bool -> @dir:String -> @path:String -> IO(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Reply)

def handle source · line 36 · raw

@dir:String -> @request:0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Req -> IO(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Reply)

Mount on a read-only store; freeze collection while the server serves its roots.

def Run source · line 41 · raw

@-A:Type -> Type

def Run.pure source · line 44 · raw

@-A:Type -> @x:A -> Run(A)

def Run.next source · line 47 · raw

@-A:Type -> @-B:Type -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool, Result<&1, &1, Pair(U32, String), A>) -> @f:(@_:A -> Run(B)) -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool, Result<&1, &1, Pair(U32, String), B>))

def Run.bind source · line 55 · raw

@-A:Type -> @-B:Type -> @m:Run(A) -> @f:(@_:A -> Run(B)) -> Run(B)

def Run.lift source · line 58 · raw

@-A:Type -> @m:0x88da2e2929173b81753c8775817c2913/storage.Run(A) -> Run(A)

def Run.close source · line 63 · raw

@-A:Type -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool, Result<&1, &1, Pair(U32, String), A>) -> 0x88da2e2929173b81753c8775817c2913/storage.Run(A)

def metadata.file source · line 73 · raw

@valid:Bool -> Maybe<&2, 0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>>

def metadata.node source · line 80 · raw

@node:Maybe<&2, 0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, 0x88da2e2929173b81753c8775817c2913/storage.Blob>> -> Maybe<&2, 0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>>

def metadata.of source · line 89 · raw

@file:Bool -> @+size:U32 -> @+head:String -> @+d:0x88da2e2929173b81753c8775817c2913/storage.Digest -> Maybe<&2, 0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>>

def verified.pair source · line 98 · raw

@+d:0x88da2e2929173b81753c8775817c2913/storage.Digest -> @pair:Pair(U32, String) -> 0x88da2e2929173b81753c8775817c2913/storage.Run(0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>)

def verified source · line 102 · raw

@+path:String -> @+d:0x88da2e2929173b81753c8775817c2913/storage.Digest -> 0x88da2e2929173b81753c8775817c2913/storage.Run(0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>)

def error source · line 107 · raw

@e:0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Err -> String

def copy.result source · line 128 · raw

@result:Result<&1, &1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Err, Maybe<&1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body>> -> Result<&1, &1, Pair(U32, String), Maybe<&1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body>>

def copy.read source · line 135 · raw

@f:File -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Result<&1, &1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Err, Maybe<&1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body>>) -> Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Pair(File, Result<&1, &1, Pair(U32, String), Maybe<&1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body>>))

def copy.next source · line 139 · raw

@st:0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream -> @pair:Pair(File, Result<&1, &1, Pair(U32, String), Unit>) -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Pair(File, Result<&1, &1, Pair(U32, String), Maybe<&1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body>>)))

def copy.write source · line 149 · raw

@over:Bool -> @f:File -> @body:0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body -> IO(Pair(File, Result<&1, &1, Pair(U32, String), Unit>))

def copy source · line 156 · raw

@fuel:Nat -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Pair(File, Result<&1, &1, Pair(U32, String), Maybe<&1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Body>>)) -> @+total:U32 -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Pair(File, Result<&1, &1, Pair(U32, String), Unit>)))

def status.result source · line 171 · raw

@good:Bool -> @message:String -> Result<&1, &1, Pair(U32, String), Unit>

def download.status source · line 178 · raw

@+status:U32 -> @st:0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream -> @f:File -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Pair(File, Result<&1, &1, Pair(U32, String), Unit>)))

def download.path source · line 183 · raw

@tmp:String -> @result:Result<&1, &1, Pair(U32, String), Unit> -> Result<&1, &1, Pair(U32, String), String>

def download.closed source · line 190 · raw

@+tmp:String -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Pair(File, Result<&1, &1, Pair(U32, String), Unit>)) -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Result<&1, &1, Pair(U32, String), String>))

def download.response source · line 197 · raw

@+tmp:String -> @f:File -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Res) -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Result<&1, &1, Pair(U32, String), String>))

def download.opened source · line 203 · raw

@st:0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream -> @opened:Result<&1, &1, Pair(U32, String), Pair(String, File)> -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Result<&1, &1, Pair(U32, String), String>))

def download.idle source · line 210 · raw

@pool:0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream, Result<&1, &1, Pair(U32, String), String>) -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool, Result<&1, &1, Pair(U32, String), String>))

def download.received source · line 216 · raw

@+dir:String -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool, Result<&1, &1, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Err, 0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Stream>) -> IO(Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool, Result<&1, &1, Pair(U32, String), String>))

def download.context source · line 227 · raw

@+d:0x88da2e2929173b81753c8775817c2913/storage.Digest -> @pair:Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool, Result<&1, &1, Pair(U32, String), String>) -> Pair(0x0a045079b0f843dd1eb3dfc9de50dbd6/http.Pool, Result<&1, &1, Pair(U32, String), String>)

def download source · line 235 · raw

@base:String -> @dir:String -> @+d:0x88da2e2929173b81753c8775817c2913/storage.Digest -> Run(String)

def publish source · line 241 · raw

@+tmp:String -> @path:String -> @d:0x88da2e2929173b81753c8775817c2913/storage.Digest -> 0x88da2e2929173b81753c8775817c2913/storage.Run(0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>)

def publish.cleaned source · line 247 · raw

@+tmp:String -> @result:Result<&1, &1, Pair(U32, String), 0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>> -> 0x88da2e2929173b81753c8775817c2913/storage.Run(0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>)

def receive source · line 256 · raw

@+dir:String -> @+d:0x88da2e2929173b81753c8775817c2913/storage.Digest -> @+tmp:String -> 0x88da2e2929173b81753c8775817c2913/storage.Run(0x88da2e2929173b81753c8775817c2913/storage.Obj<0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit>)

def walk source · line 269 · raw

@fuel:Nat -> @+base:String -> @+dir:String -> @step:Step -> @+index:0x88da2e2929173b81753c8775817c2913/storage.Index(0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit) -> @+sent:U32 -> Run(Pair(0x88da2e2929173b81753c8775817c2913/storage.Index(0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit), U32))

The index holds only links and the visited set, never file payloads.

def complete source · line 297 · raw

@root:0x88da2e2929173b81753c8775817c2913/storage.Digest -> @result:Pair(0x88da2e2929173b81753c8775817c2913/storage.Index(0x88da2e2929173b81753c8775817c2913/storage.Digest, Unit), U32) -> 0x88da2e2929173b81753c8775817c2913/storage.Run(U32)

def sync source · line 304 · raw

@+base:String -> @+dir:String -> @+root:0x88da2e2929173b81753c8775817c2913/storage.Digest -> 0x88da2e2929173b81753c8775817c2913/storage.Run(U32)

base is an HTTP(S) origin without a trailing slash; root is supplied by the caller.

Effects (foreign code)

effect inspect source · line 69 · raw

@path:String -> @digest:String -> IO(Result<&1, &1, Pair(U32, String), Pair(U32, String)>)

foreign: effs/http.c, effs/http.js