~/bend-docscommunity

src/exec.bend relies on unsafe/foreign

raw source on the hub · import bend-kube-runtime@0.5.3.0/src/exec.bend as Exec

10 imports
import Base
import ./json.bend as J
import ./utf8.bend as U
import ./base64.bend as B
import ./http.bend as H
import ./net.bend as N
import ./core.bend as C
import ./config.bend as K
import ./client.bend as Cl
import ./ws.bend as W

Types

type Out source · line 22 · raw

Data

type Scan source · line 90 · raw

Data

Bytes up to the blank line that ends the head (reversed), how much of CR LF CR LF matched so far, and the bytes after it.

type HEv source · line 127 · raw

Type

type Acc source · line 164 · raw

Data

Output so far (each reversed), the channel of the message a continuation frame extends, whether the server closed, and the decoder.

type XEv source · line 255 · raw

Type

Definitions

def Exec.ok source · line 29 · raw

@o:Out -> Bool

Whether the command exited 0.

def Exec.why source · line 36 · raw

@o:Out -> String

Why it did not: the Status message (the exit code, or why it could not run).

def Exec.stdout source · line 41 · raw

@o:Out -> String

def Exec.stderr source · line 46 · raw

@o:Out -> String

def Exec.args source · line 54 · raw

@cmd:List<&2, String> -> String

def Exec.flag source · line 61 · raw

@on:Bool -> String

def Exec.path source · line 68 · raw

@ns:String -> @pod:String -> @container:String -> @cmd:List<&2, String> -> @stdin:Bool -> String

def Exec.key source · line 74 · raw

@+k:U32 -> String

def Exec.req source · line 80 · raw

@path:String -> @+k:U32 -> 0x4b19fea9f3c794558ea41a0289840d6a/src/http.Req

def Scan.next.go source · line 93 · raw

@+m:U32 -> @hit:Bool -> @cr:Bool -> U32

def Scan.next source · line 103 · raw

@+m:U32 -> @+b:U32 -> U32

The next count of CR LF CR LF matched, after byte b.

def Scan.feed.go source · line 107 · raw

@bs:List<&2, U32> -> @+head:List<&2, U32> -> @+m:U32 -> @+rest:List<&2, U32> -> @found:Bool -> Scan

def Scan.feed source · line 117 · raw

@s:Scan -> @bs:List<&2, U32> -> Scan

def Scan.found source · line 122 · raw

@s:Scan -> Bool

def HEv.got source · line 131 · raw

@p:Pair(Socket, Result<&1, &1, Pair(U32, String), List<&2, U32>>) -> HEv

def Exec.head source · line 137 · raw

@fuel:Nat -> @ev:HEv -> @+sc:Scan -> @+ms:U32 -> IO(Pair(Socket, Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Scan>))

Reads until the head is whole.

def Acc.put.go source · line 168 · raw

@st:0x4b19fea9f3c794558ea41a0289840d6a/src/ws.WSt -> @+chan:U32 -> @bs:List<&2, U32> -> @+o:List<&2, U32> -> @+e:List<&2, U32> -> @+s:List<&2, U32> -> @closed:Bool -> @one:Bool -> @two:Bool -> @three:Bool -> Acc

def Acc.put source · line 180 · raw

@st:0x4b19fea9f3c794558ea41a0289840d6a/src/ws.WSt -> @+chan:U32 -> @bs:List<&2, U32> -> @+o:List<&2, U32> -> @+e:List<&2, U32> -> @+s:List<&2, U32> -> @closed:Bool -> Acc

def Acc.frame.kind source · line 185 · raw

@st:0x4b19fea9f3c794558ea41a0289840d6a/src/ws.WSt -> @+o:List<&2, U32> -> @+e:List<&2, U32> -> @+s:List<&2, U32> -> @+ch:U32 -> @cl:Bool -> @data:List<&2, U32> -> @cont:Bool -> @msg:Bool -> @close:Bool -> Acc

def Acc.frame.go source · line 197 · raw

@st:0x4b19fea9f3c794558ea41a0289840d6a/src/ws.WSt -> @+o:List<&2, U32> -> @+e:List<&2, U32> -> @+s:List<&2, U32> -> @+ch:U32 -> @cl:Bool -> @+op:U32 -> @data:List<&2, U32> -> Acc

def Acc.frame source · line 204 · raw

@a:Acc -> @f:0x4b19fea9f3c794558ea41a0289840d6a/src/ws.Frame -> Acc

One frame: a data frame starts with its channel; a continuation extends the last one; close ends the stream; pings and pongs are dropped.

