Utils

aetcd3.utils.prefix_range_end(prefix)[source]

Create a bytestring that can be used as a range_end for a prefix.

aetcd3.utils.to_bytes(maybe_bytestring)[source]

Encode string to bytes.

Convenience function to do a simple encode(‘utf-8’) if the input is not already bytes. Returns the data unmodified if the input is bytes.

aetcd3.utils.lease_to_id(lease)[source]

Figure out if the argument is a Lease object, or the lease ID.

aetcd3.utils.response_to_event_iterator(response_iterator)[source]

Convert a watch response iterator to an event iterator.