Debian Codegraph @

pamqp/constants.py

raw
1 # Auto-generated, do not edit this file.
2 import re
3
4 # AMQP Protocol Frame Prefix
5 AMQP = b'AMQP'
6
7 # AMQP Protocol Version
8 VERSION = (0, 9, 1)
9
10 # RabbitMQ Defaults
11 DEFAULT_HOST = 'localhost'
12 DEFAULT_PORT = 5672
13 DEFAULT_USER = 'guest'
14 DEFAULT_PASS = 'guest'
15 DEFAULT_VHOST = '/'
16
17 # AMQP Constants
18 FRAME_METHOD = 1
19 FRAME_HEADER = 2
20 FRAME_BODY = 3
21 FRAME_HEARTBEAT = 8
22 FRAME_MIN_SIZE = 4096
23 FRAME_END = 206
24 # Indicates that the method completed successfully. This reply code is reserved
25 # for future use - the current protocol design does not use positive
26 # confirmation and reply codes are sent only in case of an error.
27 REPLY_SUCCESS = 200
28
29 # Not included in the spec XML or JSON files.
30 FRAME_END_CHAR = b'\xce'
31 FRAME_HEADER_SIZE = 7
32 FRAME_MAX_SIZE = 131072
33
34 # AMQP data types
35 DATA_TYPES = [
36 'bit', # single bit
37 'long', # 32-bit integer
38 'longlong', # 64-bit integer
39 'longstr', # long string
40 'octet', # single octet
41 'short', # 16-bit integer
42 'shortstr', # short string (max. 256 characters)
43 'table', # field table
44 'timestamp', # 64-bit timestamp
45 ]
46
47 # AMQP domains
48 DOMAINS = {
49 'channel-id': 'longstr',
50 'class-id': 'short',
51 'consumer-tag': 'shortstr',
52 'delivery-tag': 'longlong',
53 'destination': 'shortstr',
54 'duration': 'longlong',
55 'exchange-name': 'shortstr',
56 'message-count': 'long',
57 'method-id': 'short',
58 'no-ack': 'bit',
59 'no-local': 'bit',
60 'offset': 'longlong',
61 'path': 'shortstr',
62 'peer-properties': 'table',
63 'queue-name': 'shortstr',
64 'redelivered': 'bit',
65 'reference': 'longstr',
66 'reject-code': 'short',
67 'reject-text': 'shortstr',
68 'reply-code': 'short',
69 'reply-text': 'shortstr',
70 'security-token': 'longstr',
71 }
72
73 # AMQP domain patterns
74 DOMAIN_REGEX = {
75 'exchange-name': re.compile(r'^[a-zA-Z0-9-_.:@#,/+ ]*$'),
76 'queue-name': re.compile(r'^[a-zA-Z0-9-_.:@#,/+ ]*$'),
77 }
78
79 # Other constants
80 DEPRECATION_WARNING = 'This command is deprecated in AMQP 0-9-1'