def Acc.frames source · line 209 · raw

@fs:List<&2, 0x4b19fea9f3c794558ea41a0289840d6a/src/ws.Frame> -> @a:Acc -> Acc

def Acc.with source · line 216 · raw

@a:Acc -> @st:0x4b19fea9f3c794558ea41a0289840d6a/src/ws.WSt -> Acc

def Acc.fed source · line 221 · raw

@a:Acc -> @f:0x4b19fea9f3c794558ea41a0289840d6a/src/ws.Fed -> Acc

def Acc.feed source · line 226 · raw

@a:Acc -> @bs:List<&2, U32> -> Acc

def Acc.closed source · line 231 · raw

@a:Acc -> Bool

def Acc.error source · line 236 · raw

@a:Acc -> Maybe<&2, String>

def Acc.status source · line 241 · raw

@s:Result<&2, &2, String, 0x4b19fea9f3c794558ea41a0289840d6a/src/json.Json> -> 0x4b19fea9f3c794558ea41a0289840d6a/src/json.Json

def Acc.out source · line 249 · raw

@a:Acc -> Out

def XEv.got source · line 259 · raw

@p:Pair(Socket, Result<&1, &1, Pair(U32, String), List<&2, U32>>) -> XEv

def Exec.read source · line 265 · raw

@fuel:Nat -> @ev:XEv -> @+acc:Acc -> @+ms:U32 -> IO(Pair(Socket, Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>))

Reads messages until the server closes or the stream ends.

def Exec.Res source · line 291 · raw

Type

def Exec.close source · line 294 · raw

@p:Pair(Socket, Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>) -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.listen source · line 300 · raw

@s:Socket -> @rest:List<&2, U32> -> @+ms:U32 -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.sent source · line 307 · raw

@p:Pair(Socket, Result<&1, &1, Pair(U32, String), Unit>) -> @rest:List<&2, U32> -> @+ms:U32 -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.input source · line 316 · raw

@+text:String -> @+k:U32 -> List<&2, U32>

The input, then the close of stdin, in one write.

def Exec.upgraded source · line 320 · raw

@s:Socket -> @rest:List<&2, U32> -> @stdin:Maybe<&2, String> -> @+k:U32 -> @+ms:U32 -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.message source · line 329 · raw

@+text:String -> @j:Result<&2, &2, String, 0x4b19fea9f3c794558ea41a0289840d6a/src/json.Json> -> String

def Exec.refused source · line 338 · raw

@+code:U32 -> @reason:String -> @+rest:List<&2, U32> -> 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr

A refused upgrade: the status, and the message of the Status body the head's recv brought along (or the bytes as they are).

def Exec.answer.go source · line 342 · raw

@s:Socket -> @+code:U32 -> @reason:String -> @rest:List<&2, U32> -> @stdin:Maybe<&2, String> -> @+k:U32 -> @+ms:U32 -> @up:Bool -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.answer source · line 350 · raw

@s:Socket -> @h:Maybe<&2, 0x4b19fea9f3c794558ea41a0289840d6a/src/http.Head> -> @rest:List<&2, U32> -> @stdin:Maybe<&2, String> -> @+k:U32 -> @+ms:U32 -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.headed source · line 358 · raw

@p:Pair(Socket, Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Scan>) -> @stdin:Maybe<&2, String> -> @+k:U32 -> @+ms:U32 -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.opened source · line 367 · raw

@t:Result<&1, &1, Pair(U32, String), 0x4b19fea9f3c794558ea41a0289840d6a/src/net.Tls> -> @stdin:Maybe<&2, String> -> @+k:U32 -> @+ms:U32 -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.keyed source · line 377 · raw

@+cfg:0x4b19fea9f3c794558ea41a0289840d6a/src/config.Config -> @path:String -> @stdin:Maybe<&2, String> -> @+ms:U32 -> @r:Result<&1, &1, Pair(U32, String), U32> -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

def Exec.run source · line 389 · raw

@+cfg:0x4b19fea9f3c794558ea41a0289840d6a/src/config.Config -> @ns:String -> @pod:String -> @container:String -> @cmd:List<&2, String> -> @+stdin:Maybe<&2, String> -> @+ms:U32 -> IO(Result<&2, &2, 0x4b19fea9f3c794558ea41a0289840d6a/src/client.KErr, Out>)

Runs cmd in container of pod ns/name, writing stdin to it (None: no stdin), and collects its output; ms bounds each wait for the server (0: none). Done means the exec ran: Exec.ok says how the command ended.