src/serve.bend relies on unsafe/foreign
raw source on the hub · import bend-kube-runtime@0.3.0.0/src/serve.bend as Serve
3 imports
import Base import ./runtime.bend as R import ./utf8.bend as U
Types
type AEv source · line 263 · raw
Type
AGot@l:Listener -> @r:Result<&1, &1, Pair(U32, String), Socket> -> AEv
Definitions
def Serve.Res source · line 17 · raw
@-A:Type -> Type
def Serve.size source · line 20 · raw
@s:String -> U32
def Serve.reason.go source · line 23 · raw
@ok:Bool -> @missing:Bool -> String
def Serve.reason source · line 32 · raw
@+code:U32 -> String
def Serve.reply source · line 35 · raw
@+code:U32 -> @ctype:String -> @+body:String -> String
def Serve.first_line.go source · line 40 · raw
@ls:List<&2, String> -> String
def Serve.first_line source · line 47 · raw
@s:String -> String
def Serve.path.go source · line 50 · raw
@parts:List<&2, String> -> String
def Serve.path source · line 58 · raw
@req:String -> String
The request line's path.
def Serve.probe.answer source · line 61 · raw
@m:Poll<&1, &1, Maybe<&1, List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap>>, Unit> -> Maybe<&2, List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap>>
def Serve.probe source · line 71 · raw
@+status:Chan(0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.SMsg) -> IO(Maybe<&2, List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap>>)
Every controller's snapshot from the status keeper (none on a standby replica), or None if the keeper did not answer within 2s.
def Serve.all_ready source · line 82 · raw
@ss:List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap> -> Bool
def Serve.ready.go source · line 89 · raw
@standby:Bool -> @ready:Bool -> String
def Serve.ready source · line 99 · raw
@+ss:List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap> -> String
Ready when every controller's store has listed; a standby is ready.
def Serve.bool source · line 102 · raw
@b:Bool -> String
def Serve.head source · line 109 · raw
@+name:String -> @kind:String -> @help:String -> String
def Serve.snap.name source · line 112 · raw
@s:0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap -> String
def Serve.nth source · line 117 · raw
@xs:List<&2, String> -> @n:Nat -> String
def Serve.snap.field source · line 128 · raw
@s:0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap -> @+i:U32 -> String
The field-th number of a snapshot (0 ready, 1 reconciles, 2 errors, 3 events, 4 running, 5 objects, 6 queued).
def Serve.les source · line 136 · raw
List<&2, String>
Reconcile durations as a Prometheus histogram: cumulative buckets in seconds, the sum and the count.
def Serve.buckets source · line 139 · raw
@+name:String -> @+ctl:String -> @les:List<&2, String> -> @cs:List<&2, U32> -> @+acc:U32 -> String
def Serve.pad3 source · line 148 · raw
@+n:U32 -> String
def Serve.secs source · line 151 · raw
@x:0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Sum -> String
def Serve.cache.go source · line 156 · raw
@+ctl:String -> @cz:List<&2, U32> -> @+i:U32 -> String
def Serve.caches source · line 164 · raw
@ss:List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap> -> String
def Serve.hist source · line 171 · raw
@ss:List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap> -> @+name:String -> String
def Serve.samples source · line 180 · raw
@ss:List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap> -> @+name:String -> @+field:U32 -> String
One sample per controller, labeled with its kind.
def Serve.family source · line 188 · raw
@+ss:List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap> -> @+name:String -> @kind:String -> @help:String -> @+field:U32 -> String
def Serve.text source · line 193 · raw
@+ss:List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap> -> String
The Prometheus text format: one sample per controller; a standby replica reports only that it leads nothing.
def Serve.metrics source · line 208 · raw
@+ss:List<&2, 0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.Snap> -> String
def Serve.route source · line 221 · raw
@path:String -> @+status:Chan(0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.SMsg) -> IO(String)
The answer to a request.
def Serve.answer.done source · line 234 · raw
@p:Pair(Socket, Poll<&1, &1, Result<&1, &1, Pair(Pair(U32, String), List<&2, U32>), Unit>, List<&2, U32>>) -> IO(Unit)
def Serve.answer source · line 240 · raw
@s:Socket -> @text:String -> IO(Unit)
def Serve.handle.got source · line 244 · raw
@p:Pair(Socket, Poll<&1, &1, Serve.Res(Maybe<&1, String>), Unit>) -> @+status:Chan(0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.SMsg) -> IO(Unit)
def Serve.handle source · line 252 · raw
@s:Socket -> @+status:Chan(0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.SMsg) -> IO(Unit)
def Serve.accepted source · line 256 · raw
@r:Serve.Res(Socket) -> @+status:Chan(0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.SMsg) -> IO(Unit)
def AEv.got source · line 266 · raw
@p:Pair(Listener, Serve.Res(Socket)) -> AEv
def Serve.loop source · line 272 · raw
@outer:Nat -> @fuel:Nat -> @ev:AEv -> @+status:Chan(0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.SMsg) -> IO(Unit)
Accepts forever (fuel permitting), serving each connection on its own.
def Serve.listening source · line 283 · raw
@r:Serve.Res(Listener) -> @+status:Chan(0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.SMsg) -> IO(Unit)
def Serve.run source · line 294 · raw
@+port:U32 -> @+status:Chan(0xd9b268abd125fd306c83ea43554e4f2c/src/runtime.SMsg) -> IO(Unit)
Serves the endpoints on 0.0.0.0:port.