pax_global_header00006660000000000000000000000064131024123250014503gustar00rootroot0000000000000052 comment=fc9bb3361535b6096c75d3cd44f94e7f534188cd rabbitmq-codegen-rabbitmq_v3_6_12/000077500000000000000000000000001310241232500172105ustar00rootroot00000000000000rabbitmq-codegen-rabbitmq_v3_6_12/.gitignore000066400000000000000000000001171310241232500211770ustar00rootroot00000000000000*~ .sw? .*.sw? *.beam *.pyc erl_crash.dump /build/ /cover/ /dist/ /ebin/ /tmp/ rabbitmq-codegen-rabbitmq_v3_6_12/CODE_OF_CONDUCT.md000066400000000000000000000045051310241232500220130ustar00rootroot00000000000000# Contributor Code of Conduct As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. Examples of unacceptable behavior by participants include: * The use of sexualized language or imagery * Personal attacks * Trolling or insulting/derogatory comments * Public or private harassment * Publishing other's private information, such as physical or electronic addresses, without explicit permission * Other unethical or unprofessional conduct Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [info@rabbitmq.com](mailto:info@rabbitmq.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident. This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.3.0, available at [contributor-covenant.org/version/1/3/0/](http://contributor-covenant.org/version/1/3/0/) rabbitmq-codegen-rabbitmq_v3_6_12/CONTRIBUTING.md000066400000000000000000000032001310241232500214340ustar00rootroot00000000000000## Overview RabbitMQ projects use pull requests to discuss, collaborate on and accept code contributions. Pull requests is the primary place of discussing code changes. ## How to Contribute The process is fairly standard: * Fork the repository or repositories you plan on contributing to * Clone [RabbitMQ umbrella repository](https://github.com/rabbitmq/rabbitmq-public-umbrella) * `cd umbrella`, `make co` * Create a branch with a descriptive name in the relevant repositories * Make your changes, run tests, commit with a [descriptive message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html), push to your fork * Submit pull requests with an explanation what has been changed and **why** * Submit a filled out and signed [Contributor Agreement](https://github.com/rabbitmq/ca#how-to-submit) if needed (see below) * Be patient. We will get to your pull request eventually If what you are going to work on is a substantial change, please first ask the core team of their opinion on [RabbitMQ mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users). ## Code of Conduct See [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md). ## Contributor Agreement If you want to contribute a non-trivial change, please submit a signed copy of our [Contributor Agreement](https://github.com/rabbitmq/ca#how-to-submit) around the time you submit your pull request. This will make it much easier (in some cases, possible) for the RabbitMQ team at Pivotal to merge your contribution. ## Where to Ask Questions If something isn't clear, feel free to ask on our [mailing list](https://groups.google.com/forum/#!forum/rabbitmq-users). rabbitmq-codegen-rabbitmq_v3_6_12/LICENSE000066400000000000000000000003531310241232500202160ustar00rootroot00000000000000This package, the RabbitMQ code generation library and associated files, is licensed under the MPL. For the MPL, please see LICENSE-MPL-RabbitMQ. If you have any questions regarding licensing, please contact us at info@rabbitmq.com. rabbitmq-codegen-rabbitmq_v3_6_12/LICENSE-MPL-RabbitMQ000066400000000000000000000605011310241232500223040ustar00rootroot00000000000000 MOZILLA PUBLIC LICENSE Version 1.1 --------------- 1. Definitions. 1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. 1.1. "Contributor" means each entity that creates or contributes to the creation of Modifications. 1.2. "Contributor Version" means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. 1.3. "Covered Code" means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. 1.4. "Electronic Distribution Mechanism" means a mechanism generally accepted in the software development community for the electronic transfer of data. 1.5. "Executable" means Covered Code in any form other than Source Code. 1.6. "Initial Developer" means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. 1.7. "Larger Work" means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. 1.8. "License" means this document. 1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. 1.9. "Modifications" means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. B. Any new file that contains any part of the Original Code or previous Modifications. 1.10. "Original Code" means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. 1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation, method, process, and apparatus claims, in any patent Licensable by grantor. 1.11. "Source Code" means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. 1.12. "You" (or "Your") means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You" includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control" means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. 2. Source Code License. 2.1. The Initial Developer Grant. The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: (a) under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and (b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). (c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. (d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code; or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. 2.2. Contributor Grant. Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license (a) under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and (b) under Patent Claims infringed by the making, using, or selling of Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of Modifications made by that Contributor with its Contributor Version (or portions of such combination). (c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. (d) Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2) separate from the Contributor Version; 3) for infringements caused by: i) third party modifications of Contributor Version or ii) the combination of Modifications made by that Contributor with other software (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. 3. Distribution Obligations. 3.1. Application of License. The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. 3.2. Availability of Source Code. Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. 3.3. Description of Modifications. You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. 3.4. Intellectual Property Matters (a) Third Party Claims. If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL" which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. (b) Contributor APIs. If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. (c) Representations. Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. 3.5. Required Notices. You must duplicate the notice in Exhibit A in each file of the Source Code. If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice. If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A. You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code. You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. 3.6. Distribution of Executable Versions. You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. 3.7. Larger Works. You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. 4. Inability to Comply Due to Statute or Regulation. If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. 5. Application of this License. This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. 6. Versions of the License. 6.1. New Versions. Netscape Communications Corporation ("Netscape") may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. 6.2. Effect of New Versions. Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License. 6.3. Derivative Works. If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases "Mozilla", "MOZILLAPL", "MOZPL", "Netscape", "MPL", "NPL" or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) 7. DISCLAIMER OF WARRANTY. COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. 8. TERMINATION. 8.1. This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. 8.2. If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant") alleging that: (a) such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i) agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant. If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. (b) any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. 8.3. If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. 8.4. In the event of termination under Sections 8.1 or 8.2 above, all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. 9. LIMITATION OF LIABILITY. UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. 10. U.S. GOVERNMENT END USERS. The Covered Code is a "commercial item," as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of "commercial computer software" and "commercial computer software documentation," as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. 11. MISCELLANEOUS. This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. 12. RESPONSIBILITY FOR CLAIMS. As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. 13. MULTIPLE-LICENSED CODE. Initial Developer may designate portions of the Covered Code as "Multiple-Licensed". "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. EXHIBIT A -Mozilla Public License. ``The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/ Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. The Original Code is RabbitMQ. The Initial Developer of the Original Code is GoPivotal, Inc. Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved.'' [NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] rabbitmq-codegen-rabbitmq_v3_6_12/Makefile000066400000000000000000000001421310241232500206450ustar00rootroot00000000000000all: @: clean: rm -f *.pyc distclean: clean find . -regex '.*\(~\|#\|\.swp\)' -exec rm {} \; rabbitmq-codegen-rabbitmq_v3_6_12/README.extensions.md000066400000000000000000000141611310241232500226700ustar00rootroot00000000000000# Protocol extensions The `amqp_codegen.py` AMQP specification compiler has recently been enhanced to take more than a single specification file, which allows AMQP library authors to include extensions to the core protocol without needing to modify the core AMQP specification file as distributed. The compiler is invoked with the path to a single "main" specification document and zero or more paths to "extension" documents. The order of the extensions matters: any later class property definitions, for instance, are added to the list of definitions in order of appearance. In general, composition of extensions with a core specification document is therefore non-commutative. ## The main document Written in the style of a [json-shapes](http://github.com/tonyg/json-shapes) schema: DomainDefinition = _and(array_of(string()), array_length_equals(2)); ConstantDefinition = { "name": string(), "value": number(), "class": optional(_or("soft-error", "hard-error")) }; FieldDefinition = { "name": string(), "type": string(), "default-value": optional(anything()) }; MethodDefinition = { "name": string(), "id": number(), "arguments": array_of(FieldDefinition), "synchronous": optional(boolean()), "content": optional(boolean()) }; ClassDefinition = { "name": string(), "id": number(), "methods": array_of(MethodDefinition), "properties": optional(array_of(FieldDefinition)) }; MainDocument = { "major-version": number(), "minor-version": number(), "revision": optional(number()), "port": number(), "domains": array_of(DomainDefinition), "constants": array_of(ConstantDefinition), "classes": array_of(ClassDefinition), } Within a `FieldDefinition`, the keyword `domain` can be used instead of `type`, but `type` is preferred and `domain` is deprecated. Type names can either be a defined `domain` name or a built-in name from the following list: - octet - shortstr - longstr - short - long - longlong - bit - table - timestamp Method and class IDs must be integers between 0 and 65535, inclusive. Note that there is no specific subset of the space reserved for experimental or site-local extensions, so be careful not to conflict with IDs used by the AMQP core specification. If the `synchronous` field of a `MethodDefinition` is missing, it is assumed to be `false`; the same applies to the `content` field. A `ConstantDefinition` with a `class` attribute is considered to be an error-code definition; otherwise, it is considered to be a straightforward numeric constant. ## Extensions Written in the style of a [json-shapes](http://github.com/tonyg/json-shapes) schema, and referencing some of the type definitions given above: ExtensionDocument = { "extension": anything(), "domains": array_of(DomainDefinition), "constants": array_of(ConstantDefinition), "classes": array_of(ClassDefinition) }; The `extension` keyword is used to describe the extension informally for human readers. Typically it will be a dictionary, with members such as: { "name": "The name of the extension", "version": "1.0", "copyright": "Copyright (C) 1234 Yoyodyne, Inc." } ## Merge behaviour In the case of conflicts between values specified in the main document and in any extension documents, type-specific merge operators are invoked. - Any doubly-defined domain names are regarded as true conflicts. Otherwise, all the domain definitions from all the main and extension documents supplied to the compiler are merged into a single dictionary. - Constant definitions are treated as per domain names above, *mutatis mutandis*. - Classes and their methods are a little trickier: if an extension defines a class with the same name as one previously defined, then only the `methods` and `properties` fields of the extension's class definition are attended to. - Any doubly-defined method names or property names within a class are treated as true conflicts. - Properties defined in an extension are added to the end of the extant property list for the class. (Extensions are of course permitted to define brand new classes as well as to extend existing ones.) - Any other kind of conflict leads to a raised `AmqpSpecFileMergeConflict` exception. ## Invoking the spec compiler Your code generation code should invoke `amqp_codegen.do_main_dict` with a dictionary of functions as the sole argument. Each will be used for generationg a separate file. The `do_main_dict` function will parse the command-line arguments supplied when python was invoked. The command-line will be parsed as: python your_codegen.py [ ...] where `` is a key into the dictionary supplied to `do_main_dict` and is used to select which generation function is called. The `` and `` arguments are file names of specification documents containing expressions in the syntax given above. The *final* argument on the command line, ``, is the name of the source-code file to generate. Here's a tiny example of the layout of a code generation module that uses `amqp_codegen`: import amqp_codegen def generateHeader(specPath): spec = amqp_codegen.AmqpSpec(specPath) ... def generateImpl(specPath): spec = amqp_codegen.AmqpSpec(specPath) ... if __name__ == "__main__": amqp_codegen.do_main_dict({"header": generateHeader, "body": generateImpl}) The reasons for allowing more than one action, are that - many languages have separate "header"-type files (C and Erlang, to name two) - `Makefile`s often require separate rules for generating the two kinds of file, but it's convenient to keep the generation code together in a single python module The main reason things are laid out this way, however, is simply that it's an accident of the history of the code. We may change the API to `amqp_codegen` in future to clean things up a little. rabbitmq-codegen-rabbitmq_v3_6_12/amqp-1.0/000077500000000000000000000000001310241232500204425ustar00rootroot00000000000000rabbitmq-codegen-rabbitmq_v3_6_12/amqp-1.0/messaging.xml000066400000000000000000000225621310241232500231500ustar00rootroot00000000000000
rabbitmq-codegen-rabbitmq_v3_6_12/amqp-1.0/security.xml000066400000000000000000000075721310241232500230460ustar00rootroot00000000000000
rabbitmq-codegen-rabbitmq_v3_6_12/amqp-1.0/transactions.xml000066400000000000000000000102241310241232500236730ustar00rootroot00000000000000
rabbitmq-codegen-rabbitmq_v3_6_12/amqp-1.0/transport.xml000066400000000000000000000261641310241232500232310ustar00rootroot00000000000000
rabbitmq-codegen-rabbitmq_v3_6_12/amqp-1.0/types.xml000066400000000000000000000135251310241232500223360ustar00rootroot00000000000000
rabbitmq-codegen-rabbitmq_v3_6_12/amqp-rabbitmq-0.8.json000066400000000000000000001136201310241232500231460ustar00rootroot00000000000000{ "name": "AMQP", "major-version": 8, "minor-version": 0, "port": 5672, "copyright": [ "Copyright (C) 2008-2016 Pivotal Software, Inc, Inc.\n", "\n", "Permission is hereby granted, free of charge, to any person\n", "obtaining a copy of this file (the \"Software\"), to deal in the\n", "Software without restriction, including without limitation the \n", "rights to use, copy, modify, merge, publish, distribute, \n", "sublicense, and/or sell copies of the Software, and to permit \n", "persons to whom the Software is furnished to do so, subject to \n", "the following conditions:\n", "\n", "The above copyright notice and this permission notice shall be\n", "included in all copies or substantial portions of the Software.\n", "\n", "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n", "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n", "OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n", "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n", "HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n", "WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n", "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n", "OTHER DEALINGS IN THE SOFTWARE.\n", "\n", "Class information entered from amqp_xml0-8.pdf and domain types from amqp-xml-doc0-9.pdf\n", "\n", "b3cb053f15e7b98808c0ccc67f23cb3e amqp_xml0-8.pdf\n", "http://www.twiststandards.org/index.php?option=com_docman&task=cat_view&gid=28&&Itemid=90\n", "8444db91e2949dbecfb2585e9eef6d64 amqp-xml-doc0-9.pdf\n", "https://jira.amqp.org/confluence/download/attachments/720900/amqp-xml-doc0-9.pdf?version=1\n"], "domains": [ ["access-ticket", "short"], ["bit", "bit"], ["channel-id", "longstr"], ["class-id", "short"], ["consumer-tag", "shortstr"], ["delivery-tag", "longlong"], ["destination", "shortstr"], ["duration", "longlong"], ["exchange-name", "shortstr"], ["known-hosts", "shortstr"], ["long", "long"], ["longlong", "longlong"], ["longstr", "longstr"], ["method-id", "short"], ["no-ack", "bit"], ["no-local", "bit"], ["octet", "octet"], ["offset", "longlong"], ["path", "shortstr"], ["peer-properties", "table"], ["queue-name", "shortstr"], ["redelivered", "bit"], ["reference", "longstr"], ["reject-code", "short"], ["reject-text", "shortstr"], ["reply-code", "short"], ["reply-text", "shortstr"], ["security-token", "longstr"], ["short", "short"], ["shortstr", "shortstr"], ["table", "table"], ["timestamp", "timestamp"] ], "constants": [ {"name": "FRAME-METHOD", "value": 1}, {"name": "FRAME-HEADER", "value": 2}, {"name": "FRAME-BODY", "value": 3}, {"name": "FRAME-OOB-METHOD", "value": 4}, {"name": "FRAME-OOB-HEADER", "value": 5}, {"name": "FRAME-OOB-BODY", "value": 6}, {"name": "FRAME-TRACE", "value": 7}, {"name": "FRAME-HEARTBEAT", "value": 8}, {"name": "FRAME-MIN-SIZE", "value": 4096}, {"name": "FRAME-END", "value": 206}, {"name": "REPLY-SUCCESS", "value": 200}, {"name": "NOT-DELIVERED", "value": 310, "class": "soft-error"}, {"name": "CONTENT-TOO-LARGE", "value": 311, "class": "soft-error"}, {"name": "NO-ROUTE", "value": 312, "class": "soft-error"}, {"name": "NO-CONSUMERS", "value": 313, "class": "soft-error"}, {"name": "ACCESS-REFUSED", "value": 403, "class": "soft-error"}, {"name": "NOT-FOUND", "value": 404, "class": "soft-error"}, {"name": "RESOURCE-LOCKED", "value": 405, "class": "soft-error"}, {"name": "PRECONDITION-FAILED", "value": 406, "class": "soft-error"}, {"name": "CONNECTION-FORCED", "value": 320, "class": "hard-error"}, {"name": "INVALID-PATH", "value": 402, "class": "hard-error"}, {"name": "FRAME-ERROR", "value": 501, "class": "hard-error"}, {"name": "SYNTAX-ERROR", "value": 502, "class": "hard-error"}, {"name": "COMMAND-INVALID", "value": 503, "class": "hard-error"}, {"name": "CHANNEL-ERROR", "value": 504, "class": "hard-error"}, {"name": "UNEXPECTED-FRAME", "value": 505, "class": "hard-error"}, {"name": "RESOURCE-ERROR", "value": 506, "class": "hard-error"}, {"name": "NOT-ALLOWED", "value": 530, "class": "hard-error"}, {"name": "NOT-IMPLEMENTED", "value": 540, "class": "hard-error"}, {"name": "INTERNAL-ERROR", "value": 541, "class": "hard-error"} ], "classes": [ { "id": 10, "methods": [{"id": 10, "arguments": [{"type": "octet", "name": "version-major", "default-value": 0}, {"type": "octet", "name": "version-minor", "default-value": 8}, {"domain": "peer-properties", "name": "server-properties"}, {"type": "longstr", "name": "mechanisms", "default-value": "PLAIN"}, {"type": "longstr", "name": "locales", "default-value": "en_US"}], "name": "start", "synchronous" : true}, {"id": 11, "arguments": [{"domain": "peer-properties", "name": "client-properties"}, {"type": "shortstr", "name": "mechanism", "default-value": "PLAIN"}, {"type": "longstr", "name": "response"}, {"type": "shortstr", "name": "locale", "default-value": "en_US"}], "name": "start-ok"}, {"id": 20, "arguments": [{"type": "longstr", "name": "challenge"}], "name": "secure", "synchronous" : true}, {"id": 21, "arguments": [{"type": "longstr", "name": "response"}], "name": "secure-ok"}, {"id": 30, "arguments": [{"type": "short", "name": "channel-max", "default-value": 0}, {"type": "long", "name": "frame-max", "default-value": 0}, {"type": "short", "name": "heartbeat", "default-value": 0}], "name": "tune", "synchronous" : true}, {"id": 31, "arguments": [{"type": "short", "name": "channel-max", "default-value": 0}, {"type": "long", "name": "frame-max", "default-value": 0}, {"type": "short", "name": "heartbeat", "default-value": 0}], "name": "tune-ok"}, {"id": 40, "arguments": [{"type": "shortstr", "name": "virtual-host", "default-value": "/"}, {"type": "shortstr", "name": "capabilities", "default-value": ""}, {"type": "bit", "name": "insist", "default-value": false}], "name": "open", "synchronous" : true}, {"id": 41, "arguments": [{"type": "shortstr", "name": "known-hosts", "default-value": ""}], "name": "open-ok"}, {"id": 50, "arguments": [{"type": "shortstr", "name": "host"}, {"type": "shortstr", "name": "known-hosts", "default-value": ""}], "name": "redirect"}, {"id": 60, "arguments": [{"type": "short", "name": "reply-code"}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "short", "name": "class-id"}, {"type": "short", "name": "method-id"}], "name": "close", "synchronous" : true}, {"id": 61, "arguments": [], "name": "close-ok"}], "name": "connection", "properties": [] }, { "id": 20, "methods": [{"id": 10, "arguments": [{"type": "shortstr", "name": "out-of-band", "default-value": ""}], "name": "open", "synchronous" : true}, {"id": 11, "arguments": [], "name": "open-ok"}, {"id": 20, "arguments": [{"type": "bit", "name": "active"}], "name": "flow", "synchronous" : true}, {"id": 21, "arguments": [{"type": "bit", "name": "active"}], "name": "flow-ok"}, {"id": 30, "arguments": [{"type": "short", "name": "reply-code"}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "table", "name": "details", "default-value": {}}], "name": "alert"}, {"id": 40, "arguments": [{"type": "short", "name": "reply-code"}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "short", "name": "class-id"}, {"type": "short", "name": "method-id"}], "name": "close", "synchronous" : true}, {"id": 41, "arguments": [], "name": "close-ok"}], "name": "channel" }, { "id": 30, "methods": [{"id": 10, "arguments": [{"type": "shortstr", "name": "realm", "default-value": "/data"}, {"type": "bit", "name": "exclusive", "default-value": false}, {"type": "bit", "name": "passive", "default-value": true}, {"type": "bit", "name": "active", "default-value": true}, {"type": "bit", "name": "write", "default-value": true}, {"type": "bit", "name": "read", "default-value": true}], "name": "request", "synchronous" : true}, {"id": 11, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}], "name": "request-ok"}], "name": "access" }, { "id": 40, "methods": [{"id": 10, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "type", "default-value": "direct"}, {"type": "bit", "name": "passive", "default-value": false}, {"type": "bit", "name": "durable", "default-value": false}, {"type": "bit", "name": "auto-delete", "default-value": false}, {"type": "bit", "name": "internal", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "declare", "synchronous" : true}, {"id": 11, "arguments": [], "name": "declare-ok"}, {"id": 20, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "exchange"}, {"type": "bit", "name": "if-unused", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "delete", "synchronous" : true}, {"id": 21, "arguments": [], "name": "delete-ok"}], "name": "exchange" }, { "id": 50, "methods": [{"id": 10, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "bit", "name": "passive", "default-value": false}, {"type": "bit", "name": "durable", "default-value": false}, {"type": "bit", "name": "exclusive", "default-value": false}, {"type": "bit", "name": "auto-delete", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "declare", "synchronous" : true}, {"id": 11, "arguments": [{"type": "shortstr", "name": "queue"}, {"type": "long", "name": "message-count"}, {"type": "long", "name": "consumer-count"}], "name": "declare-ok"}, {"id": 20, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "bind", "synchronous" : true}, {"id": 21, "arguments": [], "name": "bind-ok"}, {"id": 30, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "purge", "synchronous" : true}, {"id": 31, "arguments": [{"type": "long", "name": "message-count"}], "name": "purge-ok"}, {"id": 40, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "bit", "name": "if-unused", "default-value": false}, {"type": "bit", "name": "if-empty", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "delete", "synchronous" : true}, {"id": 41, "arguments": [{"type": "long", "name": "message-count"}], "name": "delete-ok"}, {"id": 50, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "unbind", "synchronous" : true}, {"id": 51, "arguments": [], "name": "unbind-ok"} ], "name": "queue" }, { "id": 60, "methods": [{"id": 10, "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, {"type": "short", "name": "prefetch-count", "default-value": 0}, {"type": "bit", "name": "global", "default-value": false}], "name": "qos", "synchronous" : true}, {"id": 11, "arguments": [], "name": "qos-ok"}, {"id": 20, "arguments": [{"domain": "access-ticket", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, {"type": "bit", "name": "no-local", "default-value": false}, {"type": "bit", "name": "no-ack", "default-value": false}, {"type": "bit", "name": "exclusive", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "consume", "synchronous" : true}, {"id": 21, "arguments": [{"type": "shortstr", "name": "consumer-tag"}], "name": "consume-ok"}, {"id": 30, "arguments": [{"type": "shortstr", "name": "consumer-tag"}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "cancel", "synchronous" : true}, {"id": 31, "arguments": [{"type": "shortstr", "name": "consumer-tag"}], "name": "cancel-ok"}, {"content": true, "id": 40, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "exchange", "default-value": ""}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "bit", "name": "mandatory", "default-value": false}, {"type": "bit", "name": "immediate", "default-value": false}], "name": "publish"}, {"content": true, "id": 50, "arguments": [{"type": "short", "name": "reply-code"}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}], "name": "return"}, {"content": true, "id": 60, "arguments": [{"type": "shortstr", "name": "consumer-tag"}, {"type": "longlong", "name": "delivery-tag"}, {"type": "bit", "name": "redelivered", "default-value": false}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}], "name": "deliver"}, {"id": 70, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "bit", "name": "no-ack", "default-value": false}], "name": "get", "synchronous" : true}, {"content": true, "id": 71, "arguments": [{"type": "longlong", "name": "delivery-tag"}, {"type": "bit", "name": "redelivered", "default-value": false}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}, {"type": "long", "name": "message-count"}], "name": "get-ok"}, {"id": 72, "arguments": [{"type": "shortstr", "name": "cluster-id", "default-value": ""}], "name": "get-empty"}, {"id": 80, "arguments": [{"type": "longlong", "name": "delivery-tag", "default-value": 0}, {"type": "bit", "name": "multiple", "default-value": false}], "name": "ack"}, {"id": 90, "arguments": [{"type": "longlong", "name": "delivery-tag"}, {"type": "bit", "name": "requeue", "default-value": true}], "name": "reject"}, {"id": 100, "arguments": [{"type": "bit", "name": "requeue", "default-value": false}], "name": "recover-async"}, {"id": 110, "arguments": [{"type": "bit", "name": "requeue", "default-value": false}], "name": "recover", "synchronous" : true}, {"id": 111, "arguments": [], "name": "recover-ok"}], "name": "basic", "properties": [{"type": "shortstr", "name": "content-type"}, {"type": "shortstr", "name": "content-encoding"}, {"type": "table", "name": "headers"}, {"type": "octet", "name": "delivery-mode"}, {"type": "octet", "name": "priority"}, {"type": "shortstr", "name": "correlation-id"}, {"type": "shortstr", "name": "reply-to"}, {"type": "shortstr", "name": "expiration"}, {"type": "shortstr", "name": "message-id"}, {"type": "timestamp", "name": "timestamp"}, {"type": "shortstr", "name": "type"}, {"type": "shortstr", "name": "user-id"}, {"type": "shortstr", "name": "app-id"}, {"type": "shortstr", "name": "cluster-id"}] }, { "id": 70, "methods": [{"id": 10, "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, {"type": "short", "name": "prefetch-count", "default-value": 0}, {"type": "bit", "name": "global", "default-value": false}], "name": "qos", "synchronous" : true}, {"id": 11, "arguments": [], "name": "qos-ok"}, {"id": 20, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, {"type": "bit", "name": "no-local", "default-value": false}, {"type": "bit", "name": "no-ack", "default-value": false}, {"type": "bit", "name": "exclusive", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "consume", "synchronous" : true}, {"id": 21, "arguments": [{"type": "shortstr", "name": "consumer-tag"}], "name": "consume-ok"}, {"id": 30, "arguments": [{"type": "shortstr", "name": "consumer-tag"}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "cancel", "synchronous" : true}, {"id": 31, "arguments": [{"type": "shortstr", "name": "consumer-tag"}], "name": "cancel-ok"}, {"id": 40, "arguments": [{"type": "shortstr", "name": "identifier"}, {"type": "longlong", "name": "content-size"}], "name": "open", "synchronous" : true}, {"id": 41, "arguments": [{"type": "longlong", "name": "staged-size"}], "name": "open-ok"}, {"content": true, "id": 50, "arguments": [], "name": "stage"}, {"id": 60, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "exchange", "default-value": ""}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "bit", "name": "mandatory", "default-value": false}, {"type": "bit", "name": "immediate", "default-value": false}, {"type": "shortstr", "name": "identifier"}], "name": "publish"}, {"content": true, "id": 70, "arguments": [{"type": "short", "name": "reply-code", "default-value": 200}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}], "name": "return"}, {"id": 80, "arguments": [{"type": "shortstr", "name": "consumer-tag"}, {"type": "longlong", "name": "delivery-tag"}, {"type": "bit", "name": "redelivered", "default-value": false}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}, {"type": "shortstr", "name": "identifier"}], "name": "deliver"}, {"id": 90, "arguments": [{"type": "longlong", "name": "delivery-tag", "default-value": 0}, {"type": "bit", "name": "multiple", "default-value": false}], "name": "ack"}, {"id": 100, "arguments": [{"type": "longlong", "name": "delivery-tag"}, {"type": "bit", "name": "requeue", "default-value": true}], "name": "reject"}], "name": "file", "properties": [{"type": "shortstr", "name": "content-type"}, {"type": "shortstr", "name": "content-encoding"}, {"type": "table", "name": "headers"}, {"type": "octet", "name": "priority"}, {"type": "shortstr", "name": "reply-to"}, {"type": "shortstr", "name": "message-id"}, {"type": "shortstr", "name": "filename"}, {"type": "timestamp", "name": "timestamp"}, {"type": "shortstr", "name": "cluster-id"}] }, { "id": 80, "methods": [{"id": 10, "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, {"type": "short", "name": "prefetch-count", "default-value": 0}, {"type": "long", "name": "consume-rate", "default-value": 0}, {"type": "bit", "name": "global", "default-value": false}], "name": "qos", "synchronous" : true}, {"id": 11, "arguments": [], "name": "qos-ok"}, {"id": 20, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, {"type": "bit", "name": "no-local", "default-value": false}, {"type": "bit", "name": "exclusive", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "consume", "synchronous" : true}, {"id": 21, "arguments": [{"type": "shortstr", "name": "consumer-tag"}], "name": "consume-ok"}, {"id": 30, "arguments": [{"type": "shortstr", "name": "consumer-tag"}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "cancel", "synchronous" : true}, {"id": 31, "arguments": [{"type": "shortstr", "name": "consumer-tag"}], "name": "cancel-ok"}, {"content": true, "id": 40, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}, {"type": "shortstr", "name": "exchange", "default-value": ""}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "bit", "name": "mandatory", "default-value": false}, {"type": "bit", "name": "immediate", "default-value": false}], "name": "publish"}, {"content": true, "id": 50, "arguments": [{"type": "short", "name": "reply-code", "default-value": 200}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}], "name": "return"}, {"content": true, "id": 60, "arguments": [{"type": "shortstr", "name": "consumer-tag"}, {"type": "longlong", "name": "delivery-tag"}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "queue"}], "name": "deliver"}], "name": "stream", "properties": [{"type": "shortstr", "name": "content-type"}, {"type": "shortstr", "name": "content-encoding"}, {"type": "table", "name": "headers"}, {"type": "octet", "name": "priority"}, {"type": "timestamp", "name": "timestamp"}] }, { "id": 90, "methods": [{"id": 10, "arguments": [], "name": "select", "synchronous" : true}, {"id": 11, "arguments": [], "name": "select-ok"}, {"id": 20, "arguments": [], "name": "commit", "synchronous" : true}, {"id": 21, "arguments": [], "name": "commit-ok"}, {"id": 30, "arguments": [], "name": "rollback", "synchronous" : true}, {"id": 31, "arguments": [], "name": "rollback-ok"}], "name": "tx" }, { "id": 100, "methods": [{"id": 10, "arguments": [], "name": "select", "synchronous" : true}, {"id": 11, "arguments": [], "name": "select-ok"}, {"id": 20, "arguments": [{"type": "shortstr", "name": "dtx-identifier"}], "name": "start", "synchronous" : true}, {"id": 21, "arguments": [], "name": "start-ok"}], "name": "dtx" }, { "id": 110, "methods": [{"content": true, "id": 10, "arguments": [{"type": "table", "name": "meta-data"}], "name": "request"}], "name": "tunnel", "properties": [{"type": "table", "name": "headers"}, {"type": "shortstr", "name": "proxy-name"}, {"type": "shortstr", "name": "data-name"}, {"type": "octet", "name": "durable"}, {"type": "octet", "name": "broadcast"}] }, { "id": 120, "methods": [{"id": 10, "arguments": [{"type": "octet", "name": "integer-1"}, {"type": "short", "name": "integer-2"}, {"type": "long", "name": "integer-3"}, {"type": "longlong", "name": "integer-4"}, {"type": "octet", "name": "operation"}], "name": "integer", "synchronous" : true}, {"id": 11, "arguments": [{"type": "longlong", "name": "result"}], "name": "integer-ok"}, {"id": 20, "arguments": [{"type": "shortstr", "name": "string-1"}, {"type": "longstr", "name": "string-2"}, {"type": "octet", "name": "operation"}], "name": "string", "synchronous" : true}, {"id": 21, "arguments": [{"type": "longstr", "name": "result"}], "name": "string-ok"}, {"id": 30, "arguments": [{"type": "table", "name": "table"}, {"type": "octet", "name": "integer-op"}, {"type": "octet", "name": "string-op"}], "name": "table", "synchronous" : true}, {"id": 31, "arguments": [{"type": "longlong", "name": "integer-result"}, {"type": "longstr", "name": "string-result"}], "name": "table-ok"}, {"content": true, "id": 40, "arguments": [], "name": "content", "synchronous" : true}, {"content": true, "id": 41, "arguments": [{"type": "long", "name": "content-checksum"}], "name": "content-ok"}], "name": "test" } ] } rabbitmq-codegen-rabbitmq_v3_6_12/amqp-rabbitmq-0.9.1.json000066400000000000000000000655331310241232500233170ustar00rootroot00000000000000{ "name": "AMQP", "major-version": 0, "minor-version": 9, "revision": 1, "port": 5672, "copyright": [ "Copyright (C) 2008-2016 Pivotal Software, Inc, Inc.\n", "\n", "Permission is hereby granted, free of charge, to any person\n", "obtaining a copy of this file (the \"Software\"), to deal in the\n", "Software without restriction, including without limitation the \n", "rights to use, copy, modify, merge, publish, distribute, \n", "sublicense, and/or sell copies of the Software, and to permit \n", "persons to whom the Software is furnished to do so, subject to \n", "the following conditions:\n", "\n", "The above copyright notice and this permission notice shall be\n", "included in all copies or substantial portions of the Software.\n", "\n", "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n", "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n", "OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n", "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n", "HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n", "WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n", "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n", "OTHER DEALINGS IN THE SOFTWARE.\n", "\n", "Class information entered from amqp_xml0-8.pdf and domain types from amqp-xml-doc0-9.pdf\n", "Updated for 0-9-1 by Tony Garnock-Jones\n", "\n", "b3cb053f15e7b98808c0ccc67f23cb3e amqp_xml0-8.pdf\n", "http://www.twiststandards.org/index.php?option=com_docman&task=cat_view&gid=28&&Itemid=90\n", "8444db91e2949dbecfb2585e9eef6d64 amqp-xml-doc0-9.pdf\n", "https://jira.amqp.org/confluence/download/attachments/720900/amqp-xml-doc0-9.pdf?version=1\n"], "domains": [ ["bit", "bit"], ["channel-id", "longstr"], ["class-id", "short"], ["consumer-tag", "shortstr"], ["delivery-tag", "longlong"], ["destination", "shortstr"], ["duration", "longlong"], ["exchange-name", "shortstr"], ["long", "long"], ["longlong", "longlong"], ["longstr", "longstr"], ["method-id", "short"], ["no-ack", "bit"], ["no-local", "bit"], ["octet", "octet"], ["offset", "longlong"], ["path", "shortstr"], ["peer-properties", "table"], ["queue-name", "shortstr"], ["redelivered", "bit"], ["reference", "longstr"], ["reject-code", "short"], ["reject-text", "shortstr"], ["reply-code", "short"], ["reply-text", "shortstr"], ["security-token", "longstr"], ["short", "short"], ["shortstr", "shortstr"], ["table", "table"], ["timestamp", "timestamp"] ], "constants": [ {"name": "FRAME-METHOD", "value": 1}, {"name": "FRAME-HEADER", "value": 2}, {"name": "FRAME-BODY", "value": 3}, {"name": "FRAME-HEARTBEAT", "value": 8}, {"name": "FRAME-MIN-SIZE", "value": 4096}, {"name": "FRAME-END", "value": 206}, {"name": "REPLY-SUCCESS", "value": 200}, {"name": "CONTENT-TOO-LARGE", "value": 311, "class": "soft-error"}, {"name": "NO-ROUTE", "value": 312, "class": "soft-error"}, {"name": "NO-CONSUMERS", "value": 313, "class": "soft-error"}, {"name": "ACCESS-REFUSED", "value": 403, "class": "soft-error"}, {"name": "NOT-FOUND", "value": 404, "class": "soft-error"}, {"name": "RESOURCE-LOCKED", "value": 405, "class": "soft-error"}, {"name": "PRECONDITION-FAILED", "value": 406, "class": "soft-error"}, {"name": "CONNECTION-FORCED", "value": 320, "class": "hard-error"}, {"name": "INVALID-PATH", "value": 402, "class": "hard-error"}, {"name": "FRAME-ERROR", "value": 501, "class": "hard-error"}, {"name": "SYNTAX-ERROR", "value": 502, "class": "hard-error"}, {"name": "COMMAND-INVALID", "value": 503, "class": "hard-error"}, {"name": "CHANNEL-ERROR", "value": 504, "class": "hard-error"}, {"name": "UNEXPECTED-FRAME", "value": 505, "class": "hard-error"}, {"name": "RESOURCE-ERROR", "value": 506, "class": "hard-error"}, {"name": "NOT-ALLOWED", "value": 530, "class": "hard-error"}, {"name": "NOT-IMPLEMENTED", "value": 540, "class": "hard-error"}, {"name": "INTERNAL-ERROR", "value": 541, "class": "hard-error"} ], "classes": [ { "id": 10, "methods": [{"id": 10, "arguments": [{"type": "octet", "name": "version-major", "default-value": 0}, {"type": "octet", "name": "version-minor", "default-value": 9}, {"domain": "peer-properties", "name": "server-properties"}, {"type": "longstr", "name": "mechanisms", "default-value": "PLAIN"}, {"type": "longstr", "name": "locales", "default-value": "en_US"}], "name": "start", "synchronous" : true}, {"id": 11, "arguments": [{"domain": "peer-properties", "name": "client-properties"}, {"type": "shortstr", "name": "mechanism", "default-value": "PLAIN"}, {"type": "longstr", "name": "response"}, {"type": "shortstr", "name": "locale", "default-value": "en_US"}], "name": "start-ok"}, {"id": 20, "arguments": [{"type": "longstr", "name": "challenge"}], "name": "secure", "synchronous" : true}, {"id": 21, "arguments": [{"type": "longstr", "name": "response"}], "name": "secure-ok"}, {"id": 30, "arguments": [{"type": "short", "name": "channel-max", "default-value": 0}, {"type": "long", "name": "frame-max", "default-value": 0}, {"type": "short", "name": "heartbeat", "default-value": 0}], "name": "tune", "synchronous" : true}, {"id": 31, "arguments": [{"type": "short", "name": "channel-max", "default-value": 0}, {"type": "long", "name": "frame-max", "default-value": 0}, {"type": "short", "name": "heartbeat", "default-value": 0}], "name": "tune-ok"}, {"id": 40, "arguments": [{"type": "shortstr", "name": "virtual-host", "default-value": "/"}, {"type": "shortstr", "name": "capabilities", "default-value": ""}, {"type": "bit", "name": "insist", "default-value": false}], "name": "open", "synchronous" : true}, {"id": 41, "arguments": [{"type": "shortstr", "name": "known-hosts", "default-value": ""}], "name": "open-ok"}, {"id": 50, "arguments": [{"type": "short", "name": "reply-code"}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "short", "name": "class-id"}, {"type": "short", "name": "method-id"}], "name": "close", "synchronous" : true}, {"id": 51, "arguments": [], "name": "close-ok"}, {"id": 60, "arguments": [{"type": "shortstr", "name": "reason", "default-value": ""}], "name": "blocked"}, {"id": 61, "arguments": [], "name": "unblocked"}], "name": "connection", "properties": [] }, { "id": 20, "methods": [{"id": 10, "arguments": [{"type": "shortstr", "name": "out-of-band", "default-value": ""}], "name": "open", "synchronous" : true}, {"id": 11, "arguments": [{"type": "longstr", "name": "channel-id", "default-value": ""}], "name": "open-ok"}, {"id": 20, "arguments": [{"type": "bit", "name": "active"}], "name": "flow", "synchronous" : true}, {"id": 21, "arguments": [{"type": "bit", "name": "active"}], "name": "flow-ok"}, {"id": 40, "arguments": [{"type": "short", "name": "reply-code"}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "short", "name": "class-id"}, {"type": "short", "name": "method-id"}], "name": "close", "synchronous" : true}, {"id": 41, "arguments": [], "name": "close-ok"}], "name": "channel" }, { "id": 30, "methods": [{"id": 10, "arguments": [{"type": "shortstr", "name": "realm", "default-value": "/data"}, {"type": "bit", "name": "exclusive", "default-value": false}, {"type": "bit", "name": "passive", "default-value": true}, {"type": "bit", "name": "active", "default-value": true}, {"type": "bit", "name": "write", "default-value": true}, {"type": "bit", "name": "read", "default-value": true}], "name": "request", "synchronous" : true}, {"id": 11, "arguments": [{"type": "short", "name": "ticket", "default-value": 1}], "name": "request-ok"}], "name": "access" }, { "id": 40, "methods": [{"id": 10, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "type", "default-value": "direct"}, {"type": "bit", "name": "passive", "default-value": false}, {"type": "bit", "name": "durable", "default-value": false}, {"type": "bit", "name": "auto-delete", "default-value": false}, {"type": "bit", "name": "internal", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "declare", "synchronous" : true}, {"id": 11, "arguments": [], "name": "declare-ok"}, {"id": 20, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "exchange"}, {"type": "bit", "name": "if-unused", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "delete", "synchronous" : true}, {"id": 21, "arguments": [], "name": "delete-ok"}, {"id": 30, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "destination"}, {"type": "shortstr", "name": "source"}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "bind", "synchronous" : true}, {"id": 31, "arguments": [], "name": "bind-ok"}, {"id": 40, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "destination"}, {"type": "shortstr", "name": "source"}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "unbind", "synchronous" : true}, {"id": 51, "arguments": [], "name": "unbind-ok"}], "name": "exchange" }, { "id": 50, "methods": [{"id": 10, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "bit", "name": "passive", "default-value": false}, {"type": "bit", "name": "durable", "default-value": false}, {"type": "bit", "name": "exclusive", "default-value": false}, {"type": "bit", "name": "auto-delete", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "declare", "synchronous" : true}, {"id": 11, "arguments": [{"type": "shortstr", "name": "queue"}, {"type": "long", "name": "message-count"}, {"type": "long", "name": "consumer-count"}], "name": "declare-ok"}, {"id": 20, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "bind", "synchronous" : true}, {"id": 21, "arguments": [], "name": "bind-ok"}, {"id": 30, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "purge", "synchronous" : true}, {"id": 31, "arguments": [{"type": "long", "name": "message-count"}], "name": "purge-ok"}, {"id": 40, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "bit", "name": "if-unused", "default-value": false}, {"type": "bit", "name": "if-empty", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "delete", "synchronous" : true}, {"id": 41, "arguments": [{"type": "long", "name": "message-count"}], "name": "delete-ok"}, {"id": 50, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "unbind", "synchronous" : true}, {"id": 51, "arguments": [], "name": "unbind-ok"} ], "name": "queue" }, { "id": 60, "methods": [{"id": 10, "arguments": [{"type": "long", "name": "prefetch-size", "default-value": 0}, {"type": "short", "name": "prefetch-count", "default-value": 0}, {"type": "bit", "name": "global", "default-value": false}], "name": "qos", "synchronous" : true}, {"id": 11, "arguments": [], "name": "qos-ok"}, {"id": 20, "arguments": [{"domain": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "shortstr", "name": "consumer-tag", "default-value": ""}, {"type": "bit", "name": "no-local", "default-value": false}, {"type": "bit", "name": "no-ack", "default-value": false}, {"type": "bit", "name": "exclusive", "default-value": false}, {"type": "bit", "name": "nowait", "default-value": false}, {"type": "table", "name": "arguments", "default-value": {}}], "name": "consume", "synchronous" : true}, {"id": 21, "arguments": [{"type": "shortstr", "name": "consumer-tag"}], "name": "consume-ok"}, {"id": 30, "arguments": [{"type": "shortstr", "name": "consumer-tag"}, {"type": "bit", "name": "nowait", "default-value": false}], "name": "cancel", "synchronous" : true}, {"id": 31, "arguments": [{"type": "shortstr", "name": "consumer-tag"}], "name": "cancel-ok"}, {"content": true, "id": 40, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "exchange", "default-value": ""}, {"type": "shortstr", "name": "routing-key", "default-value": ""}, {"type": "bit", "name": "mandatory", "default-value": false}, {"type": "bit", "name": "immediate", "default-value": false}], "name": "publish"}, {"content": true, "id": 50, "arguments": [{"type": "short", "name": "reply-code"}, {"type": "shortstr", "name": "reply-text", "default-value": ""}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}], "name": "return"}, {"content": true, "id": 60, "arguments": [{"type": "shortstr", "name": "consumer-tag"}, {"type": "longlong", "name": "delivery-tag"}, {"type": "bit", "name": "redelivered", "default-value": false}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}], "name": "deliver"}, {"id": 70, "arguments": [{"type": "short", "name": "ticket", "default-value": 0}, {"type": "shortstr", "name": "queue", "default-value": ""}, {"type": "bit", "name": "no-ack", "default-value": false}], "name": "get", "synchronous" : true}, {"content": true, "id": 71, "arguments": [{"type": "longlong", "name": "delivery-tag"}, {"type": "bit", "name": "redelivered", "default-value": false}, {"type": "shortstr", "name": "exchange"}, {"type": "shortstr", "name": "routing-key"}, {"type": "long", "name": "message-count"}], "name": "get-ok"}, {"id": 72, "arguments": [{"type": "shortstr", "name": "cluster-id", "default-value": ""}], "name": "get-empty"}, {"id": 80, "arguments": [{"type": "longlong", "name": "delivery-tag", "default-value": 0}, {"type": "bit", "name": "multiple", "default-value": false}], "name": "ack"}, {"id": 90, "arguments": [{"type": "longlong", "name": "delivery-tag"}, {"type": "bit", "name": "requeue", "default-value": true}], "name": "reject"}, {"id": 100, "arguments": [{"type": "bit", "name": "requeue", "default-value": false}], "name": "recover-async"}, {"id": 110, "arguments": [{"type": "bit", "name": "requeue", "default-value": false}], "name": "recover", "synchronous" : true}, {"id": 111, "arguments": [], "name": "recover-ok"}, {"id": 120, "arguments": [{"type": "longlong", "name": "delivery-tag", "default-value": 0}, {"type": "bit", "name": "multiple", "default-value": false}, {"type": "bit", "name": "requeue", "default-value": true}], "name": "nack"}], "name": "basic", "properties": [{"type": "shortstr", "name": "content-type"}, {"type": "shortstr", "name": "content-encoding"}, {"type": "table", "name": "headers"}, {"type": "octet", "name": "delivery-mode"}, {"type": "octet", "name": "priority"}, {"type": "shortstr", "name": "correlation-id"}, {"type": "shortstr", "name": "reply-to"}, {"type": "shortstr", "name": "expiration"}, {"type": "shortstr", "name": "message-id"}, {"type": "timestamp", "name": "timestamp"}, {"type": "shortstr", "name": "type"}, {"type": "shortstr", "name": "user-id"}, {"type": "shortstr", "name": "app-id"}, {"type": "shortstr", "name": "cluster-id"}] }, { "id": 90, "methods": [{"id": 10, "arguments": [], "name": "select", "synchronous" : true}, {"id": 11, "arguments": [], "name": "select-ok"}, {"id": 20, "arguments": [], "name": "commit", "synchronous" : true}, {"id": 21, "arguments": [], "name": "commit-ok"}, {"id": 30, "arguments": [], "name": "rollback", "synchronous" : true}, {"id": 31, "arguments": [], "name": "rollback-ok"}], "name": "tx" }, { "id": 85, "methods": [{"id": 10, "arguments": [ {"type": "bit", "name": "nowait", "default-value": false}], "name": "select", "synchronous": true}, {"id": 11, "arguments": [], "name": "select-ok"}], "name": "confirm" } ] } rabbitmq-codegen-rabbitmq_v3_6_12/amqp_codegen.py000066400000000000000000000240671310241232500222150ustar00rootroot00000000000000## The contents of this file are subject to the Mozilla Public License ## Version 1.1 (the "License"); you may not use this file except in ## compliance with the License. You may obtain a copy of the License ## at http://www.mozilla.org/MPL/ ## ## Software distributed under the License is distributed on an "AS IS" ## basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See ## the License for the specific language governing rights and ## limitations under the License. ## ## The Original Code is RabbitMQ. ## ## The Initial Developer of the Original Code is GoPivotal, Inc. ## Copyright (c) 2007-2014 GoPivotal, Inc. All rights reserved. ## from __future__ import nested_scopes, print_function import errno import re import sys import os from optparse import OptionParser try: try: import simplejson as json except ImportError as e: if sys.hexversion >= 0x20600f0: import json else: raise e except ImportError: print(" You don't appear to have simplejson.py installed", file = sys.stderr) print(" (an implementation of a JSON reader and writer in Python).", file = sys.stderr) print(" You can install it:", file = sys.stderr) print(" - by running 'apt-get install python-simplejson' on Debian-based systems,", file = sys.stderr) print(" - by running 'yum install python-simplejson' on Fedora/Red Hat system,", file = sys.stderr) print(" - by running 'port install py25-simplejson' on Macports on OS X", file = sys.stderr) print(" (you may need to say 'make PYTHON=python2.5', as well),", file = sys.stderr) print(" - from sources from 'http://pypi.python.org/pypi/simplejson'", file = sys.stderr) print(" - simplejson is a standard json library in the Python core since 2.6", file = sys.stderr) sys.exit(1) def insert_base_types(d): for t in ['octet', 'shortstr', 'longstr', 'short', 'long', 'longlong', 'bit', 'table', 'timestamp']: d[t] = t class AmqpSpecFileMergeConflict(Exception): pass # If ignore_conflicts is true, then we allow acc and new to conflict, # with whatever's already in acc winning and new being ignored. If # ignore_conflicts is false, acc and new must not conflict. def default_spec_value_merger(key, acc, new, ignore_conflicts): if acc is None or acc == new or ignore_conflicts: return new else: raise AmqpSpecFileMergeConflict(key, acc, new) def extension_info_merger(key, acc, new, ignore_conflicts): return acc + [new] def domains_merger(key, acc, new, ignore_conflicts): merged = dict((k, v) for [k, v] in acc) for [k, v] in new: if k in merged: if not ignore_conflicts: raise AmqpSpecFileMergeConflict(key, acc, new) else: merged[k] = v return [[k, v] for (k, v) in merged.items()] def merge_dict_lists_by(dict_key, acc, new, ignore_conflicts): acc_index = set(v[dict_key] for v in acc) result = list(acc) # shallow copy for v in new: if v[dict_key] in acc_index: if not ignore_conflicts: raise AmqpSpecFileMergeConflict(description, acc, new) else: result.append(v) return result def constants_merger(key, acc, new, ignore_conflicts): return merge_dict_lists_by("name", acc, new, ignore_conflicts) def methods_merger(classname, acc, new, ignore_conflicts): return merge_dict_lists_by("name", acc, new, ignore_conflicts) def properties_merger(classname, acc, new, ignore_conflicts): return merge_dict_lists_by("name", acc, new, ignore_conflicts) def class_merger(acc, new, ignore_conflicts): acc["methods"] = methods_merger(acc["name"], acc["methods"], new["methods"], ignore_conflicts) acc["properties"] = properties_merger(acc["name"], acc.get("properties", []), new.get("properties", []), ignore_conflicts) def classes_merger(key, acc, new, ignore_conflicts): acc_dict = dict((v["name"], v) for v in acc) result = list(acc) # shallow copy for w in new: if w["name"] in acc_dict: class_merger(acc_dict[w["name"]], w, ignore_conflicts) else: result.append(w) return result mergers = { "extension": (extension_info_merger, []), "domains": (domains_merger, []), "constants": (constants_merger, []), "classes": (classes_merger, []), } def merge_load_specs(filenames, ignore_conflicts): handles = [open(filename) for filename in filenames] docs = [json.load(handle) for handle in handles] spec = {} for doc in docs: for (key, value) in doc.items(): (merger, default_value) = mergers.get(key, (default_spec_value_merger, None)) spec[key] = merger(key, spec.get(key, default_value), value, ignore_conflicts) for handle in handles: handle.close() return spec class AmqpSpec: # Slight wart: use a class member rather than change the ctor signature # to avoid breaking everyone else's code. ignore_conflicts = False def __init__(self, filenames): self.spec = merge_load_specs(filenames, AmqpSpec.ignore_conflicts) self.major = self.spec['major-version'] self.minor = self.spec['minor-version'] self.revision = ('revision' in self.spec) and (self.spec['revision'] or 0) self.port = self.spec['port'] self.domains = {} insert_base_types(self.domains) for entry in self.spec['domains']: self.domains[ entry[0] ] = entry[1] self.constants = [] for d in self.spec['constants']: if 'class' in d: klass = d['class'] else: klass = '' self.constants.append((d['name'], d['value'], klass)) self.classes = [] for element in self.spec['classes']: self.classes.append(AmqpClass(self, element)) def allClasses(self): return self.classes def allMethods(self): return [m for c in self.classes for m in c.allMethods()] def resolveDomain(self, n): return self.domains[n] class AmqpEntity: def __init__(self, element): self.element = element self.name = element['name'] class AmqpClass(AmqpEntity): def __init__(self, spec, element): AmqpEntity.__init__(self, element) self.spec = spec self.index = int(self.element['id']) self.methods = [] for method_element in self.element['methods']: self.methods.append(AmqpMethod(self, method_element)) self.hasContentProperties = False for method in self.methods: if method.hasContent: self.hasContentProperties = True break self.fields = [] if 'properties' in self.element: index = 0 for e in self.element['properties']: self.fields.append(AmqpField(self, e, index)) index = index + 1 def allMethods(self): return self.methods def __repr__(self): return 'AmqpClass("' + self.name + '")' class AmqpMethod(AmqpEntity): def __init__(self, klass, element): AmqpEntity.__init__(self, element) self.klass = klass self.index = int(self.element['id']) if 'synchronous' in self.element: self.isSynchronous = self.element['synchronous'] else: self.isSynchronous = False if 'content' in self.element: self.hasContent = self.element['content'] else: self.hasContent = False self.arguments = [] index = 0 for argument in element['arguments']: self.arguments.append(AmqpField(self, argument, index)) index = index + 1 def __repr__(self): return 'AmqpMethod("' + self.klass.name + "." + self.name + '" ' + repr(self.arguments) + ')' class AmqpField(AmqpEntity): def __init__(self, method, element, index): AmqpEntity.__init__(self, element) self.method = method self.index = index if 'type' in self.element: self.domain = self.element['type'] else: self.domain = self.element['domain'] if 'default-value' in self.element: self.defaultvalue = self.element['default-value'] else: self.defaultvalue = None def __repr__(self): return 'AmqpField("' + self.name + '")' def do_main(header_fn, body_fn): do_main_dict({"header": header_fn, "body": body_fn}) def do_main_dict(funcDict): def usage(): print("Usage:", file = sys.stderr) print(" {0} ... ".format(sys.argv[0]), file = sys.stderr) print(" where is one of: {0}".format(", ".join([k for k in funcDict.keys()])), file = sys.stderr) def mkdir_p(path): try: os.makedirs(path) except OSError as exc: # Python >2.5 if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise def execute(fn, amqp_specs, out_file): stdout = sys.stdout mkdir_p(os.path.dirname(out_file)) f = open(out_file, 'w') success = False try: sys.stdout = f fn(amqp_specs) success = True finally: sys.stdout = stdout f.close() if not success: os.remove(out_file) parser = OptionParser() parser.add_option("--ignore-conflicts", action="store_true", dest="ignore_conflicts", default=False) (options, args) = parser.parse_args() if len(args) < 3: usage() sys.exit(1) else: function = args[0] sources = args[1:-1] dest = args[-1] AmqpSpec.ignore_conflicts = options.ignore_conflicts if function in funcDict: execute(funcDict[function], sources, dest) else: usage() sys.exit(1) rabbitmq-codegen-rabbitmq_v3_6_12/credit_extension.json000066400000000000000000000053271310241232500234600ustar00rootroot00000000000000{ "extension": { "name": "credit", "version": "0.1", "status": [ "This extension is used internally by the broker and plugins. ", "It is NOT intended to be used by regular clients over the ", "network. This extension is subject to change without notice; ", "hence you are strongly discouraged from building clients ", "which use it."], "copyright": [ "Copyright (C) 2008-2016 Pivotal Software, Inc, Inc.\n", "\n", "Permission is hereby granted, free of charge, to any person\n", "obtaining a copy of this file (the \"Software\"), to deal in the\n", "Software without restriction, including without limitation the \n", "rights to use, copy, modify, merge, publish, distribute, \n", "sublicense, and/or sell copies of the Software, and to permit \n", "persons to whom the Software is furnished to do so, subject to \n", "the following conditions:\n", "\n", "The above copyright notice and this permission notice shall be\n", "included in all copies or substantial portions of the Software.\n", "\n", "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\n", "EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\n", "OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\n", "NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\n", "HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\n", "WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n", "FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\n", "OTHER DEALINGS IN THE SOFTWARE.\n"] }, "classes": [ { "id": 60, "methods": [{"id": 200, "arguments": [{"type": "shortstr", "name": "consumer-tag", "default-value": ""}, {"type": "long", "name": "credit"}, {"type": "bit", "name": "drain"}], "name": "credit", "synchronous" : true}, {"id": 201, "arguments": [{"type": "long", "name": "available"}], "name": "credit-ok"}, {"id": 202, "arguments": [{"type": "shortstr", "name": "consumer-tag", "default-value": ""}, {"type": "long", "name": "credit-drained"}], "name": "credit-drained"}], "name": "basic" } ] } rabbitmq-codegen-rabbitmq_v3_6_12/demo_extension.json000066400000000000000000000005431310241232500231250ustar00rootroot00000000000000{ "extension": { "name": "demo", "version": "1.0", "copyright": "Copyright (C) 2009-2013 GoPivotal, Inc." }, "domains": [ ["foo-domain", "shortstr"] ], "constants": [ {"name": "FOO-CONSTANT", "value": 121212} ], "classes": [ {"name": "demo", "id": 555, "methods": [{"name": "one", "id": 1, "arguments": []}]} ] } rabbitmq-codegen-rabbitmq_v3_6_12/license_info000066400000000000000000000002351310241232500215700ustar00rootroot00000000000000The files amqp-rabbitmq-0.8.json and amqp-rabbitmq-0.9.1.json are "Copyright (C) 2008-2016 Pivotal Software, Inc", Inc. and are covered by the MIT license.