module documentation

Undocumented

Exception SocketError Undocumented
Function consume_socket_output Iterate through frames read from the socket and return the result.
Function demux_adaptor Utility to demultiplex stdout and stderr when reading frames from the socket.
Function frames_iter Return a generator of frames read from socket. A frame is a tuple where the first item is the stream number and the second item is a chunk of data.
Function frames_iter_no_tty Returns a generator of data read from the socket when the tty setting is not enabled.
Function frames_iter_tty Return a generator of data read from the socket when the tty setting is enabled.
Function next_frame_header Returns the stream and size of the next frame of data waiting to be read from socket, according to the protocol defined here:
Function read Reads at most n bytes from socket
Function read_exactly Reads exactly n bytes from socket Raises SocketError if there isn't enough data
Constant NPIPE_ENDED Undocumented
Constant STDERR Undocumented
Constant STDOUT Undocumented
def consume_socket_output(frames, demux=False): (source)

Iterate through frames read from the socket and return the result. Args: demux (bool): If False, stdout and stderr are multiplexed, and the result is the concatenation of all the frames. If True, the streams are demultiplexed, and the result is a 2-tuple where each item is the concatenation of frames belonging to the same stream.

def demux_adaptor(stream_id, data): (source)

Utility to demultiplex stdout and stderr when reading frames from the socket.

def frames_iter(socket, tty): (source)

Return a generator of frames read from socket. A frame is a tuple where the first item is the stream number and the second item is a chunk of data. If the tty setting is enabled, the streams are multiplexed into the stdout stream.

def frames_iter_no_tty(socket): (source)

Returns a generator of data read from the socket when the tty setting is not enabled.

def frames_iter_tty(socket): (source)

Return a generator of data read from the socket when the tty setting is enabled.

def next_frame_header(socket): (source)

Returns the stream and size of the next frame of data waiting to be read from socket, according to the protocol defined here: https://docs.docker.com/engine/api/v1.24/#attach-to-a-container

def read(socket, n=4096): (source)

Reads at most n bytes from socket

def read_exactly(socket, n): (source)

Reads exactly n bytes from socket Raises SocketError if there isn't enough data

NPIPE_ENDED: int = (source)

Undocumented

Value
109

Undocumented

Value
2

Undocumented

Value
1