Example #1
0
def parse_basic_publish_parameters(bio: BytesIO, encoding: str, rabbitmq: bool) -> BasicPublishParameters:
    parse_binary_shortstr(bio)
    return BasicPublishParameters(
        parse_shortstr(bio, encoding),
        parse_shortstr(bio, encoding),
        *parse_booleans(bio, 2)
    )
Example #2
0
def parse_queue_unbind_parameters(bio: BytesIO, encoding: str,
                                  rabbitmq: bool) -> QueueUnbindParameters:
    parse_binary_shortstr(bio)
    return QueueUnbindParameters(parse_shortstr(bio, encoding),
                                 parse_shortstr(bio, encoding),
                                 parse_shortstr(bio, encoding),
                                 parse_field_table(bio, encoding, rabbitmq))
Example #3
0
def parse_exchange_declare_parameters(
        bio: BytesIO, encoding: str,
        rabbitmq: bool) -> ExchangeDeclareParameters:
    parse_binary_shortstr(bio)  # reserved
    return ExchangeDeclareParameters(
        parse_shortstr(bio, encoding), parse_shortstr(bio, encoding),
        *parse_booleans(bio, 5), parse_field_table(bio, encoding, rabbitmq))
Example #4
0
def parse_basic_consume_parameters(bio: BytesIO, encoding: str, rabbitmq: bool) -> BasicConsumeParameters:
    parse_binary_shortstr(bio)
    return BasicConsumeParameters(
        parse_shortstr(bio, encoding),
        parse_shortstr(bio, encoding),
        *parse_booleans(bio, 4),
        parse_field_table(bio, encoding, rabbitmq)
    )
Example #5
0
def parse_basic_get_empty_parameters(bio: BytesIO, encoding: str, rabbitmq: bool) -> None:
    parse_binary_shortstr(bio)
    return None
Example #6
0
def parse_basic_get_parameters(bio: BytesIO, encoding: str, rabbitmq: bool) -> BasicGetParameters:
    parse_binary_shortstr(bio)
    return BasicGetParameters(
        parse_shortstr(bio, encoding),
        parse_boolean(bio)
    )
Example #7
0
def parse_connection_open_ok_parameters(bio: BytesIO, encoding: str,
                                        rabbitmq: bool) -> None:
    parse_binary_shortstr(bio)  # reserved value, throw away
    return None
Example #8
0
def parse_queue_declare_parameters(bio: BytesIO, encoding: str,
                                   rabbitmq: bool) -> QueueDeclareParameters:
    parse_binary_shortstr(bio)
    return QueueDeclareParameters(parse_shortstr(bio, encoding),
                                  parse_booleans(bio, 5),
                                  parse_field_table(bio, encoding, rabbitmq))
Example #9
0
def parse_queue_purge_parameters(bio: BytesIO, encoding: str,
                                 rabbitmq: bool) -> QueuePurgeParameters:
    parse_binary_shortstr(bio)
    return QueuePurgeParameters(parse_shortstr(bio, encoding),
                                parse_boolean(bio))
Example #10
0
def parse_channel_open_parameters(bio: BytesIO, encoding: str,
                                  rabbitmq: bool) -> None:
    parse_binary_shortstr(bio)
    return None
Example #11
0
def parse_exchange_delete_parameters(
        bio: BytesIO, encoding: str,
        rabbitmq: bool) -> ExchangeDeleteParameters:
    parse_binary_shortstr(bio)  # reserved
    return ExchangeDeleteParameters(parse_shortstr(bio, encoding),
                                    *parse_booleans(bio, 2))