dolor.types.string

String-related types.

class String(max_length, *, prefix: dolor.types.type.Type = None, encoding=None)[source]

Bases: dolor.types.type.Type

A string.

Parameters
  • max_length (int) – The maximum length of the string. By default 32767.

  • prefix (subclass of Type, optional) – The type at the start of the data that tells how many bytes to read to get the string data. By default VarInt.

  • encoding (str, optional) – What encoding to use for parsing the string data. By default "utf-8".

max_length = 32767
prefix

alias of dolor.types.numeric.VarInt

encoding = 'utf-8'
class Json[source]

Bases: dolor.types.type.Type

JSON data.

Wraps json.loads() and json.dumps and String.

class Identifier[source]

Bases: dolor.types.type.Type

An identifier for a resource location.

class Identifier(id=None)[source]

Bases: object

The value type of Identifier.

Parameters

id (str, optional) –

The namespaced location.

See https://wiki.vg/Protocol#Identifier for details.