http.bend relies on unsafe/foreign
raw source on the hub · import bend-kit-storage@0.5.1.0/http.bend as Http
5 imports
import Base import ./storage.bend as S import bend-kit-http@0.39.2.0/http.bend as Http import bend-kit-http@0.39.2.0/completion.bend as Completion import bend-kit-files@0.4.0.1/files.bend as Files
Types
type Step source · line 53 · raw
Type
Want@digest:0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest -> Step
Pending@digest:0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest -> @result:Pair(0x7f06ff6866d75620cdc9ffc9838a4488/storage.Index(0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest, 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Blob), U32) -> Step
Missing@digest:0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest -> @seen:Bool -> Step
Local@digest:0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest -> @there:Bool -> Step
Children@object:Maybe<&2, 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Obj<0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest, 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Blob>> -> Step
Definitions
def response source · line 8 · raw
@status:U32 -> @body:0x38a6a43217c5976ca9d95ed542a22e7a/http.Body -> 0x38a6a43217c5976ca9d95ed542a22e7a/http.Reply
Git's dumb HTTP object walk: immutable objects are fetched by digest from a known root.
def served source · line 11 · raw
@result:Result<&1, &1, Pair(U32, String), 0x38a6a43217c5976ca9d95ed542a22e7a/http.Body> -> IO(0x38a6a43217c5976ca9d95ed542a22e7a/http.Reply)
def object source · line 18 · raw
@+dir:String -> @digest:Maybe<&2, 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest> -> IO(0x38a6a43217c5976ca9d95ed542a22e7a/http.Reply)
def route source · line 27 · raw
@valid:Bool -> @dir:String -> @path:String -> IO(0x38a6a43217c5976ca9d95ed542a22e7a/http.Reply)
def handle source · line 35 · raw
@dir:String -> @request:0x38a6a43217c5976ca9d95ed542a22e7a/http.Req -> IO(0x38a6a43217c5976ca9d95ed542a22e7a/http.Reply)
Mount on a read-only store; freeze collection while the server serves its roots.
def fetched source · line 39 · raw
@result:Result<&1, &1, 0x38a6a43217c5976ca9d95ed542a22e7a/http.Err, 0x38a6a43217c5976ca9d95ed542a22e7a/http.Res> -> 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Run(0x38a6a43217c5976ca9d95ed542a22e7a/http.Body)
def get source · line 48 · raw
@+base:String -> @d:0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest -> 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Run(0x38a6a43217c5976ca9d95ed542a22e7a/http.Body)
def walk source · line 61 · raw
@fuel:Nat -> @+base:String -> @+dir:String -> @step:Step -> @+index:0x7f06ff6866d75620cdc9ffc9838a4488/storage.Index(0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest, 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Blob) -> @+sent:U32 -> 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Run(Pair(0x7f06ff6866d75620cdc9ffc9838a4488/storage.Index(0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest, 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Blob), U32))
The index is also the visited set; every local or remote object passes ingress once.
def complete source · line 90 · raw
@root:0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest -> @result:Pair(0x7f06ff6866d75620cdc9ffc9838a4488/storage.Index(0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest, 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Blob), U32) -> 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Run(U32)
def sync source · line 97 · raw
@+base:String -> @+dir:String -> @+root:0x7f06ff6866d75620cdc9ffc9838a4488/storage.Digest -> 0x7f06ff6866d75620cdc9ffc9838a4488/storage.Run(U32)
base is an HTTP(S) origin without a trailing slash; root is supplied by the caller.