pamqp.base
pamqp.base
Base classes for the representation of frames and data structures.
Frame
Bases: _AMQData
Base Class for AMQ Methods for encoding and decoding
Source code in pamqp/base.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | |
marshal()
Dynamically encode the frame by taking the list of attributes and encode them item by item getting the value form the object attribute and the data type from the class attribute.
Source code in pamqp/base.py
78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 | |
unmarshal(data)
Dynamically decode the frame data applying the values to the method object by iterating through the attributes in order and decoding them.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
bytes
|
The raw AMQP frame data |
required |
Source code in pamqp/base.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 | |
validate()
Validate the frame data ensuring all domains or attributes adhere to the protocol specification.
Source code in pamqp/base.py
133 134 135 136 137 138 139 | |
BasicProperties
Bases: _AMQData
Provide a base object that marshals and unmarshals the Basic.Properties object values.
Source code in pamqp/base.py
142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
encode_property(name, value)
Encode a single property value
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the property to encode |
required |
value
|
FieldValue
|
The property to encode |
required |
Source code in pamqp/base.py
159 160 161 162 163 164 165 166 167 168 | |
marshal()
Take the Basic.Properties data structure and marshal it into the data structure needed for the ContentHeader.
Source code in pamqp/base.py
170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
unmarshal(flags, data)
Dynamically decode the frame data applying the values to the method object by iterating through the attributes in order and decoding them.
Source code in pamqp/base.py
196 197 198 199 200 201 202 203 204 205 206 | |
validate()
Validate the frame data ensuring all domains or attributes adhere to the protocol specification.
Source code in pamqp/base.py
208 209 210 211 212 213 214 215 216 217 218 219 | |