src/serve.bend relies on unsafe/foreign
raw source on the hub · import bend-kube-runtime@0.8.1.0/src/serve.bend as Serve
5 imports
import Base import ./runtime.bend as R import ./control.bend as X import ./utf8.bend as U import ./sys.bend as Y
Types
type AEv source · line 283 · raw
Type
AGot@l:Listener -> @r:Result<&1, &1, Pair(U32, String), Socket> -> AEv
Definitions
def Serve.Res source · line 19 · raw
@-A:Type -> Type
def Serve.size source · line 22 · raw
@s:String -> U32
def Serve.reason.go source · line 25 · raw
@ok:Bool -> @missing:Bool -> String
def Serve.reason source · line 34 · raw
@+code:U32 -> String
def Serve.reply source · line 37 · raw
@+code:U32 -> @ctype:String -> @+body:String -> String
def Serve.first_line.go source · line 42 · raw
@ls:List<&2, String> -> String
def Serve.first_line source · line 49 · raw
@s:String -> String
def Serve.path.go source · line 52 · raw
@parts:List<&2, String> -> String
def Serve.path source · line 60 · raw
@req:String -> String
The request line's path.
def Serve.probe.answer source · line 63 · raw
@m:Poll<&1, &1, Maybe<&1, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap>>, Unit> -> Maybe<&2, List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap>>
def Serve.probe source · line 73 · raw
@+status:Chan(0xb8480759a6c549cc21905c5dfd719065/src/runtime.SMsg) -> IO(Maybe<&2, List<&2, 0xb8480759a6c549cc21905c5dfd719065/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 84 · raw
@ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap> -> Bool
def Serve.ready.go source · line 91 · raw
@standby:Bool -> @ready:Bool -> String
def Serve.ready source · line 101 · raw
@+ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap> -> String
Ready when every controller's store has listed; a standby is ready.
def Serve.bool source · line 104 · raw
@b:Bool -> String
def Serve.head source · line 111 · raw
@+name:String -> @kind:String -> @help:String -> String
def Serve.snap.name source · line 114 · raw
@s:0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap -> String
def Serve.nth source · line 119 · raw
@xs:List<&2, String> -> @n:Nat -> String
def Serve.snap.field source · line 130 · raw
@s:0xb8480759a6c549cc21905c5dfd719065/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 138 · raw
List<&2, String>
Reconcile durations as a Prometheus histogram: cumulative buckets in seconds, the sum and the count.
def Serve.buckets source · line 141 · raw
@+name:String -> @+ctl:String -> @les:List<&2, String> -> @cs:List<&2, U32> -> @+acc:U32 -> String
def Serve.pad3 source · line 150 · raw
@+n:U32 -> String
def Serve.secs source · line 153 · raw
@x:0xb8480759a6c549cc21905c5dfd719065/src/runtime.Sum -> String
def Serve.cache.go source · line 158 · raw
@+ctl:String -> @cz:List<&2, U32> -> @+i:U32 -> String
def Serve.caches source · line 166 · raw
@ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap> -> String
def Serve.hist source · line 173 · raw
@ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap> -> @+name:String -> String
def Serve.samples source · line 182 · raw
@ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap> -> @+name:String -> @+field:U32 -> String
One sample per controller, labeled with its kind.
def Serve.family source · line 190 · raw
@+ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap> -> @+name:String -> @kind:String -> @help:String -> @+field:U32 -> String
def Serve.text source · line 195 · raw
@+ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/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 211 · raw
@+ss:List<&2, 0xb8480759a6c549cc21905c5dfd719065/src/runtime.Snap> -> @own:String -> String
bend-kube's series, then the controller's own (own).
def Serve.meter.answer source · line 225 · raw
@m:Poll<&1, &1, Maybe<&1, String>, Unit> -> String
The controller's own metrics (X.Meter), rendered by the meter; nothing if it does not answer within 2s.
def Serve.meter source · line 232 · raw
@+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(String)
def Serve.route source · line 240 · raw
@path:String -> @+status:Chan(0xb8480759a6c549cc21905c5dfd719065/src/runtime.SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(String)
The answer to a request.
def Serve.answer.done source · line 254 · 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 260 · raw
@s:Socket -> @text:String -> IO(Unit)
def Serve.handle.got source · line 264 · raw
@p:Pair(Socket, Poll<&1, &1, Serve.Res(Maybe<&1, String>), Unit>) -> @+status:Chan(0xb8480759a6c549cc21905c5dfd719065/src/runtime.SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(Unit)
def Serve.handle source · line 272 · raw
@s:Socket -> @+status:Chan(0xb8480759a6c549cc21905c5dfd719065/src/runtime.SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(Unit)
def Serve.accepted source · line 276 · raw
@r:Serve.Res(Socket) -> @+status:Chan(0xb8480759a6c549cc21905c5dfd719065/src/runtime.SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(Unit)
def AEv.got source · line 286 · raw
@p:Pair(Listener, Serve.Res(Socket)) -> AEv
def Serve.loop source · line 292 · raw
@outer:Nat -> @fuel:Nat -> @ev:AEv -> @+status:Chan(0xb8480759a6c549cc21905c5dfd719065/src/runtime.SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(Unit)
Accepts forever (fuel permitting), serving each connection on its own.
def Serve.listening source · line 303 · raw
@r:Serve.Res(Listener) -> @+status:Chan(0xb8480759a6c549cc21905c5dfd719065/src/runtime.SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(Unit)
def Serve.run source · line 314 · raw
@+port:U32 -> @+status:Chan(0xb8480759a6c549cc21905c5dfd719065/src/runtime.SMsg) -> @+meter:Chan(0xb8480759a6c549cc21905c5dfd719065/src/control.Meter) -> IO(Unit)
Serves the endpoints on port, on IPv6 and IPv4 (Y.Sys.listen).