commit 20c576b9bca3060b23e011ff69633f32af85f737 Author: Ashang Date: Mon Apr 4 16:01:36 2022 +0800 init diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3afb6d6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.idea/ +src/runtime/ +src/.env +.DS_Store \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..f288702 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/README.md b/README.md new file mode 100644 index 0000000..2ef83ef --- /dev/null +++ b/README.md @@ -0,0 +1,86 @@ +## Epusdt (Easy Payment Usdt) +

+ +

+

+license GPLV3 +Go version 1.16 +Echo Framework v4 +Telebot Framework-v3 +version v0.0.1 +

+ + +## 项目简介 +`Epusdt`(全称:Easy Payment Usdt)是一个由`Go语言`编写的私有化部署`Usdt`支付中间件(`Trc20网络`) +站长或开发者可通过`Epusdt`提供的`http api`集成至您的任何系统,无需过多的配置,仅仅依赖`mysql`和`redis` +可实现USDT的在线支付和消息回调,这一切在优雅和顷刻间完成!🎉 +私有化搭建使得无需额外的手续费和签约费用,Usdt代币直接进入您的钱包💰 +`Epusdt` 遵守 [GPLv3](https://www.gnu.org/licenses/gpl-3.0.html) 开源协议! + +## 项目特点 +- 支持私有化部署,无需担心钱包被篡改和吞单😁 +- `Go语言`跨平台实现,支持x86和arm芯片架构的win/linux设备 +- 多钱包地址轮询,提高订单并发率 +- 异步队列响应,优雅及高性能 +- 无需额外环境配置,仅运行一个编译后二进制文件即可使用 +- 支持`http api`,其他系统亦可接入 +- `Telegram`机器人接入,便捷使用和支付消息快速通知 + +## 项目结构 +``` +Epusdt + ├── plugins ---> (已集成的插件库,例如dujiaoka) + ├── src ---> (项目核心目录) + ├── sdk ---> (接入SDK) + ├── sql ---> (安装sql文件或更新sql文件) + └── wiki ---> (知识库) +``` + +## 教程: +- 宝塔运行`epusdt`教程👉🏻[宝塔运行epusdt](wiki/BT_RUN.md) +- 开发者接入`epusdt`文档👉🏻[开发者接入epusdt](wiki/API.md) + +## 已适配系统插件 +- 独角数卡[插件地址](plugins/dujiaoka) + +## 加入交流/意见反馈 +- `Epusdt`频道[https://t.me/epusdt](https://t.me/epusdt) +- `Epusdt`交流群组[https://t.me/epusdt_group](https://t.me/epusdt_group) + +## 设计实现 +`Epusdt`的实现方式与其他项目原理类似,都是通过监听`trc20`网络的api或节点, +监听钱包地址`usdt`代币入账事件,通过`金额差异`和`时效性`来判定交易归属信息, +可参考下方`流程图` +``` +简单的原理: +1.客户需要支付20.05usdt +2.服务器有一个hash表存储钱包地址对应的待支付金额 例如:address_1 : 20.05 +3.发起支付的时候,我们可以判定钱包address_1的20.05金额是否被占用,如果没有被占用那么可以直接返回这个钱包地址和金额给客户,告知客户需按规定金额20.05准确支付,少一分都不行。且将钱包地址和金额 address_1:20.05锁起来,有效期10分钟。 +4.如果订单并发下,又有一个20.05元需要支付,但是在第3步的时候上一个客户已经锁定了该金额,还在等待支付中...,那么我们将待支付金额加上0.0001,再次尝试判断address_1:20.0501金额是否被占用?如果没有则重复第三步,如果还是被占用就继续累加尝试,直到加了100次后都失败 +5.新开一个线程去监听所有钱包的USDT入账事件,网上有公开的api或rpc节点。如果发现有入账金额与待支付的金额相等。则判断该笔订单支付成功! +``` +### 流程图: +![Implementation principle](wiki/img/implementation_principle.jpg) + +## 打赏 +如果该项目对您有所帮助,希望可以请我喝一杯咖啡☕️ +``` +Usdt(trc20)打赏地址: TNEns8t9jbWENbStkQdVQtHMGpbsYsQjZK +``` +usdt扫码打赏 + + + + +## 声明 +`Epusdt`为开源的产品,仅用于学习交流使用! +不可用于任何违反中华人民共和国(含台湾省)或使用者所在地区法律法规的用途。 +因为作者即本人仅完成代码的开发和开源活动(开源即任何人都可以下载使用或修改分发),从未参与用户的任何运营和盈利活动。 +且不知晓用户后续将程序源代码用于何种用途,故用户使用过程中所带来的任何法律责任即由用户自己承担。 +``` +!!!Warning!!! +项目中所涉及区块链代币均为学习用途,作者并不赞成区块链所繁衍出代币的金融属性 +亦不鼓励和支持任何"挖矿","炒币","虚拟币ICO"等非法行为 +虚拟币市场行为不受监管要求和控制,投资交易需谨慎,仅供学习区块链知识 +``` diff --git a/plugins/.gitkeep b/plugins/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/plugins/dujiaoka/README.md b/plugins/dujiaoka/README.md new file mode 100644 index 0000000..9a85724 --- /dev/null +++ b/plugins/dujiaoka/README.md @@ -0,0 +1,12 @@ +## 使用方法 +### 注意此插件仅适用于独角数卡2.0.4版本以下,2.0.4版本或以上的独角数卡已经内置此插件,无需配置 + +1.将`app`和`routes`目录覆盖到网站根目录。 +2.在独角数卡后台添加一个支付方式。 + +| 支付选项 | 商户id | 商户key | 商户密钥 | 备注 | +| :-----| :----- | :----- | :----- |:-----| +| Epusdt | api接口认证token | 空 | epusdt收银台地址+/api/v1/order/create-transaction| 如果独角数卡和epusdt在同一服务器则填写`127.0.0.1`不要填域名,例如`http://127.0.0.1:8000/api/v1/order/create-transaction` | + +示例: +![示例配置](../../wiki/img/dujiaoka_epusdt.png) \ No newline at end of file diff --git a/plugins/dujiaoka/app/Http/Controllers/Pay/EpusdtController.php b/plugins/dujiaoka/app/Http/Controllers/Pay/EpusdtController.php new file mode 100644 index 0000000..37a7d14 --- /dev/null +++ b/plugins/dujiaoka/app/Http/Controllers/Pay/EpusdtController.php @@ -0,0 +1,101 @@ + + * @copyright assimon + * @link http://utf8.hk/ + */ + +namespace App\Http\Controllers\Pay; + + +use App\Exceptions\RuleValidationException; +use App\Http\Controllers\PayController; +use GuzzleHttp\Client; +use GuzzleHttp\Exception\GuzzleException; +use Illuminate\Http\Request; + +class EpusdtController extends PayController +{ + public function gateway(string $payway, string $orderSN) + { + try { + // 加载网关 + $this->loadGateWay($orderSN, $payway); + //构造要请求的参数数组,无需改动 + $parameter = [ + "amount" => (float)$this->order->actual_price,//原价 + "order_id" => $this->order->order_sn, //可以是用户ID,站内商户订单号,用户名 + 'redirect_url' => route('epusdt-return', ['order_id' => $this->order->order_sn]), + 'notify_url' => url($this->payGateway->pay_handleroute . '/notify_url'), + ]; + $parameter['signature'] = $this->epusdtSign($parameter, $this->payGateway->merchant_id); + $client = new Client([ + 'headers' => [ 'Content-Type' => 'application/json' ] + ]); + $response = $client->post($this->payGateway->merchant_pem, ['body' => json_encode($parameter)]); + $body = json_decode($response->getBody()->getContents(), true); + if (!isset($body['status_code']) || $body['status_code'] != 200) { + return $this->err(__('dujiaoka.prompt.abnormal_payment_channel') . $body['message']); + } + return redirect()->away($body['data']['payment_url']); + } catch (RuleValidationException $exception) { + } catch (GuzzleException $exception) { + return $this->err($exception->getMessage()); + } + } + + + private function epusdtSign(array $parameter, string $signKey) + { + ksort($parameter); + reset($parameter); //内部指针指向数组中的第一个元素 + $sign = ''; + $urls = ''; + foreach ($parameter as $key => $val) { + if ($val == '') continue; + if ($key != 'signature') { + if ($sign != '') { + $sign .= "&"; + $urls .= "&"; + } + $sign .= "$key=$val"; //拼接为url参数形式 + $urls .= "$key=" . urlencode($val); //拼接为url参数形式 + } + } + $sign = md5($sign . $signKey);//密码追加进入开始MD5签名 + return $sign; + } + + public function notifyUrl(Request $request) + { + $data = $request->all(); + $order = $this->orderService->detailOrderSN($data['order_id']); + if (!$order) { + return 'fail'; + } + $payGateway = $this->payService->detail($order->pay_id); + if (!$payGateway) { + return 'fail'; + } + $signature = $this->epusdtSign($data, $payGateway->merchant_id); + if ($data['signature'] != $signature) { //不合法的数据 + return 'fail'; //返回失败 继续补单 + } else { + //合法的数据 + //业务处理 + $this->orderProcessService->completedOrder($data['order_id'], $data['amount'], $data['trade_id']); + return 'ok'; + } + } + + public function returnUrl(Request $request) + { + $oid = $request->get('order_id'); + // 异步通知还没到就跳转了,所以这里休眠2秒 + sleep(2); + return redirect(url('detail-order-sn', ['orderSN' => $oid])); + } + +} diff --git a/plugins/dujiaoka/routes/common/pay.php b/plugins/dujiaoka/routes/common/pay.php new file mode 100644 index 0000000..b4f27ed --- /dev/null +++ b/plugins/dujiaoka/routes/common/pay.php @@ -0,0 +1,56 @@ + + * @copyright assimon + * @link http://utf8.hk/ + */ +use Illuminate\Support\Facades\Route; + +Route::get('pay-gateway/{handle}/{payway}/{orderSN}', 'PayController@redirectGateway'); + +// 支付相关 +Route::group(['prefix' => 'pay', 'namespace' => 'Pay', 'middleware' => ['dujiaoka.pay_gate_way']], function () { + // 支付宝 + Route::get('alipay/{payway}/{orderSN}', 'AlipayController@gateway'); + Route::post('alipay/notify_url', 'AlipayController@notifyUrl'); + // 微信 + Route::get('wepay/{payway}/{orderSN}', 'WepayController@gateway'); + Route::post('wepay/notify_url', 'WepayController@notifyUrl'); + // 码支付 + Route::get('mapay/{payway}/{orderSN}', 'MapayController@gateway'); + Route::post('mapay/notify_url', 'MapayController@notifyUrl'); + // Paysapi + Route::get('paysapi/{payway}/{orderSN}', 'PaysapiController@gateway'); + Route::post('paysapi/notify_url', 'PaysapiController@notifyUrl'); + Route::get('paysapi/return_url', 'PaysapiController@returnUrl')->name('paysapi-return'); + // payjs + Route::get('payjs/{payway}/{orderSN}', 'PayjsController@gateway'); + Route::post('payjs/notify_url', 'PayjsController@notifyUrl'); + // 易支付 + Route::get('yipay/{payway}/{orderSN}', 'YipayController@gateway'); + Route::get('yipay/notify_url', 'YipayController@notifyUrl'); + Route::get('yipay/return_url', 'YipayController@returnUrl')->name('yipay-return'); + // paypal + Route::get('paypal/{payway}/{orderSN}', 'PaypalPayController@gateway'); + Route::get('paypal/return_url', 'PaypalPayController@returnUrl')->name('paypal-return'); + Route::any('paypal/notify_url', 'PaypalPayController@notifyUrl'); + // V免签 + Route::get('vpay/{payway}/{orderSN}', 'VpayController@gateway'); + Route::get('vpay/notify_url', 'VpayController@notifyUrl'); + Route::get('vpay/return_url', 'VpayController@returnUrl')->name('vpay-return'); + // stripe + Route::get('stripe/{payway}/{oid}','StripeController@gateway'); + Route::get('stripe/return_url','StripeController@returnUrl'); + Route::get('stripe/check','StripeController@check'); + Route::get('stripe/charge','StripeController@charge'); + // Coinbase + Route::get('coinbase/{payway}/{orderSN}', 'CoinbaseController@gateway'); + Route::post('coinbase/notify_url', 'CoinbaseController@notifyUrl'); + // epusdt + Route::get('epusdt/{payway}/{orderSN}', 'EpusdtController@gateway'); + Route::post('epusdt/notify_url', 'EpusdtController@notifyUrl'); + Route::get('epusdt/return_url', 'EpusdtController@returnUrl')->name('epusdt-return'); + +}); diff --git a/sql/v0.0.1.sql b/sql/v0.0.1.sql new file mode 100644 index 0000000..98e4865 --- /dev/null +++ b/sql/v0.0.1.sql @@ -0,0 +1,44 @@ +-- auto-generated definition +create table orders +( + id int auto_increment + primary key, + trade_id varchar(32) not null comment 'epusdt订单号', + order_id varchar(32) not null comment '客户交易id', + block_transaction_id varchar(128) null comment '区块唯一编号', + actual_amount decimal(19, 4) not null comment '订单实际需要支付的金额,保留4位小数', + amount decimal(19, 4) not null comment '订单金额,保留4位小数', + token varchar(50) not null comment '所属钱包地址', + status int default 1 not null comment '1:等待支付,2:支付成功,3:已过期', + notify_url varchar(128) not null comment '异步回调地址', + redirect_url varchar(128) null comment '同步回调地址', + callback_num int default 0 null comment '回调次数', + callback_confirm int default 2 null comment '回调是否已确认? 1是 2否', + created_at timestamp null, + updated_at timestamp null, + deleted_at timestamp null, + constraint orders_order_id_uindex + unique (order_id), + constraint orders_trade_id_uindex + unique (trade_id) +); + +create index orders_block_transaction_id_index + on orders (block_transaction_id); + +-- auto-generated definition +create table wallet_address +( + id int auto_increment + primary key, + token varchar(50) not null comment '钱包token', + status int default 1 not null comment '1:启用 2:禁用', + created_at timestamp null, + updated_at timestamp null, + deleted_at timestamp null +) + comment '钱包表'; + +create index wallet_address_token_index + on wallet_address (token); + diff --git a/src/.env.example b/src/.env.example new file mode 100644 index 0000000..ea19130 --- /dev/null +++ b/src/.env.example @@ -0,0 +1,60 @@ +app_name=epusdt +#下面配置你的域名,收银台会需要 +app_uri=https://dujiaoka.com +#是否开启debug,默认false +app_debug=false +#http服务监听端口 +http_listen=:8000 + +#静态资源文件目录 +static_path=/static +#缓存路径 +runtime_root_path=/runtime + +#日志配置 +log_save_path=/logs +log_max_size=32 +log_max_age=7 +max_backups=3 + +# mysql配置 +mysql_host=127.0.0.1 +mysql_port=3306 +mysql_user=mysql账号 +mysql_passwd=mysql密码 +mysql_database=数据库 +mysql_table_prefix= +mysql_max_idle_conns=10 +mysql_max_open_conns=100 +mysql_max_life_time=6 + +# redis配置 +redis_host=127.0.0.1 +redis_port=6379 +redis_passwd= +redis_db=5 +redis_pool_size=5 +redis_max_retries=3 +redis_idle_timeout=1000 + +# 消息队列配置 +queue_concurrency=10 +queue_level_critical=6 +queue_level_default=3 +queue_level_low=1 + +#机器人Apitoken +tg_bot_token= +#telegram代理url(大陆地区服务器可使用一台国外服务器做反代tg的url),如果运行的本来就是境外服务器,则无需填写 +tg_proxy= +#管理员userid +tg_manage= + +#api接口认证token +api_auth_token= + +#订单过期时间(单位分钟) +order_expiration_time=10 + +#强制汇率(设置此参数后每笔交易将按照此汇率计算,例如:6.4) +forced_usdt_rate= \ No newline at end of file diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..1a07445 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1,2 @@ +.DS_Store +dist/ diff --git a/src/.goreleaser.yaml b/src/.goreleaser.yaml new file mode 100644 index 0000000..199b6ed --- /dev/null +++ b/src/.goreleaser.yaml @@ -0,0 +1,43 @@ +# This is an example .goreleaser.yml file with some sensible defaults. +# Make sure to check the documentation at https://goreleaser.com +before: + hooks: + # You may remove this if you don't use go modules. + #- go mod tidy + # you may remove this if you don't need go generate + #- go generate ./... +builds: + - env: + - CGO_ENABLED=0 + goos: + - darwin + - linux + - windows + goarch: + - amd64 + #- arm + #- 386 +archives: + - replacements: + darwin: Darwin + linux: Linux + windows: Windows + 386: i386 + amd64: x86_64 + id: epusdt + name_template: "{{ .ProjectName }}_v0.0.1_{{ .Os }}_{{ .Arch }}" + format: tar.gz + files: + - .env.example + - static/* + - runtime/* +checksum: + name_template: 'checksums.txt' +snapshot: + name_template: "{{ incpatch .Version }}-next" +changelog: + sort: asc + filters: + exclude: + - '^docs:' + - '^test:' diff --git a/src/bootstrap/bootstrap.go b/src/bootstrap/bootstrap.go new file mode 100644 index 0000000..1ca8b09 --- /dev/null +++ b/src/bootstrap/bootstrap.go @@ -0,0 +1,33 @@ +package bootstrap + +import ( + "github.com/assimon/luuu/command" + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/model/dao" + "github.com/assimon/luuu/mq" + "github.com/assimon/luuu/task" + "github.com/assimon/luuu/telegram" + "github.com/assimon/luuu/util/log" +) + +//Start 服务启动 +func Start() { + // 配置加载 + config.Init() + // 日志加载 + log.Init() + // Mysql启动 + dao.MysqlInit() + // redis启动 + dao.RedisInit() + // 队列启动 + mq.Start() + // telegram机器人启动 + go telegram.BotStart() + // 定时任务 + go task.Start() + err := command.Execute() + if err != nil { + panic(err) + } +} diff --git a/src/command/http_server.go b/src/command/http_server.go new file mode 100644 index 0000000..f9e4dae --- /dev/null +++ b/src/command/http_server.go @@ -0,0 +1,99 @@ +package command + +import ( + "context" + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/middleware" + "github.com/assimon/luuu/route" + "github.com/assimon/luuu/util/constant" + luluHttp "github.com/assimon/luuu/util/http" + "github.com/assimon/luuu/util/log" + "github.com/labstack/echo/v4" + echoMiddleware "github.com/labstack/echo/v4/middleware" + "github.com/spf13/cobra" + "github.com/spf13/viper" + "net/http" + "os" + "os/signal" + "time" +) + +var httpCmd = &cobra.Command{ + Use: "http", + Short: "http服务", + Long: "http服务相关命令", + Run: func(cmd *cobra.Command, args []string) { + }, +} + +func init() { + httpCmd.AddCommand(startCmd) +} + +var startCmd = &cobra.Command{ + Use: "start", + Short: "启动", + Long: "启动http服务", + Run: func(cmd *cobra.Command, args []string) { + HttpServerStart() + }, +} + +func HttpServerStart() { + var err error + e := echo.New() + e.HideBanner = true + e.HTTPErrorHandler = customHTTPErrorHandler + // 中间件注册 + MiddlewareRegister(e) + // 路由注册 + route.RegisterRoute(e) + // 静态目录注册 + e.Static(config.StaticPath, "static") + httpListen := viper.GetString("http_listen") + go func() { + if err = e.Start(httpListen); err != http.ErrServerClosed { + log.Sugar.Error(err) + } + }() + // Wait for interrupt signal to gracefully shutdown the server with a timeout of 10 seconds. + // Use a buffered channel to avoid missing signals as recommended for signal.Notify + quit := make(chan os.Signal, 1) + signal.Notify(quit, os.Interrupt, os.Kill) + <-quit + ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second) + defer cancel() + if err = e.Shutdown(ctx); err != nil { + e.Logger.Fatal(err) + } +} + +// MiddlewareRegister 中间件注册 +func MiddlewareRegister(e *echo.Echo) { + if config.AppDebug { + e.Debug = true + e.Use(echoMiddleware.Logger()) + } + e.Use(middleware.RequestUUID()) +} + +// customHTTPErrorHandler 默认消息提示 +func customHTTPErrorHandler(err error, e echo.Context) { + code := http.StatusInternalServerError + msg := "server error" + resp := &luluHttp.Response{ + StatusCode: code, + Message: msg, + RequestID: e.Request().Header.Get(echo.HeaderXRequestID), + } + if he, ok := err.(*echo.HTTPError); ok { + e.String(http.StatusOK, he.Message.(string)) + return + } + if he, ok := err.(*constant.RspError); ok { + resp.StatusCode = he.Code + resp.Message = he.Msg + } + _ = e.JSON(http.StatusOK, resp) + return +} diff --git a/src/command/root.go b/src/command/root.go new file mode 100644 index 0000000..7d73bfa --- /dev/null +++ b/src/command/root.go @@ -0,0 +1,13 @@ +package command + +import "github.com/spf13/cobra" + +var rootCmd = &cobra.Command{} + +func Execute() error { + return rootCmd.Execute() +} + +func init() { + rootCmd.AddCommand(httpCmd) +} diff --git a/src/config/config.go b/src/config/config.go new file mode 100644 index 0000000..54bbea7 --- /dev/null +++ b/src/config/config.go @@ -0,0 +1,92 @@ +package config + +import ( + "fmt" + "github.com/spf13/viper" + "os" +) + +var ( + AppDebug bool + MysqlDns string + RuntimePath string + LogSavePath string + StaticPath string + TgBotToken string + TgProxy string + TgManage int64 + UsdtRate float64 +) + +func Init() { + viper.AddConfigPath("./") + viper.SetConfigFile(".env") + err := viper.ReadInConfig() + if err != nil { + panic(err) + } + gwd, err := os.Getwd() + if err != nil { + panic(err) + } + AppDebug = viper.GetBool("app_debug") + StaticPath = viper.GetString("static_path") + RuntimePath = fmt.Sprintf( + "%s%s", + gwd, + viper.GetString("runtime_root_path")) + LogSavePath = fmt.Sprintf( + "%s%s", + RuntimePath, + viper.GetString("log_save_path")) + MysqlDns = fmt.Sprintf("%s:%s@tcp(%s)/%s?charset=utf8mb4&parseTime=True&loc=Local", + viper.GetString("mysql_user"), + viper.GetString("mysql_passwd"), + fmt.Sprintf( + "%s:%s", + viper.GetString("mysql_host"), + viper.GetString("mysql_port")), + viper.GetString("mysql_database")) + TgBotToken = viper.GetString("tg_bot_token") + TgProxy = viper.GetString("tg_proxy") + TgManage = viper.GetInt64("tg_manage") +} + +func GetAppVersion() string { + return "0.0.1" +} + +func GetAppName() string { + appName := viper.GetString("app_name") + if appName == "" { + return "epusdt" + } + return appName +} + +func GetAppUri() string { + return viper.GetString("app_uri") +} + +func GetApiAuthToken() string { + return viper.GetString("api_auth_token") +} + +func GetUsdtRate() float64 { + forcedUsdtRate := viper.GetFloat64("forced_usdt_rate") + if forcedUsdtRate > 0 { + return forcedUsdtRate + } + if UsdtRate <= 0 { + return 6.4 + } + return UsdtRate +} + +func GetOrderExpirationTime() int { + timer := viper.GetInt("order_expiration_time") + if timer <= 0 { + return 10 + } + return timer +} diff --git a/src/controller/base.go b/src/controller/base.go new file mode 100644 index 0000000..fb25bba --- /dev/null +++ b/src/controller/base.go @@ -0,0 +1,51 @@ +package controller + +import ( + "errors" + "github.com/assimon/luuu/util/http" + "github.com/gookit/validate" + "github.com/gookit/validate/locales/zhcn" + "github.com/gookit/validate/locales/zhtw" + "github.com/labstack/echo/v4" + "sync" +) + +var Ctrl = &BaseController{} + +type validatorBase struct { + once sync.Once + validate *validate.Validation +} + +type BaseController struct { + http.Resp + Validator validatorBase + Locale string +} + +func (c *BaseController) GetLocale(ctx echo.Context) string { + c.Locale = ctx.Request().Header.Get("locale") + return c.Locale +} + +func (c *BaseController) RegisterGlobal(ctx echo.Context) { + locale := c.GetLocale(ctx) + switch locale { + case "zh": + zhcn.RegisterGlobal() + case "zh-tw": + zhtw.RegisterGlobal() + default: + zhcn.RegisterGlobal() + } +} + +func (c *BaseController) ValidateStruct(ctx echo.Context, i interface{}, scene ...string) error { + c.RegisterGlobal(ctx) + v := validate.Struct(i, scene...) + if v.Validate() { + return nil + } else { + return errors.New(v.Errors.One()) + } +} diff --git a/src/controller/comm/base.go b/src/controller/comm/base.go new file mode 100644 index 0000000..b0b18a3 --- /dev/null +++ b/src/controller/comm/base.go @@ -0,0 +1,9 @@ +package comm + +import "github.com/assimon/luuu/controller" + +var Ctrl = &BaseCommController{} + +type BaseCommController struct { + controller.BaseController +} diff --git a/src/controller/comm/order_controller.go b/src/controller/comm/order_controller.go new file mode 100644 index 0000000..f745711 --- /dev/null +++ b/src/controller/comm/order_controller.go @@ -0,0 +1,24 @@ +package comm + +import ( + "github.com/assimon/luuu/model/request" + "github.com/assimon/luuu/model/service" + "github.com/assimon/luuu/util/constant" + "github.com/labstack/echo/v4" +) + +// CreateTransaction 创建交易 +func (c *BaseCommController) CreateTransaction(ctx echo.Context) (err error) { + req := new(request.CreateTransactionRequest) + if err = ctx.Bind(req); err != nil { + return c.FailJson(ctx, constant.ParamsMarshalErr) + } + if err = c.ValidateStruct(ctx, req); err != nil { + return c.FailJson(ctx, err) + } + resp, err := service.CreateTransaction(req) + if err != nil { + return c.FailJson(ctx, err) + } + return c.SucJson(ctx, resp) +} diff --git a/src/controller/comm/pay_controller.go b/src/controller/comm/pay_controller.go new file mode 100644 index 0000000..258dffa --- /dev/null +++ b/src/controller/comm/pay_controller.go @@ -0,0 +1,39 @@ +package comm + +import ( + "fmt" + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/model/response" + "github.com/assimon/luuu/model/service" + "github.com/labstack/echo/v4" + "html/template" + "net/http" +) + +// CheckoutCounter 收银台 +func (c *BaseCommController) CheckoutCounter(ctx echo.Context) (err error) { + tradeId := ctx.Param("trade_id") + resp, err := service.GetCheckoutCounterByTradeId(tradeId) + if err != nil { + return ctx.String(http.StatusOK, err.Error()) + } + tmpl, err := template.ParseFiles(fmt.Sprintf(".%s/%s", config.StaticPath, "index.html")) + if err != nil { + return ctx.String(http.StatusOK, err.Error()) + } + return tmpl.Execute(ctx.Response(), resp) +} + +// CheckStatus 支付状态检测 +func (c *BaseCommController) CheckStatus(ctx echo.Context) (err error) { + tradeId := ctx.Param("trade_id") + order, err := service.GetOrderInfoByTradeId(tradeId) + if err != nil { + return c.FailJson(ctx, err) + } + resp := response.CheckStatusResponse{ + TradeId: order.TradeId, + Status: order.Status, + } + return c.SucJson(ctx, resp) +} diff --git a/src/go.mod b/src/go.mod new file mode 100644 index 0000000..fc78c0f --- /dev/null +++ b/src/go.mod @@ -0,0 +1,26 @@ +module github.com/assimon/luuu + +go 1.16 + +require ( + github.com/go-redis/redis/v8 v8.11.5 + github.com/go-resty/resty/v2 v2.7.0 + github.com/golang-module/carbon/v2 v2.0.1 + github.com/gookit/color v1.5.0 + github.com/gookit/goutil v0.4.4 + github.com/gookit/validate v1.2.11 + github.com/hibiken/asynq v0.22.1 + github.com/json-iterator/go v1.1.12 + github.com/labstack/echo/v4 v4.6.0 + github.com/natefinch/lumberjack v2.0.0+incompatible + github.com/robfig/cron/v3 v3.0.1 + github.com/satori/go.uuid v1.2.0 + github.com/shopspring/decimal v1.3.1 + github.com/spf13/cobra v1.2.1 + github.com/spf13/viper v1.9.0 + go.uber.org/zap v1.17.0 + gopkg.in/natefinch/lumberjack.v2 v2.0.0 // indirect + gopkg.in/telebot.v3 v3.0.0 + gorm.io/driver/mysql v1.1.2 + gorm.io/gorm v1.21.15 +) diff --git a/src/go.sum b/src/go.sum new file mode 100644 index 0000000..a8fd7b2 --- /dev/null +++ b/src/go.sum @@ -0,0 +1,835 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU= +cloud.google.com/go v0.44.1/go.mod h1:iSa0KzasP4Uvy3f1mN/7PiObzGgflwredwwASm/v6AU= +cloud.google.com/go v0.44.2/go.mod h1:60680Gw3Yr4ikxnPRS/oxxkBccT6SA1yMk63TGekxKY= +cloud.google.com/go v0.45.1/go.mod h1:RpBamKRgapWJb87xiFSdk4g1CME7QZg3uwTez+TSTjc= +cloud.google.com/go v0.46.3/go.mod h1:a6bKKbmY7er1mI7TEI4lsAkts/mkhTSZK8w33B4RAg0= +cloud.google.com/go v0.50.0/go.mod h1:r9sluTvynVuxRIOHXQEHMFffphuXHOMZMycpNR5e6To= +cloud.google.com/go v0.52.0/go.mod h1:pXajvRH/6o3+F9jDHZWQ5PbGhn+o8w9qiu/CffaVdO4= +cloud.google.com/go v0.53.0/go.mod h1:fp/UouUEsRkN6ryDKNW/Upv/JBKnv6WDthjR6+vze6M= +cloud.google.com/go v0.54.0/go.mod h1:1rq2OEkV3YMf6n/9ZvGWI3GWw0VoqH/1x2nd8Is/bPc= +cloud.google.com/go v0.56.0/go.mod h1:jr7tqZxxKOVYizybht9+26Z/gUq7tiRzu+ACVAMbKVk= +cloud.google.com/go v0.57.0/go.mod h1:oXiQ6Rzq3RAkkY7N6t3TcE6jE+CIBBbA36lwQ1JyzZs= +cloud.google.com/go v0.62.0/go.mod h1:jmCYTdRCQuc1PHIIJ/maLInMho30T/Y0M4hTdTShOYc= +cloud.google.com/go v0.65.0/go.mod h1:O5N8zS7uWy9vkA9vayVHs65eM1ubvY4h553ofrNHObY= +cloud.google.com/go v0.72.0/go.mod h1:M+5Vjvlc2wnp6tjzE102Dw08nGShTscUx2nZMufOKPI= +cloud.google.com/go v0.74.0/go.mod h1:VV1xSbzvo+9QJOxLDaJfTjx5e+MePCpCWwvftOeQmWk= +cloud.google.com/go v0.78.0/go.mod h1:QjdrLG0uq+YwhjoVOLsS1t7TW8fs36kLs4XO5R5ECHg= +cloud.google.com/go v0.79.0/go.mod h1:3bzgcEeQlzbuEAYu4mrWhKqWjmpprinYgKJLgKHnbb8= +cloud.google.com/go v0.81.0/go.mod h1:mk/AM35KwGk/Nm2YSeZbxXdrNK3KZOYHmLkOqC2V6E0= +cloud.google.com/go v0.83.0/go.mod h1:Z7MJUsANfY0pYPdw0lbnivPx4/vhy/e2FEkSkF7vAVY= +cloud.google.com/go v0.84.0/go.mod h1:RazrYuxIK6Kb7YrzzhPoLmCVzl7Sup4NrbKPg8KHSUM= +cloud.google.com/go v0.87.0/go.mod h1:TpDYlFy7vuLzZMMZ+B6iRiELaY7z/gJPaqbMx6mlWcY= +cloud.google.com/go v0.90.0/go.mod h1:kRX0mNRHe0e2rC6oNakvwQqzyDmg57xJ+SZU1eT2aDQ= +cloud.google.com/go v0.93.3/go.mod h1:8utlLll2EF5XMAV15woO4lSbWQlk8rer9aLOfLh7+YI= +cloud.google.com/go/bigquery v1.0.1/go.mod h1:i/xbL2UlR5RvWAURpBYZTtm/cXjCha9lbfbpx4poX+o= +cloud.google.com/go/bigquery v1.3.0/go.mod h1:PjpwJnslEMmckchkHFfq+HTD2DmtT67aNFKH1/VBDHE= +cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvftPBK2Dvzc= +cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg= +cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc= +cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ= +cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE= +cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk= +cloud.google.com/go/firestore v1.1.0/go.mod h1:ulACoGHTpvq5r8rxGJ4ddJZBZqakUQqClKRT5SZwBmk= +cloud.google.com/go/firestore v1.6.0/go.mod h1:afJwI0vaXwAG54kI7A//lP/lSPDkQORQuMkv56TxEPU= +cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I= +cloud.google.com/go/pubsub v1.1.0/go.mod h1:EwwdRX2sKPjnvnqCa270oGRyludottCI76h+R3AArQw= +cloud.google.com/go/pubsub v1.2.0/go.mod h1:jhfEVHT8odbXTkndysNHCcx0awwzvfOlguIAii9o8iA= +cloud.google.com/go/pubsub v1.3.1/go.mod h1:i+ucay31+CNRpDW4Lu78I4xXG+O1r/MAHgjpRVR+TSU= +cloud.google.com/go/storage v1.0.0/go.mod h1:IhtSnM/ZTZV8YYJWCY8RULGVqBDmpoyjwiyrjsg+URw= +cloud.google.com/go/storage v1.5.0/go.mod h1:tpKbwo567HUNpVclU5sGELwQWBDZ8gh0ZeosJ0Rtdos= +cloud.google.com/go/storage v1.6.0/go.mod h1:N7U0C8pVQ/+NIKOBQyamJIeKQKkZ+mxpohlUTyfDhBk= +cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RXyy7KQOVs= +cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0= +dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo= +github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= +github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY= +github.com/armon/circbuf v0.0.0-20150827004946-bbbad097214e/go.mod h1:3U/XgcO3hCbHZ8TKRvWD2dDTCfh9M9ya+I9JpbB7O8o= +github.com/armon/go-metrics v0.0.0-20180917152333-f0300d1749da/go.mod h1:Q73ZrmVTwzkszR9V5SSuryQ31EELlFMUz1kKyl939pY= +github.com/armon/go-radix v0.0.0-20180808171621-7fddfc383310/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/armon/go-radix v1.0.0/go.mod h1:ufUuZ+zHj4x4TnLV4JWEpy2hxWSpsRywHrMgIH9cCH8= +github.com/bgentry/speakeasy v0.1.0/go.mod h1:+zsyZBPWlz7T6j88CTgSN5bM796AkVf0kBD4zp0CCIs= +github.com/bketelsen/crypt v0.0.4/go.mod h1:aI6NrJ0pMGgvZKL1iVgXLnfIFJtfV+bKCoqOes/6LfM= +github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= +github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= +github.com/cespare/xxhash/v2 v2.1.1/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/cespare/xxhash/v2 v2.1.2 h1:YRXhKfTDauu4ajMg1TPgFO5jnlC2HCbmLXMcTG5cbYE= +github.com/cespare/xxhash/v2 v2.1.2/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= +github.com/chzyer/logex v1.1.10/go.mod h1:+Ywpsq7O8HXn0nuIou7OrIPyXbp3wmkHB+jjWRnGsAI= +github.com/chzyer/readline v0.0.0-20180603132655-2972be24d48e/go.mod h1:nSuG5e5PlCu98SY8svDHJxuZscDgtXS6KTTbou5AhLI= +github.com/chzyer/test v0.0.0-20180213035817-a1ea475d72b1/go.mod h1:Q3SI9o4m/ZMnBNeIyt5eFwwo7qiLfzFZmjNmxjkiQlU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= +github.com/cncf/udpa/go v0.0.0-20200629203442-efcf912fb354/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/udpa/go v0.0.0-20201120205902-5459f2c99403/go.mod h1:WmhPx2Nbnhtbo57+VJT5O0JRkEi1Wbu0z5j0R8u5Hbk= +github.com/cncf/xds/go v0.0.0-20210312221358-fbca930ec8ed/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs= +github.com/coreos/go-semver v0.3.0/go.mod h1:nnelYz7RCh+5ahJtPPxZlU+153eP4D4r3EedlOD2RNk= +github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc= +github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsrgA7czyZG/E6dU= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78= +github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f/go.mod h1:cuUVRXasLTGF7a8hSLbxyZXjz+1KgoB3wDUb6vlszIc= +github.com/envoyproxy/go-control-plane v0.9.0/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.1-0.20191026205805-5f8ba28d4473/go.mod h1:YTl/9mNaCwkRvm6d1a2C3ymFceY/DCBVvsKhRF0iEA4= +github.com/envoyproxy/go-control-plane v0.9.4/go.mod h1:6rpuAdCZL397s3pYoYcLgu1mIlRU8Am5FuJP05cCM98= +github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5ynNVH9qI8YYLbd1fK2po= +github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210217033140-668b12f5399d/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk= +github.com/envoyproxy/go-control-plane v0.9.9-0.20210512163311-63b5d3c536b0/go.mod h1:hliV/p42l8fGbc6Y9bQ70uLwIvmJyVE5k4iMKlh8wCQ= +github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c= +github.com/fatih/color v1.7.0/go.mod h1:Zm6kSWBoL9eyXnKyktHP6abPY2pDugNf5KwzbycvMj4= +github.com/fatih/color v1.9.0/go.mod h1:eQcE1qtQxscV5RaZvpXrrb8Drkc3/DdQ+uUYCNjL+zU= +github.com/fatih/color v1.10.0/go.mod h1:ELkj/draVOlAH/xkhN6mQ50Qd0MPOk5AAr3maGEBuJM= +github.com/fatih/color v1.13.0/go.mod h1:kLAiJbzzSOZDVNGyDpeOxJ47H46qBXwg5ILebYFFOfk= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/fsnotify/fsnotify v1.4.9/go.mod h1:znqG4EE+3YCdAaPaxE2ZRY/06pZUdp0tY4IgpuI1SZQ= +github.com/fsnotify/fsnotify v1.5.1 h1:mZcQUHVQUQWoPXXtuf9yuEXKudkV2sx1E06UadKWpgI= +github.com/fsnotify/fsnotify v1.5.1/go.mod h1:T3375wBYaZdLLcVNkcVbzGHY7f1l/uK5T5Ai1i3InKU= +github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04= +github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8= +github.com/go-playground/assert/v2 v2.0.1/go.mod h1:VDjEfimB/XKnb+ZQfWdccd7VUvScMdVu0Titje2rxJ4= +github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTMfnGwq/HNwmWNS8= +github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= +github.com/go-playground/validator/v10 v10.4.1/go.mod h1:nlOn6nFhuKACm19sB/8EGNn9GlaMV7XkbRSipzJ0Ii4= +github.com/go-redis/redis/v8 v8.11.2/go.mod h1:DLomh7y2e3ggQXQLd1YgmvIfecPJoFl7WU5SOQ/r06M= +github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI= +github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo= +github.com/go-resty/resty/v2 v2.7.0 h1:me+K9p3uhSmXtrBZ4k9jcEAfJmuC8IivWHwaLZwPrFY= +github.com/go-resty/resty/v2 v2.7.0/go.mod h1:9PWDzw47qPphMRFfhsyk0NnSgvluHcljSMVIq3w7q0I= +github.com/go-sql-driver/mysql v1.6.0 h1:BCTh4TKNUYmOmMUcQ3IipzF5prigylS7XXjEkfCHuOE= +github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg= +github.com/go-task/slim-sprig v0.0.0-20210107165309-348f09dbbbc0/go.mod h1:fyg7847qk6SyHyPtNmDHnmrv/HOrqktSC+C9fM+CJOE= +github.com/goccy/go-yaml v1.9.5/go.mod h1:U/jl18uSupI5rdI2jmuCswEA2htH9eXfferR3KfscvA= +github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= +github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-module/carbon/v2 v2.0.1 h1:lck7WgSNVvUIRbwE+MJG3qyrT+Vrcz1tp6TkZ91gFgE= +github.com/golang-module/carbon/v2 v2.0.1/go.mod h1:NF5unWf838+pyRY0o+qZdIwBMkFf7w0hmLIguLiEpzU= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.3.1/go.mod h1:sBzyDLLjw3U8JLTeZvSv8jJB+tU5PVekmnlKIyFUx0Y= +github.com/golang/mock v1.4.0/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.1/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.3/go.mod h1:UOMv5ysSaYNkG+OFQykRIcU/QvvxJf3p21QfJ2Bt3cw= +github.com/golang/mock v1.4.4/go.mod h1:l3mdAwkq5BuhzHwde/uurv3sEJeZMXNpwsxVWU71h+4= +github.com/golang/mock v1.5.0/go.mod h1:CWnOUgYIOo4TcNZ0wHX3YZCqsaM1I1Jvs6v3mP3KVu8= +github.com/golang/mock v1.6.0/go.mod h1:p6yTPP+5HYm5mzsMV8JkE6ZKdX+/wYM6Hr+LicevLPs= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.3/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/golang/protobuf v1.3.5/go.mod h1:6O5/vntMXwX2lRkT1hjjk0nAC1IDOTvTlVgjlRvqsdk= +github.com/golang/protobuf v1.4.0-rc.1/go.mod h1:ceaxUfeHdC40wWswd/P6IGgMaK3YpKi5j83Wpe3EHw8= +github.com/golang/protobuf v1.4.0-rc.1.0.20200221234624-67d41d38c208/go.mod h1:xKAWHe0F5eneWXFV3EuXVDTCmh+JuBKY0li0aMyXATA= +github.com/golang/protobuf v1.4.0-rc.2/go.mod h1:LlEzMj4AhA7rCAGe4KMBDvJI+AwstrUpVNzEA03Pprs= +github.com/golang/protobuf v1.4.0-rc.4.0.20200313231945-b860323f09d0/go.mod h1:WU3c8KckQ9AFe+yFwt9sWVRKCVIyN9cPHBJSNnbL67w= +github.com/golang/protobuf v1.4.0/go.mod h1:jodUvKwWbYaEsadDk5Fwe5c77LiNKVO9IDvqG2KuDX0= +github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QDs8UjoX8= +github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI= +github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk= +github.com/golang/protobuf v1.5.1/go.mod h1:DopwsBzvsk0Fs44TXzsVbJyPhcCPeIwnvohx4u74HPM= +github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= +github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY= +github.com/golang/snappy v0.0.3/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q= +github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/google/go-cmp v0.3.0/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.4.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.3/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.6 h1:BKbKCqvP6I+rmFHt06ZmyQtvB8xAkWdhFyr0ZUNZcxQ= +github.com/google/go-cmp v0.5.6/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs= +github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0= +github.com/google/martian/v3 v3.2.1/go.mod h1:oBOf6HBosgwRXnUGWUB05QECsc6uvmMiJ3+6W4l/CUk= +github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20190515194954-54271f7e092f/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc= +github.com/google/pprof v0.0.0-20191218002539-d4f498aebedc/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM= +github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210122040257-d980be63207e/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210226084205-cbba55b83ad5/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210601050228-01bbb1931b22/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210609004039-a478d1d731e9/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/pprof v0.0.0-20210720184732-4bb14d4b1be1/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= +github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= +github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/google/uuid v1.2.0 h1:qJYtXnJRWmpe7m/3XlyhrsLrEURqHRM2kxzoxXqyUDs= +github.com/google/uuid v1.2.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= +github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg= +github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk= +github.com/googleapis/gax-go/v2 v2.1.0/go.mod h1:Q3nei7sK6ybPYH7twZdmQpAd1MKb7pfu6SK+H1/DsU0= +github.com/gookit/color v1.3.8/go.mod h1:R3ogXq2B9rTbXoSHJ1HyUVAZ3poOJHpd9nQmyGZsfvQ= +github.com/gookit/color v1.5.0 h1:1Opow3+BWDwqor78DcJkJCIwnkviFi+rrOANki9BUFw= +github.com/gookit/color v1.5.0/go.mod h1:43aQb+Zerm/BWh2GnrgOQm7ffz7tvQXEKV6BFMl7wAo= +github.com/gookit/filter v1.1.2 h1:mp6zSRaRhGuoGZNUlZR4W0/1OTwKRUI5qCXEtD02BR0= +github.com/gookit/filter v1.1.2/go.mod h1:pVXLLDD+A8yH9GRztq2Cp7zwZocnuTUpbZs9Q+awAKM= +github.com/gookit/goutil v0.3.12/go.mod h1:ITj7Lw0muhJNOX+QRa+j+HH0+RNoQVuTmZx5d5LE1vE= +github.com/gookit/goutil v0.4.4 h1:18xr8NKbs4LteyOHZfQ8g7JqTqZal801mAT6LERGdpE= +github.com/gookit/goutil v0.4.4/go.mod h1:qlGVh0PI+WnWSjYnIocfz/7tkeogxL6+EDNP1mRe+7o= +github.com/gookit/validate v1.2.11 h1:zUMsezhMrW3Cy8St3cQJgCKB1ZIbKOWK8e7WMSuVIRc= +github.com/gookit/validate v1.2.11/go.mod h1:wXo0Vr+AzFUCEUCbTFXgKlPfT+V/V0wPK3zLp49jQq0= +github.com/gopherjs/gopherjs v0.0.0-20181017120253-0766667cb4d1/go.mod h1:wJfORRmW1u3UXTncJ5qlYoELFm8eSnnEO6hX4iZ3EWY= +github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw= +github.com/hashicorp/consul/api v1.1.0/go.mod h1:VmuI/Lkw1nC05EYQWNKwWGbkg+FbDBtguAZLlVdkD9Q= +github.com/hashicorp/consul/api v1.10.1/go.mod h1:XjsvQN+RJGWI2TWy1/kqaE16HrR2J/FWgkYjdZQsX9M= +github.com/hashicorp/consul/sdk v0.1.1/go.mod h1:VKf9jXwCTEY1QZP2MOLRhb5i/I/ssyNV1vwHyQBF0x8= +github.com/hashicorp/consul/sdk v0.8.0/go.mod h1:GBvyrGALthsZObzUGsfgHZQDXjg4lOjagTIwIR1vPms= +github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4= +github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80= +github.com/hashicorp/go-hclog v0.12.0/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= +github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= +github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= +github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= +github.com/hashicorp/go-multierror v1.1.0/go.mod h1:spPvp8C1qA32ftKqdAHm4hHTbPw+vmowP0z+KUhOZdA= +github.com/hashicorp/go-rootcerts v1.0.0/go.mod h1:K6zTfqpRlCUIjkwsN4Z+hiSfzSTQa6eBIzfwKfwNnHU= +github.com/hashicorp/go-rootcerts v1.0.2/go.mod h1:pqUvnprVnM5bf7AOirdbb01K4ccR319Vf4pU3K5EGc8= +github.com/hashicorp/go-sockaddr v1.0.0/go.mod h1:7Xibr9yA9JjQq1JpNB2Vw7kxv8xerXegt+ozgdvDeDU= +github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4= +github.com/hashicorp/go-uuid v1.0.0/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go-uuid v1.0.1/go.mod h1:6SBZvOh/SIDV7/2o3Jml5SYk/TvGqwFJ/bN7x4byOro= +github.com/hashicorp/go.net v0.0.1/go.mod h1:hjKkEWcCURg++eb33jQU7oqQcI9XDCnUzHA0oac0k90= +github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8= +github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4= +github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ= +github.com/hashicorp/logutils v1.0.0/go.mod h1:QIAnNjmIWmVIIkWDTG1z5v++HQmx9WQRO+LraFDTW64= +github.com/hashicorp/mdns v1.0.0/go.mod h1:tL+uN++7HEJ6SQLQ2/p+z2pH24WQKWjBPkE0mNTz8vQ= +github.com/hashicorp/mdns v1.0.1/go.mod h1:4gW7WsVCke5TE7EPeYliwHlRUyBtfCwuFwuMg2DmyNY= +github.com/hashicorp/memberlist v0.1.3/go.mod h1:ajVTdAv/9Im8oMAAj5G31PhhMCZJV2pPBoIllUwCN7I= +github.com/hashicorp/memberlist v0.2.2/go.mod h1:MS2lj3INKhZjWNqd3N0m3J+Jxf3DAOnAH9VT3Sh9MUE= +github.com/hashicorp/serf v0.8.2/go.mod h1:6hOLApaqBFA1NXqRQAsxw9QxuDEvNxSQRwA/JwenrHc= +github.com/hashicorp/serf v0.9.5/go.mod h1:UWDWwZeL5cuWDJdl0C6wrvrUwEqtQ4ZKBKKENpqIUyk= +github.com/hibiken/asynq v0.22.1 h1:t7bbiz2O4MC69qKeKp5UON7ToxynBNXT/kTP/XYq9M8= +github.com/hibiken/asynq v0.22.1/go.mod h1:K70jPVx+CAmmQrXot7Dru0D52EO7ob4BIun3ri5z1Qw= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc= +github.com/inconshreveable/mousetrap v1.0.0 h1:Z8tu5sraLXCXIcARxBp/8cbvlwVa7Z1NHg9XEKhtSvM= +github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANytuPF1OarO4DADm73n8= +github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E= +github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc= +github.com/jinzhu/now v1.1.2 h1:eVKgfIdy9b6zbWBMgFpfDPoAMifwSZagU9HmEU6zgiI= +github.com/jinzhu/now v1.1.2/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8= +github.com/json-iterator/go v1.1.10/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.11/go.mod h1:KdQUCv79m/52Kvf8AW2vK1V8akMuk1QjK/uOdHXbAo4= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU= +github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk= +github.com/jtolds/gls v4.20.0+incompatible/go.mod h1:QJZ7F/aHp+rZTRtaJ1ow/lLfFfVYBRgL+9YlvaHOwJU= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= +github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/labstack/echo/v4 v4.6.0 h1:vsYEeeYy077cB5yMpgI+ubA7iVRZEtrzHhcvRhd27gA= +github.com/labstack/echo/v4 v4.6.0/go.mod h1:RnjgMWNDB9g/HucVWhQYNQP9PvbYf6adqftqryo7s9k= +github.com/labstack/gommon v0.3.0 h1:JEeO0bvc78PKdyHxloTKiF8BD5iGrH8T6MSeGvSgob0= +github.com/labstack/gommon v0.3.0/go.mod h1:MULnywXg0yavhxWKc+lOruYdAhDwPK9wf0OL7NoOu+k= +github.com/leodido/go-urn v1.2.0/go.mod h1:+8+nEpDfqqsY+g338gtMEUOtuK+4dEMhiQEgxpxOKII= +github.com/magiconair/properties v1.8.5 h1:b6kJs+EmPFMYGkow9GiUyCyOvIwYetYJ3fSaWak/Gls= +github.com/magiconair/properties v1.8.5/go.mod h1:y3VJvCyxH9uVvJTWEGAELF3aiYNyPKd5NZ3oSwXrF60= +github.com/mattn/go-colorable v0.0.9/go.mod h1:9vuHe8Xs5qXnSaW/c/ABM9alt+Vo+STaOChaDxuIBZU= +github.com/mattn/go-colorable v0.1.2/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.4/go.mod h1:U0ppj6V5qS13XJ6of8GYAs25YV2eR4EVcfRqFIhoBtE= +github.com/mattn/go-colorable v0.1.6/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.8/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.9/go.mod h1:u6P/XSegPjTcexA+o6vUJrdnUu04hMope9wVRipJSqc= +github.com/mattn/go-colorable v0.1.12 h1:jF+Du6AlPIjs2BiUiQlKOX0rt3SujHxPnksPKZbaA40= +github.com/mattn/go-colorable v0.1.12/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4= +github.com/mattn/go-isatty v0.0.3/go.mod h1:M+lRXTBqGeGNdLjl/ufCoiOlB5xdOkqRJdNxMWT7Zi4= +github.com/mattn/go-isatty v0.0.8/go.mod h1:Iq45c/XA43vh69/j3iqttzPXn0bhXyGjM0Hdxcsrc5s= +github.com/mattn/go-isatty v0.0.9/go.mod h1:YNRxwqDuOph6SZLI9vUUz6OYw3QyUt7WiY2yME+cCiQ= +github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84= +github.com/mattn/go-isatty v0.0.11/go.mod h1:PhnuNfih5lzO57/f3n+odYbM4JtupLOxQOAqxQCu2WE= +github.com/mattn/go-isatty v0.0.12/go.mod h1:cbi8OIDigv2wuxKPP5vlRcQ1OAZbq2CE4Kysco4FUpU= +github.com/mattn/go-isatty v0.0.14 h1:yVuAays6BHfxijgZPzw+3Zlu5yQgKGP2/hcQbHb7S9Y= +github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94= +github.com/miekg/dns v1.0.14/go.mod h1:W1PPwlIAgtquWBMBEV9nkV9Cazfe8ScdGz/Lj7v3Nrg= +github.com/miekg/dns v1.1.26/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/mitchellh/cli v1.0.0/go.mod h1:hNIlj7HEI86fIcpObd7a0FcrxTWetlwJDGcceTlRvqc= +github.com/mitchellh/cli v1.1.0/go.mod h1:xcISNoH86gajksDmfB23e/pu+B+GeFRMYmoHXxx3xhI= +github.com/mitchellh/go-homedir v1.0.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-homedir v1.1.0 h1:lukF9ziXFxDFPkA1vsr5zpc1XuPDn/wFntq5mG+4E0Y= +github.com/mitchellh/go-homedir v1.1.0/go.mod h1:SfyaCUpYCn1Vlf4IUYiD9fPX4A5wJrkLzIz1N1q0pr0= +github.com/mitchellh/go-testing-interface v1.0.0/go.mod h1:kRemZodwjscx+RGhAo8eIhFbs2+BFgRtFPeD/KE+zxI= +github.com/mitchellh/gox v0.4.0/go.mod h1:Sd9lOJ0+aimLBi73mGofS1ycjY8lL3uZM3JPS42BGNg= +github.com/mitchellh/iochan v1.0.0/go.mod h1:JwYml1nuB7xOzsp52dPpHFffvOCDupsG0QubkSMEySY= +github.com/mitchellh/mapstructure v0.0.0-20160808181253-ca63d7c062ee/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.1.2/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/mitchellh/mapstructure v1.4.1/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/mitchellh/mapstructure v1.4.2 h1:6h7AQ0yhTcIsmFmnAwQls75jp2Gzs4iB8W7pjMO+rqo= +github.com/mitchellh/mapstructure v1.4.2/go.mod h1:bFUtVrKA4DC2yAKiSyO/QUcy7e+RRV2QTWOzhPopBRo= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v0.0.0-20180701023420-4b7aa43c6742/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.1/go.mod h1:bx2lNnkwVCuqBIxFjflWJWanXIb3RllmbCylyMrvgv0= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/natefinch/lumberjack v2.0.0+incompatible h1:4QJd3OLAMgj7ph+yZTuX13Ld4UpgHp07nNdFX7mqFfM= +github.com/natefinch/lumberjack v2.0.0+incompatible/go.mod h1:Wi9p2TTF5DG5oU+6YfsmYQpsTIOm0B1VNzQg9Mw6nPk= +github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= +github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= +github.com/onsi/ginkgo v1.15.0/go.mod h1:hF8qUzuuC8DJGygJH3726JnCZX4MYbRB8yFfISqnKUg= +github.com/onsi/ginkgo v1.16.4/go.mod h1:dX+/inL/fNMqNlz0e9LfyB9TswhZpCVdJM/Z6Vvnwo0= +github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= +github.com/onsi/ginkgo/v2 v2.0.0/go.mod h1:vw5CSIxN1JObi/U8gcbwft7ZxR2dgaR70JSE3/PpL4c= +github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= +github.com/onsi/gomega v1.10.1/go.mod h1:iN09h71vgCQne3DLsj+A5owkum+a2tYe+TOCB1ybHNo= +github.com/onsi/gomega v1.10.5/go.mod h1:gza4q3jKQJijlu05nKWRCW/GavJumGt8aNRxWg7mt48= +github.com/onsi/gomega v1.17.0/go.mod h1:HnhC7FXeEQY45zxNK3PPoIUhzk/80Xly9PcubAlGdZY= +github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE= +github.com/onsi/gomega v1.18.1/go.mod h1:0q+aL8jAiMXy9hbwj2mr5GziHiwhAIQpFmmtT5hitRs= +github.com/pascaldekloe/goe v0.0.0-20180627143212-57f6aae5913c/go.mod h1:lzWF7FIEvWOWxwDKqyGYQf6ZUaNfKdP144TG7ZOy1lc= +github.com/pelletier/go-toml v1.9.3/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pelletier/go-toml v1.9.4 h1:tjENF6MfZAg8e4ZmZTeWaWiT2vXtsoO6+iuOjFhECwM= +github.com/pelletier/go-toml v1.9.4/go.mod h1:u1nR/EPcESfeI/szUZKdtJ0xRNbUoANCkoOuaOx1Y+c= +github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI= +github.com/posener/complete v1.2.3/go.mod h1:WZIdtGGp+qx0sLrYKtIRAruyNpv6hFCicSgv7Sy7s/s= +github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA= +github.com/robfig/cron/v3 v3.0.1 h1:WdRxkvbJztn8LMz/QEvLN5sBU+xKpSqwwUO1Pjr4qDs= +github.com/robfig/cron/v3 v3.0.1/go.mod h1:eQICP3HwyT7UooqI/z+Ov+PtYAWygg1TEWWzGIFLtro= +github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= +github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= +github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= +github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts= +github.com/sagikazarmark/crypt v0.1.0/go.mod h1:B/mN0msZuINBtQ1zZLEQcegFJJf9vnYIR88KRMEuODE= +github.com/satori/go.uuid v1.2.0 h1:0uYX9dsZ2yD7q2RtLRtPSdGDWzjeM3TbMJP9utgA0ww= +github.com/satori/go.uuid v1.2.0/go.mod h1:dA0hQrYB0VpLJoorglMZABFdXlWrHn1NEOzdhQKdks0= +github.com/sean-/seed v0.0.0-20170313163322-e2103e2c3529/go.mod h1:DxrIzT+xaE7yg65j358z/aeFdxmN0P9QXhEzd20vsDc= +github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5gKV8= +github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o= +github.com/shurcooL/sanitized_anchor_name v1.0.0/go.mod h1:1NzhyTcUVG4SuEtjjoZeVRXNmyL/1OwPU0+IJeTBvfc= +github.com/smartystreets/assertions v0.0.0-20180927180507-b2de0cb4f26d/go.mod h1:OnSkiWE9lh6wB0YB77sQom3nweQdgAjqCqsofrRNTgc= +github.com/smartystreets/goconvey v1.6.4/go.mod h1:syvi0/a8iFYH4r/RixwvyeAJjdLS9QV7WQ/tjFTllLA= +github.com/spaolacci/murmur3 v0.0.0-20180118202830-f09979ecbc72/go.mod h1:JwIasOWyU6f++ZhiEuf87xNszmSA2myDM2Kzu9HwQUA= +github.com/spf13/afero v1.6.0 h1:xoax2sJ2DT8S8xA2paPFjDCScCNeWsg75VG0DLRreiY= +github.com/spf13/afero v1.6.0/go.mod h1:Ai8FlHk4v/PARR026UzYexafAt9roJ7LcLMAmO6Z93I= +github.com/spf13/cast v1.3.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cast v1.4.1 h1:s0hze+J0196ZfEMTs80N7UlFt0BDuQ7Q+JDnHiMWKdA= +github.com/spf13/cast v1.4.1/go.mod h1:Qx5cxh0v+4UWYiBimWS+eyWzqEqokIECu5etghLkUJE= +github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw= +github.com/spf13/cobra v1.2.1/go.mod h1:ExllRjgxM/piMAM+3tAZvg8fsklGAf3tPfi+i8t68Nk= +github.com/spf13/jwalterweatherman v1.1.0 h1:ue6voC5bR5F8YxI5S67j9i582FU4Qvo2bmqnqMYADFk= +github.com/spf13/jwalterweatherman v1.1.0/go.mod h1:aNWZUN0dPAAO/Ljvb5BEdw96iTZ0EXowPYD95IqWIGo= +github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= +github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= +github.com/spf13/viper v1.8.1/go.mod h1:o0Pch8wJ9BVSWGQMbra6iw0oQ5oktSIBaujf1rJH9Ns= +github.com/spf13/viper v1.9.0 h1:yR6EXjTp0y0cLN8OZg1CRZmOBdI88UcGkhgyJhu6nZk= +github.com/spf13/viper v1.9.0/go.mod h1:+i6ajR7OX2XaiBkrcZJFK21htRk7eDeLg7+O6bhUPP4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5cxcmMvtA= +github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= +github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= +github.com/subosito/gotenv v1.2.0 h1:Slr1R9HxAlEKefgq5jn9U+DnETlIUa6HfgEzj0g5d7s= +github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw= +github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw= +github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc= +github.com/valyala/fasttemplate v1.0.1/go.mod h1:UQGH1tvbgY+Nz5t2n7tXsz52dQxojPUpymEIMZ47gx8= +github.com/valyala/fasttemplate v1.2.1 h1:TVEnxayobAdVkhQfrfes2IzOB6o+z4roRkPF52WA1u4= +github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778 h1:QldyIu/L63oPpyvQmHgvgickp1Yw510KJOqX7H24mg8= +github.com/xo/terminfo v0.0.0-20210125001918-ca9a967f8778/go.mod h1:2MuV+tbUrU1zIOPMxZ5EncGwgmMJsa+9ucAQZXxsObs= +github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +go.etcd.io/etcd/api/v3 v3.5.0/go.mod h1:cbVKeC6lCfl7j/8jBhAK6aIYO9XOjdptoxU/nLQcPvs= +go.etcd.io/etcd/client/pkg/v3 v3.5.0/go.mod h1:IJHfcCEKxYu1Os13ZdwCwIUTUVGYTSAM3YSwc9/Ac1g= +go.etcd.io/etcd/client/v2 v2.305.0/go.mod h1:h9puh54ZTgAKtEbut2oe9P4L/oqKCVB6xsXlzd7alYQ= +go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU= +go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8= +go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw= +go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk= +go.opencensus.io v0.23.0/go.mod h1:XItmlyltB5F7CS4xOC1DcqMoFqwtC6OG2xF7mCv7P7E= +go.opentelemetry.io/proto/otlp v0.7.0/go.mod h1:PqfVotwruBrMGOCsRd/89rSnXhoiJIqeYNgFYFoEGnI= +go.uber.org/atomic v1.7.0 h1:ADUqmZGgLDDfbSL9ZmPxKTybcoEYHgpYfELNoN+7hsw= +go.uber.org/atomic v1.7.0/go.mod h1:fEN4uk6kAWBTFdckzkM89CLk9XfWZrxpCo0nPH17wJc= +go.uber.org/goleak v0.10.0 h1:G3eWbSNIskeRqtsN/1uI5B+eP73y3JUuBsv9AZjehb4= +go.uber.org/goleak v0.10.0/go.mod h1:VCZuO8V8mFPlL0F5J5GK1rtHV3DrFcQ1R8ryq7FK0aI= +go.uber.org/multierr v1.6.0 h1:y6IPFStTAIT5Ytl7/XYmHvzXQ7S3g/IeZW9hyZ5thw4= +go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= +go.uber.org/zap v1.17.0 h1:MTjgFu6ZLKvY6Pvaqk97GlxNBuMpV4Hy/3P6tRGlI2U= +go.uber.org/zap v1.17.0/go.mod h1:MXVU+bhUf/A7Xi2HNOnopQOrmycQ5Ih87HtOu4q5SSo= +golang.org/x/crypto v0.0.0-20181029021203-45a5f77698d3/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20201221181555-eec23a3978ad/go.mod h1:jdWPYTVW3xRLrWPugEBEK3UY2ZEsg3UU495nc5E+M+I= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5 h1:HWj/xjIHfjYU5nVXpTM0s39J9CbLn7Cc5a7IC5rwsMQ= +golang.org/x/crypto v0.0.0-20210817164053-32db794688a5/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8= +golang.org/x/exp v0.0.0-20190829153037-c13cbed26979/go.mod h1:86+5VVa7VpoJ4kLfm080zCjGlMRFzhUhsZKEZO7MGek= +golang.org/x/exp v0.0.0-20191030013958-a1ab85dbe136/go.mod h1:JXzH8nQsPlswgeRAPE3MuO9GYsAcnJvJ4vnMwN/5qkY= +golang.org/x/exp v0.0.0-20191129062945-2f5052295587/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20191227195350-da58074b4299/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200119233911-0405dc783f0a/go.mod h1:2RIsYlXP63K8oxa1u096TMicItID8zy7Y6sNkU49FU4= +golang.org/x/exp v0.0.0-20200207192155-f17229e696bd/go.mod h1:J/WKrq2StrnmMY6+EHIKF9dgMWnmCNThgcyBT1FY9mM= +golang.org/x/exp v0.0.0-20200224162631-6cc2880d07d6/go.mod h1:3jZMyOhIsHpP37uCMkUooju7aAi5cS1Q23tOzKc+0MU= +golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js= +golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190409202823-959b441ac422/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190909230951-414d861bb4ac/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20190930215403-16217165b5de/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/lint v0.0.0-20191125180803-fdd1cda4f05f/go.mod h1:5qLYkcX4OjUUV8bRuDixDT3tpyyb+LUpUlRWLxfhWrs= +golang.org/x/lint v0.0.0-20200130185559-910be7a94367/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20200302205851-738671d3881b/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20201208152925-83fdc39ff7b5/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/lint v0.0.0-20210508222113-6edffad5e616/go.mod h1:3xt1FjdF8hUf6vQPIChWIBhFzV8gjjsPE/fR3IyQdNY= +golang.org/x/mobile v0.0.0-20190312151609-d3739f865fa6/go.mod h1:z+o9i4GpDbdi3rU15maQ/Ox0txvL9dWGYEHz965HBQE= +golang.org/x/mobile v0.0.0-20190719004257-d2bd2a29d028/go.mod h1:E/iHnbuqvinMTCcRqshq8CkpyQDoeVncDDYHnLhea+o= +golang.org/x/mod v0.0.0-20190513183733-4bf6d317e70e/go.mod h1:mXi4GBBbnImb6dmsKGUJ2LatrhH/nqhxcFungHvyanc= +golang.org/x/mod v0.1.0/go.mod h1:0QHyrYULN0/3qlju5TqG8bIK38QM8yzMo5ekMj3DlcY= +golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.1/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20181201002055-351d144fa1fc/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190501004415-9ce7a6920f09/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190503192946-f4e77d36d62c/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190628185345-da137c7871d7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190724013045-ca1201d0de80/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20191209160850-c0dbc17a3553/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200114155413-6afb5195e5aa/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200202094626-16171245cfb2/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200222125558-5a598a2470a0/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200324143707-d3edc9973b7e/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200501053045-e0ff5e5a1de5/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200506145744-7e3656a0809f/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200513185701-a91f0712d120/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/N6yyVIVM9cpaDIP3A8BGJEC5A= +golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201031054903-ff519b6c9102/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210119194325-5f4716e94777/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210316092652-d523dce5a7f4/go.mod h1:RBQZq4jEuRlivfhVLdyRGr576XBO4/greRjx4P4O3yc= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210428140749-89ef3d95e781/go.mod h1:OJAsFXCWl8Ukc7SiCT/9KSuxbyM7479/AVlXFRxuMCk= +golang.org/x/net v0.0.0-20210503060351-7fd8e65b6420/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20210913180222-943fd674d43e/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb h1:pirldcYWx7rx7kE5r+9WsOXPXK0+WH5+uZ7uPmJ44uM= +golang.org/x/net v0.0.0-20211029224645-99673261e6eb/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= +golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210220000619-9bb904979d93/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210313182246-cd4f82c27b84/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210402161424-2e8d93401602/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210514164344-f6687ab2804c/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210628180205-a41e5a781914/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210805134026-6f1e6394065a/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/oauth2 v0.0.0-20210819190943-2bc19b11175f/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20181026203630-95b1ffbd15a5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190222072716-a9d3bda3a223/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190502145724-3ef323f4f1fd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190507160741-ecd444e8653b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190606165138-5da285871e9c/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190624142023-c5567b49c5d0/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190726091711-fc99dfbffb4e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190904154756-749cb33beabd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191001151750-bb3f8db39f24/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191005200804-aed5e4c7ecf9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191204072324-ce4227a45e2e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191228213918-04cbcbbfeed8/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200113162924-86b910548bc1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200122134326-e047566fdf82/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200124204421-9fbb57f87de9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200202164722-d101bd2416d5/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200212091648-12a6c2dcc1e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200323222414-85ca7c5b95cd/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200331124033-c3d80250170d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200501052902-10377860bb8e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200511232937-7e40ca221e25/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200515095857-1151b9dac4a9/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200523222454-059865788121/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200803210538-64077c9b5642/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200905004654-be1d3432aa8f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201201145000-ef89a241ccb3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210104204734-6f8348627aad/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210112080510-489259a85091/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210119212857-b64e53b001e4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210220050731-9a76102bfb43/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210305230114-8fe3ee5dd75b/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210315160823-c6e025ad8005/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210320140829-1e4c9ba3b0c4/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210403161142-5e06dd20ab57/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210514084401-e8d321eab015/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210603125802-9665404d3644/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210616094352-59db8d763f22/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210806184541-e5e7981a1069/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210823070655-63515b42dcdf/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210910150752-751e447fb3d0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9 h1:XfKQ4OlFl8okEOr5UvAqFRVj8pY/4yfcXrddB8qAbU0= +golang.org/x/sys v0.0.0-20220114195835-da31bd327af9/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201117132131-f5c789dd3221/go.mod h1:Nr5EML6q2oocZ2LXRh80K7BxOlk5/8JxuGnuhpl+muw= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7 h1:olpwvP2KacW1ZWvsR7uQhoyTYvKAupfQrRGBFM352Gk= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= +golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324 h1:Hir2P/De0WpUhtrKGGjvSb2YxUgyZ7EFOSLIcSSpiwE= +golang.org/x/time v0.0.0-20201208040808-7e3f01d25324/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312151545-0bb0c0a6e846/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190425150028-36563e24a262/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190506145303-2d16b83fe98c/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +golang.org/x/tools v0.0.0-20190606124116-d0a3d012864b/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190621195816-6e04913cbbac/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190628153133-6cdbf07be9d0/go.mod h1:/rFqwRUd4F7ZHNgwSSTFct+R/Kf4OFW1sUzUTQQTgfc= +golang.org/x/tools v0.0.0-20190816200558-6889da9d5479/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20190911174233-4f2ddba30aff/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191012152004-8de300cfc20a/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191112195655-aa38f8e97acc/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191113191852-77e3bb0ad9e7/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191115202509-3a792d9c32b2/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191125144606-a911d9008d1f/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191130070609-6e064ea0cf2d/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191216173652-a0e659d51361/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20191227053925-7b8e75db28f4/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200117161641-43d50277825c/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200122220014-bf1340f18c4a/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200130002326-2f3ba24bd6e7/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200204074204-1cc6d1ef6c74/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200212150539-ea181f53ac56/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200224181240-023911ca70b2/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200227222343-706bc42d1f0d/go.mod h1:TB2adYChydJhpapKDTa4BR/hXlZSLoq2Wpct/0txZ28= +golang.org/x/tools v0.0.0-20200304193943-95d2e580d8eb/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200312045724-11d5b4c81c7d/go.mod h1:o4KQGtdN14AW+yjsvvwRTJJuXz8XRtIHtEnmAXLyFUw= +golang.org/x/tools v0.0.0-20200331025713-a30bf2db82d4/go.mod h1:Sl4aGygMT6LrqrWclx+PTx3U+LnKx/seiNR+3G19Ar8= +golang.org/x/tools v0.0.0-20200501065659-ab2804fb9c9d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200512131952-2bc93b1c0c88/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200515010526-7d3b6ebf133d/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA= +golang.org/x/tools v0.0.0-20200904185747-39188db58858/go.mod h1:Cj7w3i3Rnn0Xh82ur9kSqwfTHTeVxaDqrfMjpcNT6bE= +golang.org/x/tools v0.0.0-20201110124207-079ba7bd75cd/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201201161351-ac6f37ff4c2a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201208233053-a543418bbed2/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20201224043029-2b0845dc783e/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210105154028-b0ab187a4818/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/tools v0.1.0/go.mod h1:xkSsbof2nBLbhDlRMhhhyNLN/zl3eTqcnHD5viDpcZ0= +golang.org/x/tools v0.1.1/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.3/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.4/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.5/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1 h1:go1bK/D/BFZV2I8cIQd1NKEZ+0owSTG1fDTci4IqFcE= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE= +google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M= +google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.9.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg= +google.golang.org/api v0.13.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.14.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.15.0/go.mod h1:iLdEw5Ide6rF15KTC1Kkl0iskquN2gFfn9o9XIsbkAI= +google.golang.org/api v0.17.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.18.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.19.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.20.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.22.0/go.mod h1:BwFmGc8tA3vsd7r/7kR8DY7iEEGSU04BFxCo5jP/sfE= +google.golang.org/api v0.24.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.28.0/go.mod h1:lIXQywCXRcnZPGlsd8NbLnOjtAoL6em04bJ9+z0MncE= +google.golang.org/api v0.29.0/go.mod h1:Lcubydp8VUV7KeIHD9z2Bys/sm/vGKnG1UHuDBSrHWM= +google.golang.org/api v0.30.0/go.mod h1:QGmEvQ87FHZNiUVJkT14jQNYJ4ZJjdRF23ZXz5138Fc= +google.golang.org/api v0.35.0/go.mod h1:/XrVsuzM0rZmrsbjJutiuftIzeuTQcEeaYcSk/mQ1dg= +google.golang.org/api v0.36.0/go.mod h1:+z5ficQTmoYpPn8LCUNVpK5I7hwkpjbcgqA7I34qYtE= +google.golang.org/api v0.40.0/go.mod h1:fYKFpnQN0DsDSKRVRcQSDQNtqWPfM9i+zNPxepjRCQ8= +google.golang.org/api v0.41.0/go.mod h1:RkxM5lITDfTzmyKFPt+wGrCJbVfniCr2ool8kTBzRTU= +google.golang.org/api v0.43.0/go.mod h1:nQsDGjRXMo4lvh5hP0TKqF244gqhGcr/YSIykhUk/94= +google.golang.org/api v0.44.0/go.mod h1:EBOGZqzyhtvMDoxwS97ctnh0zUmYY6CxqXsc1AvkYD8= +google.golang.org/api v0.47.0/go.mod h1:Wbvgpq1HddcWVtzsVLyfLp8lDg6AA241LmgIL59tHXo= +google.golang.org/api v0.48.0/go.mod h1:71Pr1vy+TAZRPkPs/xlCf5SsU8WjuAWv1Pfjbtukyy4= +google.golang.org/api v0.50.0/go.mod h1:4bNT5pAuq5ji4SRZm+5QIkjny9JAyVD/3gaSihNefaw= +google.golang.org/api v0.51.0/go.mod h1:t4HdrdoNgyN5cbEfm7Lum0lcLDLiise1F8qDKX00sOU= +google.golang.org/api v0.54.0/go.mod h1:7C4bFFOvVDGXjfDTAsgGwDgAxRDeQ4X8NvUedIt6z3k= +google.golang.org/api v0.56.0/go.mod h1:38yMfeP1kfjsl8isn0tliTjIb1rJXcQi4UXlbqivdVE= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190425155659-357c62f0e4bb/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190502173448-54afdca5d873/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/genproto v0.0.0-20190801165951-fa694d86fc64/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190819201941-24fa4b261c55/go.mod h1:DMBHOl98Agz4BDEuKkezgsaosCRResVns1a3J2ZsMNc= +google.golang.org/genproto v0.0.0-20190911173649-1774047e7e51/go.mod h1:IbNlFCBrqXvoKpeg0TB2l7cyZUmoaFKYIwrEpbDKLA8= +google.golang.org/genproto v0.0.0-20191108220845-16a3f7862a1a/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191115194625-c23dd37a84c9/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191216164720-4f79533eabd1/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20191230161307-f3c370f40bfb/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200115191322-ca5a22157cba/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200122232147-0452cf42e150/go.mod h1:n3cpQtvxv34hfy77yVDNjmbRyujviMdxYliBSkLhpCc= +google.golang.org/genproto v0.0.0-20200204135345-fa8e72b47b90/go.mod h1:GmwEX6Z4W5gMy59cAlVYjN9JhxgbQH6Gn+gFDQe2lzA= +google.golang.org/genproto v0.0.0-20200212174721-66ed5ce911ce/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200224152610-e50cd9704f63/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200228133532-8c2c7df3a383/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200305110556-506484158171/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200312145019-da6875a35672/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200331122359-1ee6d9798940/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200430143042-b979b6f78d84/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200511104702-f5ebc3bea380/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200513103714-09dca8ec2884/go.mod h1:55QSHmfGQM9UVYDPBsyGGes0y52j32PQ3BqQfXhyH3c= +google.golang.org/genproto v0.0.0-20200515170657-fc4c6c6a6587/go.mod h1:YsZOwe1myG/8QRHRsmBRE1LrgQY60beZKjly0O1fX9U= +google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013/go.mod h1:NbSheEEYHJ7i3ixzK3sjbqSGDJWnxyFXZblF3eUsNvo= +google.golang.org/genproto v0.0.0-20200618031413-b414f8b61790/go.mod h1:jDfRM7FcilCzHH/e9qn6dsT145K34l5v+OpcnNgKAAA= +google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20200904004341-0bd0a958aa1d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201109203340-2640f1f9cdfb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201201144952-b05cb90ed32e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210222152913-aa3ee6e6a81c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210303154014-9728d6b83eeb/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210310155132-4ce2db91004e/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210319143718-93e7006c17a6/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no= +google.golang.org/genproto v0.0.0-20210402141018-6c239bbf2bb1/go.mod h1:9lPAdzaEmUacj36I+k7YKbEc5CXzPIeORRgDAUOu28A= +google.golang.org/genproto v0.0.0-20210513213006-bf773b8c8384/go.mod h1:P3QM42oQyzQSnHPnZ/vqoCdDmzH28fzWByN9asMeM8A= +google.golang.org/genproto v0.0.0-20210602131652-f16073e35f0c/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210604141403-392c879c8b08/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210608205507-b6d2f5bf0d7d/go.mod h1:UODoCrxHCcBojKKwX1terBiRUaqAsFqJiF615XL43r0= +google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84/go.mod h1:SzzZ/N+nwJDaO1kznhnlzqS8ocJICar6hYhVyhi++24= +google.golang.org/genproto v0.0.0-20210713002101-d411969a0d9a/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210716133855-ce7ef5c701ea/go.mod h1:AxrInvYm1dci+enl5hChSFPOmmUF1+uAa/UsgNRWd7k= +google.golang.org/genproto v0.0.0-20210728212813-7823e685a01f/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210805201207-89edb61ffb67/go.mod h1:ob2IJxKrgPT52GcgX759i1sleT07tiKowYBGbczaW48= +google.golang.org/genproto v0.0.0-20210813162853-db860fec028c/go.mod h1:cFeNkxwySK631ADgubI+/XFU/xp8FD5KIVV4rj8UC5w= +google.golang.org/genproto v0.0.0-20210821163610-241b8fcbd6c8/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/genproto v0.0.0-20210828152312-66f60bf46e71/go.mod h1:eFjDcFEctNawg4eG61bRv87N7iHBWyVhJu7u1kqDUXY= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38= +google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +google.golang.org/grpc v1.25.1/go.mod h1:c3i+UQWmh7LiEpx4sFZnkU36qjEYZ0imhYfXVyQciAY= +google.golang.org/grpc v1.26.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.0/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.27.1/go.mod h1:qbnxyOmOxrQa7FizSgH+ReBfzJrCY1pSN7KXBS8abTk= +google.golang.org/grpc v1.28.0/go.mod h1:rpkK4SK4GF4Ach/+MFLZUBavHOvF2JJB5uozKKal+60= +google.golang.org/grpc v1.29.1/go.mod h1:itym6AZVZYACWQqET3MqgPpjcuV5QH3BxFS3IjizoKk= +google.golang.org/grpc v1.30.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.0/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM8pak= +google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTpR3n0= +google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc= +google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8= +google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.36.1/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU= +google.golang.org/grpc v1.37.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.37.1/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.38.0/go.mod h1:NREThFqKR1f3iQ6oBuvc5LadQuXVGo9rkm5ZGrQdJfM= +google.golang.org/grpc v1.39.0/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.39.1/go.mod h1:PImNr+rS9TWYb2O4/emRugxiyHZ5JyHW5F+RPnDzfrE= +google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34= +google.golang.org/grpc/cmd/protoc-gen-go-grpc v1.1.0/go.mod h1:6Kw0yEErY5E/yWrBtf03jp27GLLJujG4z/JK95pnjjw= +google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8= +google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0= +google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM= +google.golang.org/protobuf v1.20.1-0.20200309200217-e05f789c0967/go.mod h1:A+miEFZTKqfCUM6K7xSMQL9OKL/b6hQv+e19PK+JZNE= +google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzikPIcrTAo= +google.golang.org/protobuf v1.22.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= +google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4= +google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c= +google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= +google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +google.golang.org/protobuf v1.27.1 h1:SnqbnDw1V7RiZcXPx5MEeqPv2s79L9i7BJUlG/+RurQ= +google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= +gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/ini.v1 v1.62.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/ini.v1 v1.63.2 h1:tGK/CyBg7SMzb60vP1M03vNZ3VDu3wGQJwn7Sxi9r3c= +gopkg.in/ini.v1 v1.63.2/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k= +gopkg.in/natefinch/lumberjack.v2 v2.0.0 h1:1Lc07Kr7qY4U2YPouBjpCLxpiyxIVoxqXgkXLknAOE8= +gopkg.in/natefinch/lumberjack.v2 v2.0.0/go.mod h1:l0ndWWf7gzL7RNwBG7wST/UCcT4T24xpD6X8LsfU/+k= +gopkg.in/telebot.v3 v3.0.0 h1:UgHIiE/RdjoDi6nf4xACM7PU3TqiPVV9vvTydCEnrTo= +gopkg.in/telebot.v3 v3.0.0/go.mod h1:7rExV8/0mDDNu9epSrDm/8j22KLaActH1Tbee6YjzWg= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.4/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gorm.io/driver/mysql v1.1.2 h1:OofcyE2lga734MxwcCW9uB4mWNXMr50uaGRVwQL2B0M= +gorm.io/driver/mysql v1.1.2/go.mod h1:4P/X9vSc3WTrhTLZ259cpFd6xKNYiSSdSZngkSBGIMM= +gorm.io/gorm v1.21.12/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +gorm.io/gorm v1.21.15 h1:gAyaDoPw0lCyrSFWhBlahbUA1U4P5RViC1uIqoB+1Rk= +gorm.io/gorm v1.21.15/go.mod h1:F+OptMscr0P2F2qU97WT1WimdH9GaQPoDW7AYd5i2Y0= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190418001031-e561f6794a2a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.1-2019.2.3/go.mod h1:a3bituU0lyd329TUQxRnasdCoJDkEUEAqEt0JzvZhAg= +honnef.co/go/tools v0.0.1-2020.1.3/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +honnef.co/go/tools v0.0.1-2020.1.4/go.mod h1:X/FiERA/W4tHapMX5mGpAtMSVEeEUOyHaw9vFzvIQ3k= +rsc.io/binaryregexp v0.2.0/go.mod h1:qTv7/COck+e2FymRvadv62gMdZztPaShugOCi3I+8D8= +rsc.io/quote/v3 v3.1.0/go.mod h1:yEA65RcK8LyAZtP9Kv3t0HmxON59tX3rD+tICJqUlj0= +rsc.io/sampler v1.3.0/go.mod h1:T1hPZKmBbMNahiBKFy5HrXp6adAjACjK9JXDnKaTXpA= diff --git a/src/main.go b/src/main.go new file mode 100644 index 0000000..c661bc3 --- /dev/null +++ b/src/main.go @@ -0,0 +1,18 @@ +package main + +import ( + "github.com/assimon/luuu/bootstrap" + "github.com/assimon/luuu/config" + "github.com/gookit/color" +) + +func main() { + defer func() { + if err := recover(); err != nil { + color.Error.Println("[Start Server Err!!!] ", err) + } + }() + color.Green.Printf("%s\n", " _____ _ _ \n | ____|_ __ _ _ ___ __| | |_ \n | _| | '_ \\| | | / __|/ _` | __|\n | |___| |_) | |_| \\__ \\ (_| | |_ \n |_____| .__/ \\__,_|___/\\__,_|\\__|\n |_| ") + color.Infof("Epusdt version(%s) Powered by %s %s \n", config.GetAppVersion(), "assimon", "https://github.com/assimon/epusdt") + bootstrap.Start() +} diff --git a/src/middleware/check_sign.go b/src/middleware/check_sign.go new file mode 100644 index 0000000..2598bdc --- /dev/null +++ b/src/middleware/check_sign.go @@ -0,0 +1,37 @@ +package middleware + +import ( + "bytes" + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/util/constant" + "github.com/assimon/luuu/util/json" + "github.com/assimon/luuu/util/sign" + "github.com/labstack/echo/v4" + "io/ioutil" +) + +func CheckApiSign() echo.MiddlewareFunc { + return func(next echo.HandlerFunc) echo.HandlerFunc { + return func(ctx echo.Context) error { + params, err := ioutil.ReadAll(ctx.Request().Body) + if err != nil { + return constant.SignatureErr + } + m := make(map[string]interface{}) + err = json.Cjson.Unmarshal(params, &m) + signature, ok := m["signature"] + if !ok { + return constant.SignatureErr + } + checkSignature, err := sign.Get(m, config.GetApiAuthToken()) + if err != nil { + return constant.SignatureErr + } + if checkSignature != signature { + return constant.SignatureErr + } + ctx.Request().Body = ioutil.NopCloser(bytes.NewBuffer(params)) + return next(ctx) + } + } +} diff --git a/src/middleware/request_id.go b/src/middleware/request_id.go new file mode 100644 index 0000000..a40baea --- /dev/null +++ b/src/middleware/request_id.go @@ -0,0 +1,18 @@ +package middleware + +import ( + "github.com/labstack/echo/v4" + "github.com/labstack/echo/v4/middleware" + uuid "github.com/satori/go.uuid" +) + +func RequestUUID() echo.MiddlewareFunc { + return middleware.RequestIDWithConfig(middleware.RequestIDConfig{ + Generator: func() string { + return uuid.NewV4().String() + }, + RequestIDHandler: func(c echo.Context, s string) { + c.Request().Header.Set(echo.HeaderXRequestID, s) + }, + }) +} diff --git a/src/model/dao/mdb.go b/src/model/dao/mdb.go new file mode 100644 index 0000000..4078236 --- /dev/null +++ b/src/model/dao/mdb.go @@ -0,0 +1,47 @@ +package dao + +import ( + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/util/log" + "github.com/gookit/color" + "github.com/spf13/viper" + "gorm.io/driver/mysql" + "gorm.io/gorm" + "gorm.io/gorm/logger" + "gorm.io/gorm/schema" + "time" +) + +var Mdb *gorm.DB + +// MysqlInit 数据库初始化 +func MysqlInit() { + var err error + Mdb, err = gorm.Open(mysql.Open(config.MysqlDns), &gorm.Config{ + NamingStrategy: schema.NamingStrategy{ + TablePrefix: viper.GetString("mysql_table_prefix"), + SingularTable: true, + }, + Logger: logger.Default.LogMode(logger.Error), + }) + if err != nil { + panic(err) + } + if config.AppDebug { + Mdb = Mdb.Debug() + } + sqlDB, err := Mdb.DB() + if err != nil { + color.Red.Printf("[store_db] mysql get DB,err=%s\n", err) + panic(err) + } + sqlDB.SetMaxIdleConns(viper.GetInt("mysql_max_idle_conns")) + sqlDB.SetMaxOpenConns(viper.GetInt("mysql_max_open_conns")) + sqlDB.SetConnMaxLifetime(time.Hour * time.Duration(viper.GetInt("mysql_max_life_time"))) + err = sqlDB.Ping() + if err != nil { + color.Red.Printf("[store_db] mysql connDB err:%s", err.Error()) + panic(err) + } + log.Sugar.Debug("[store_db] mysql connDB success") +} diff --git a/src/model/dao/rdb.go b/src/model/dao/rdb.go new file mode 100644 index 0000000..f979286 --- /dev/null +++ b/src/model/dao/rdb.go @@ -0,0 +1,41 @@ +package dao + +import ( + "context" + "fmt" + "github.com/assimon/luuu/util/log" + "github.com/go-redis/redis/v8" + "github.com/gookit/color" + "github.com/spf13/viper" + "time" +) + +var Rdb *redis.Client + +func RedisInit() { + options := redis.Options{ + Addr: fmt.Sprintf( + "%s:%s", + viper.GetString("redis_host"), + viper.GetString("redis_port")), // Redis地址 + DB: viper.GetInt("redis_db"), // Redis库 + PoolSize: viper.GetInt("redis_pool_size"), // Redis连接池大小 + MaxRetries: viper.GetInt("redis_max_retries"), // 最大重试次数 + IdleTimeout: time.Second * time.Duration(viper.GetInt("redis_idle_timeout")), // 空闲链接超时时间 + } + if viper.GetString("redis_passwd") != "" { + options.Password = viper.GetString("redis_passwd") + } + Rdb = redis.NewClient(&options) + ctx, cancel := context.WithTimeout(context.Background(), 5*time.Second) + defer cancel() + pong, err := Rdb.Ping(ctx).Result() + if err == redis.Nil { + log.Sugar.Debug("[store_redis] Nil reply returned by Rdb when key does not exist.") + } else if err != nil { + color.Red.Printf("[store_redis] redis connRdb err,err=%s", err) + panic(err) + } else { + log.Sugar.Debug("[store_redis] redis connRdb success,suc=%s", pong) + } +} diff --git a/src/model/data/order_data.go b/src/model/data/order_data.go new file mode 100644 index 0000000..8a25b00 --- /dev/null +++ b/src/model/data/order_data.go @@ -0,0 +1,130 @@ +package data + +import ( + "context" + "fmt" + "github.com/assimon/luuu/model/dao" + "github.com/assimon/luuu/model/mdb" + "github.com/assimon/luuu/model/request" + "github.com/go-redis/redis/v8" + "gorm.io/gorm" +) + +var ( + CacheWalletAddressToAvailableAmountKey = "WalletAddressToAvailableAmountKey:" // 钱包 - 可用金额 - 过期时间 + CacheWalletAddressToOrdersKey = "WalletAddressToOrdersKey:" // 钱包 - 待支付金额 - 订单号 +) + +// GetOrderInfoByOrderId 通过客户订单号查询订单 +func GetOrderInfoByOrderId(orderId string) (*mdb.Orders, error) { + order := new(mdb.Orders) + err := dao.Mdb.Model(order).Limit(1).Find(order, "order_id = ?", orderId).Error + return order, err +} + +// GetOrderInfoByTradeId 通过交易号查询订单 +func GetOrderInfoByTradeId(tradeId string) (*mdb.Orders, error) { + order := new(mdb.Orders) + err := dao.Mdb.Model(order).Limit(1).Find(order, "trade_id = ?", tradeId).Error + return order, err +} + +// CreateOrderWithTransaction 事务创建订单 +func CreateOrderWithTransaction(tx *gorm.DB, order *mdb.Orders) error { + err := tx.Model(order).Create(order).Error + return err +} + +// GetOrderByBlockIdWithTransaction 通过区块获取订单 +func GetOrderByBlockIdWithTransaction(tx *gorm.DB, blockId string) (*mdb.Orders, error) { + order := new(mdb.Orders) + err := tx.Model(order).Limit(1).Find(order, "block_transaction_id = ?", blockId).Error + return order, err +} + +// OrderSuccessWithTransaction 事务支付成功 +func OrderSuccessWithTransaction(tx *gorm.DB, req *request.OrderProcessingRequest) error { + err := tx.Model(&mdb.Orders{}).Where("trade_id = ?", req.TradeId).Updates(map[string]interface{}{ + "block_transaction_id": req.BlockTransactionId, + "status": mdb.StatusPaySuccess, + "callback_confirm": mdb.CallBackConfirmNo, + }).Error + return err +} + +// GetPendingCallbackOrders 查询出等待回调的订单 +func GetPendingCallbackOrders() ([]mdb.Orders, error) { + var orders []mdb.Orders + err := dao.Mdb.Model(orders). + Where("callback_num < ?", 5). + Where("callback_confirm = ?", mdb.CallBackConfirmNo). + Where("status = ?", mdb.StatusPaySuccess). + Find(&orders).Error + return orders, err +} + +// SaveCallBackOrdersResp 保存订单回调结果 +func SaveCallBackOrdersResp(order *mdb.Orders) error { + err := dao.Mdb.Model(order).Where("id = ?", order.ID).Updates(map[string]interface{}{ + "callback_num": gorm.Expr("callback_num + ?", 1), + "callback_confirm": order.CallBackConfirm, + }).Error + return err +} + +// UpdateOrderIsExpirationById 通过id设置订单过期 +func UpdateOrderIsExpirationById(id uint64) error { + err := dao.Mdb.Model(mdb.Orders{}).Where("id = ?", id).Update("status", mdb.StatusExpired).Error + return err +} + +// LockPayCache 锁定支付池 +func LockPayCache(token, tradeId, amount string, expirationTime int64) error { + // 载入Redis + ctx := context.Background() + pipe := dao.Rdb.TxPipeline() + lockAvailableAmountKey := fmt.Sprintf("%s%s", CacheWalletAddressToAvailableAmountKey, token) + // 占用金额 + pipe.HSet(ctx, lockAvailableAmountKey, amount, expirationTime) + // 标记金额对应订单号 + lockWalletOrdersKey := fmt.Sprintf("%s%s", CacheWalletAddressToOrdersKey, token) + pipe.HSet(ctx, lockWalletOrdersKey, amount, tradeId) + _, err := pipe.Exec(ctx) + return err +} + +// ClearPayCache 清理支付池 +func ClearPayCache(token, amount string) error { + ctx := context.Background() + lockAvailableAmountKey := fmt.Sprintf("%s%s", CacheWalletAddressToAvailableAmountKey, token) + lockWalletOrdersKey := fmt.Sprintf("%s%s", CacheWalletAddressToOrdersKey, token) + pipe := dao.Rdb.TxPipeline() + pipe.HDel(ctx, lockAvailableAmountKey, amount) + pipe.HDel(ctx, lockWalletOrdersKey, amount) + _, err := pipe.Exec(ctx) + return err +} + +func GetTradeIdByAmount(ctx context.Context, token, amount string) (string, error) { + cacheKey := fmt.Sprintf("%s%s", CacheWalletAddressToOrdersKey, token) + result, err := dao.Rdb.HGet(ctx, cacheKey, amount).Result() + if err == redis.Nil { + return "", nil + } + if err != nil { + return "", err + } + return result, nil +} + +func GetExpirationTimeByAmount(ctx context.Context, token, amount string) (string, error) { + cacheKey := fmt.Sprintf("%s%s", CacheWalletAddressToAvailableAmountKey, token) + result, err := dao.Rdb.HGet(ctx, cacheKey, amount).Result() + if err == redis.Nil { + return "", nil + } + if err != nil { + return "", err + } + return result, nil +} diff --git a/src/model/data/wallet_address_data.go b/src/model/data/wallet_address_data.go new file mode 100644 index 0000000..eea107f --- /dev/null +++ b/src/model/data/wallet_address_data.go @@ -0,0 +1,64 @@ +package data + +import ( + "github.com/assimon/luuu/model/dao" + "github.com/assimon/luuu/model/mdb" + "github.com/assimon/luuu/util/constant" +) + +// AddWalletAddress 创建钱包 +func AddWalletAddress(token string) (*mdb.WalletAddress, error) { + exist, err := GetWalletAddressByToken(token) + if err != nil { + return nil, err + } + if exist.ID > 0 { + return nil, constant.WalletAddressAlreadyExists + } + walletAddress := &mdb.WalletAddress{ + Token: token, + Status: mdb.TokenStatusEnable, + } + err = dao.Mdb.Create(walletAddress).Error + return walletAddress, err +} + +// GetWalletAddressByToken 通过钱包地址获取token +func GetWalletAddressByToken(token string) (*mdb.WalletAddress, error) { + walletAddress := new(mdb.WalletAddress) + err := dao.Mdb.Model(walletAddress).Limit(1).Find(walletAddress, "token = ?", token).Error + return walletAddress, err +} + +// GetWalletAddressById 通过id获取钱包 +func GetWalletAddressById(id uint64) (*mdb.WalletAddress, error) { + walletAddress := new(mdb.WalletAddress) + err := dao.Mdb.Model(walletAddress).Limit(1).Find(walletAddress, id).Error + return walletAddress, err +} + +// DeleteWalletAddressById 通过id删除钱包 +func DeleteWalletAddressById(id uint64) error { + err := dao.Mdb.Where("id = ?", id).Delete(&mdb.WalletAddress{}).Error + return err +} + +// GetAvailableWalletAddress 获得所有可用的钱包地址 +func GetAvailableWalletAddress() ([]mdb.WalletAddress, error) { + var WalletAddressList []mdb.WalletAddress + err := dao.Mdb.Model(WalletAddressList).Where("status = ?", mdb.TokenStatusEnable).Find(&WalletAddressList).Error + return WalletAddressList, err +} + +// GetAllWalletAddress 获得所有钱包地址 +func GetAllWalletAddress() ([]mdb.WalletAddress, error) { + var WalletAddressList []mdb.WalletAddress + err := dao.Mdb.Model(WalletAddressList).Find(&WalletAddressList).Error + return WalletAddressList, err +} + +// ChangeWalletAddressStatus 启用禁用钱包 +func ChangeWalletAddressStatus(id uint64, status int) error { + err := dao.Mdb.Model(&mdb.WalletAddress{}).Where("id = ?", id).Update("status", status).Error + return err +} diff --git a/src/model/mdb/base.go b/src/model/mdb/base.go new file mode 100644 index 0000000..00bf4e0 --- /dev/null +++ b/src/model/mdb/base.go @@ -0,0 +1,13 @@ +package mdb + +import ( + "github.com/golang-module/carbon/v2" + "gorm.io/gorm" +) + +type BaseModel struct { + ID uint64 `gorm:"column:id;primary_key" json:"id"` + CreatedAt carbon.Time `gorm:"column:created_at" json:"created_at"` + UpdatedAt carbon.Time `gorm:"column:updated_at" json:"updated_at"` + DeletedAt gorm.DeletedAt `gorm:"index" json:"deleted_at"` +} diff --git a/src/model/mdb/orders_mdb.go b/src/model/mdb/orders_mdb.go new file mode 100644 index 0000000..3ff0f8c --- /dev/null +++ b/src/model/mdb/orders_mdb.go @@ -0,0 +1,29 @@ +package mdb + +const ( + StatusWaitPay = 1 + StatusPaySuccess = 2 + StatusExpired = 3 + CallBackConfirmOk = 1 + CallBackConfirmNo = 2 +) + +type Orders struct { + TradeId string `gorm:"column:trade_id" json:"trade_id"` // epusdt订单号 + OrderId string `gorm:"column:order_id" json:"order_id"` // 客户交易id + BlockTransactionId string `gorm:"column:block_transaction_id" json:"block_transaction_id"` // 区块id + Amount float64 `gorm:"column:amount" json:"amount"` // 订单金额,保留4位小数 + ActualAmount float64 `gorm:"column:actual_amount" json:"actual_amount"` // 订单实际需要支付的金额,保留4位小数 + Token string `gorm:"column:token" json:"token"` // 所属钱包地址 + Status int `gorm:"column:status" json:"status"` // 1:等待支付,2:支付成功,3:已过期 + NotifyUrl string `gorm:"column:notify_url" json:"notify_url"` // 异步回调地址 + RedirectUrl string `gorm:"column:redirect_url" json:"redirect_url"` // 同步回调地址 + CallbackNum int `gorm:"column:callback_num" json:"callback_num"` // 回调次数 + CallBackConfirm int `gorm:"column:callback_confirm" json:"callback_confirm"` // 回调是否已确认 1是 2否 + BaseModel +} + +// TableName sets the insert table name for this struct type +func (o *Orders) TableName() string { + return "orders" +} diff --git a/src/model/mdb/wallet_address_mdb.go b/src/model/mdb/wallet_address_mdb.go new file mode 100644 index 0000000..e67a8ee --- /dev/null +++ b/src/model/mdb/wallet_address_mdb.go @@ -0,0 +1,18 @@ +package mdb + +const ( + TokenStatusEnable = 1 + TokenStatusDisable = 2 +) + +// WalletAddress 钱包表 +type WalletAddress struct { + Token string `gorm:"column:token" json:"token"` // 钱包token + Status int64 `gorm:"column:status" json:"status"` // 1:启用 2:禁用 + BaseModel +} + +// TableName sets the insert table name for this struct type +func (w *WalletAddress) TableName() string { + return "wallet_address" +} diff --git a/src/model/request/base.go b/src/model/request/base.go new file mode 100644 index 0000000..d49c51e --- /dev/null +++ b/src/model/request/base.go @@ -0,0 +1,15 @@ +package request + +const ( + OrderByFuncDesc = "DESC" + OrderByFuncAsc = "OrderByFuncASC" +) + +var OrderByFuncList = []string{OrderByFuncDesc, OrderByFuncAsc} + +type BaseRequest struct { + Page int `json:"page"` // 页数 + PageSize int `json:"page_size"` // 每页条数 + OrderField string `json:"order_field"` // 排序字段 + OrderFunc string `json:"order_func"` // 排序方法 +} diff --git a/src/model/request/order_request.go b/src/model/request/order_request.go new file mode 100644 index 0000000..4df1eda --- /dev/null +++ b/src/model/request/order_request.go @@ -0,0 +1,29 @@ +package request + +import "github.com/gookit/validate" + +// CreateTransactionRequest 创建交易请求 +type CreateTransactionRequest struct { + OrderId string `json:"order_id" validate:"required|maxLen:32"` + Amount float64 `json:"amount" validate:"required|isFloat|gt:0.01"` + NotifyUrl string `json:"notify_url" validate:"required"` + Signature string `json:"signature" validate:"required"` + RedirectUrl string `json:"redirect_url"` +} + +func (r CreateTransactionRequest) Translates() map[string]string { + return validate.MS{ + "OrderId": "订单号", + "Amount": "支付金额", + "NotifyUrl": "异步回调网址", + "Signature": "签名", + } +} + +// OrderProcessingRequest 订单处理 +type OrderProcessingRequest struct { + Token string + Amount string + TradeId string + BlockTransactionId string +} diff --git a/src/model/response/order_response.go b/src/model/response/order_response.go new file mode 100644 index 0000000..0bb18c9 --- /dev/null +++ b/src/model/response/order_response.go @@ -0,0 +1,24 @@ +package response + +// CreateTransactionResponse 创建订单成功返回 +type CreateTransactionResponse struct { + TradeId string `json:"trade_id"` // epusdt订单号 + OrderId string `json:"order_id"` // 客户交易id + Amount float64 `json:"amount"` // 订单金额,保留4位小数 + ActualAmount float64 `json:"actual_amount"` // 订单实际需要支付的金额,保留4位小数 + Token string `json:"token"` // 收款钱包地址 + ExpirationTime int64 `json:"expiration_time"` // 过期时间 时间戳 + PaymentUrl string `json:"payment_url"` // 收银台地址 +} + +// OrderNotifyResponse 订单异步回调结构体 +type OrderNotifyResponse struct { + TradeId string `json:"trade_id"` // epusdt订单号 + OrderId string `json:"order_id"` // 客户交易id + Amount float64 `json:"amount"` // 订单金额,保留4位小数 + ActualAmount float64 `json:"actual_amount"` // 订单实际需要支付的金额,保留4位小数 + Token string `json:"token"` // 收款钱包地址 + BlockTransactionId string `json:"block_transaction_id"` // 区块id + Signature string `json:"signature"` // 签名 + Status int `json:"status"` // 1:等待支付,2:支付成功,3:已过期 +} diff --git a/src/model/response/pay_response.go b/src/model/response/pay_response.go new file mode 100644 index 0000000..7d12e56 --- /dev/null +++ b/src/model/response/pay_response.go @@ -0,0 +1,14 @@ +package response + +type CheckoutCounterResponse struct { + TradeId string `json:"trade_id"` // epusdt订单号 + ActualAmount float64 `json:"actual_amount"` // 订单实际需要支付的金额,保留4位小数 + Token string `json:"token"` // 收款钱包地址 + ExpirationTime int64 `json:"expiration_time"` // 过期时间 时间戳 + RedirectUrl string `json:"redirect_url"` +} + +type CheckStatusResponse struct { + TradeId string `json:"trade_id"` // epusdt订单号 + Status int `json:"status"` +} diff --git a/src/model/service/order_service.go b/src/model/service/order_service.go new file mode 100644 index 0000000..46ad79d --- /dev/null +++ b/src/model/service/order_service.go @@ -0,0 +1,230 @@ +package service + +import ( + "context" + "fmt" + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/model/dao" + "github.com/assimon/luuu/model/data" + "github.com/assimon/luuu/model/mdb" + "github.com/assimon/luuu/model/request" + "github.com/assimon/luuu/model/response" + "github.com/assimon/luuu/mq" + "github.com/assimon/luuu/mq/handle" + "github.com/assimon/luuu/telegram" + "github.com/assimon/luuu/util/constant" + "github.com/golang-module/carbon/v2" + "github.com/gookit/goutil/mathutil" + "github.com/hibiken/asynq" + "github.com/shopspring/decimal" + "math/rand" + "strconv" + "sync" + "time" +) + +var gCreateTransactionLock sync.Mutex + +// CreateTransaction 创建订单 +func CreateTransaction(req *request.CreateTransactionRequest) (*response.CreateTransactionResponse, error) { + gCreateTransactionLock.Lock() + defer gCreateTransactionLock.Unlock() + // 汇率计算金额 + rmb := decimal.NewFromFloat(req.Amount) + rate := decimal.NewFromFloat(config.GetUsdtRate()) + amount := rmb.Div(rate).InexactFloat64() + actualAmountStr := fmt.Sprintf("%.4f", amount) + actualAmountFloat, err := strconv.ParseFloat(actualAmountStr, 64) + if err != nil { + return nil, err + } + // 是否可以满足最低支付金额 + if actualAmountFloat <= 0 { + return nil, constant.PayAmountErr + } + // 已经存在了的交易 + exist, err := data.GetOrderInfoByOrderId(req.OrderId) + if err != nil { + return nil, err + } + if exist.ID > 0 { + return nil, constant.OrderAlreadyExists + } + // 有无可用钱包 + walletAddress, err := data.GetAvailableWalletAddress() + if err != nil { + return nil, err + } + if len(walletAddress) <= 0 { + return nil, constant.NotAvailableWalletAddress + } + availableToken, availableAmountStr, err := CalculateAvailableWalletTokenAndAmount(actualAmountStr, walletAddress) + if err != nil { + return nil, err + } + if availableToken == "" || availableAmountStr == "" { + return nil, constant.NotAvailableAmountErr + } + availableAmountFloat, err := strconv.ParseFloat(availableAmountStr, 64) + if err != nil { + return nil, err + } + tx := dao.Mdb.Begin() + order := &mdb.Orders{ + TradeId: GenerateCode(), + OrderId: req.OrderId, + Amount: req.Amount, + ActualAmount: availableAmountFloat, + Token: availableToken, + Status: mdb.StatusWaitPay, + NotifyUrl: req.NotifyUrl, + RedirectUrl: req.RedirectUrl, + } + err = data.CreateOrderWithTransaction(tx, order) + if err != nil { + tx.Rollback() + return nil, err + } + ExpirationTime := carbon.Now().AddMinutes(config.GetOrderExpirationTime()).Timestamp() + // 锁定支付池 + err = data.LockPayCache(availableToken, order.TradeId, availableAmountStr, ExpirationTime) + if err != nil { + tx.Rollback() + return nil, err + } + tx.Commit() + // 超时过期消息队列 + orderExpirationQueue, _ := handle.NewOrderExpirationQueue(order.TradeId) + mq.MClient.Enqueue(orderExpirationQueue, asynq.ProcessIn(time.Minute*time.Duration(config.GetOrderExpirationTime()))) + resp := &response.CreateTransactionResponse{ + TradeId: order.TradeId, + OrderId: order.OrderId, + Amount: order.Amount, + ActualAmount: order.ActualAmount, + Token: order.Token, + ExpirationTime: ExpirationTime, + PaymentUrl: fmt.Sprintf("%s/pay/checkout-counter/%s", config.GetAppUri(), order.TradeId), + } + return resp, nil +} + +// OrderProcessing 成功处理订单 +func OrderProcessing(req *request.OrderProcessingRequest) error { + tx := dao.Mdb.Begin() + exist, err := data.GetOrderByBlockIdWithTransaction(tx, req.BlockTransactionId) + if err != nil { + return err + } + if exist.ID > 0 { + tx.Rollback() + return constant.OrderBlockAlreadyProcess + } + // 标记订单成功 + err = data.OrderSuccessWithTransaction(tx, req) + if err != nil { + tx.Rollback() + return err + } + err = data.ClearPayCache(req.Token, req.Amount) + tx.Commit() + order, err := data.GetOrderInfoByTradeId(req.TradeId) + if err != nil { + return err + } + // 回调队列 + orderCallbackQueue, _ := handle.NewOrderCallbackQueue(order) + mq.MClient.Enqueue(orderCallbackQueue, asynq.MaxRetry(5)) + // 发送机器人消息 + msgTpl := ` +📢📢有新的交易支付成功! +
交易号:%s
+
订单号:%s
+
请求支付金额:%.4f cny
+
实际支付金额:%.4f usdt
+
钱包地址:%s
+
订单创建时间:%s
+
支付成功时间:%s
+` + msg := fmt.Sprintf(msgTpl, order.TradeId, order.OrderId, order.Amount, order.ActualAmount, order.Token, order.CreatedAt.ToDateTimeString(), carbon.Now().ToDateTimeString()) + telegram.SendToBot(msg) + return nil +} + +func CalculateAvailableWalletTokenAndAmount(amount string, walletAddress []mdb.WalletAddress) (string, string, error) { + calculateAmountStr := amount + availableAmountStr := "" + availableToken := "" + for i := 0; i < 100; i++ { + token, err := CalculateAvailableWalletToken(calculateAmountStr, walletAddress) + if err != nil { + return "", "", err + } + // 这个金额没有拿到可用的钱包,重试,金额+0.0001 + if token == "" { + x, err := decimal.NewFromString(calculateAmountStr) + if err != nil { + return "", "", err + } + y, err := decimal.NewFromString("0.0001") + if err != nil { + return "", "", err + } + calculateAmountStr = x.Add(y).String() + continue + } + availableAmountStr = calculateAmountStr + availableToken = token + break + } + return availableToken, availableAmountStr, nil +} + +// CalculateAvailableWalletToken 计算可用钱包token +func CalculateAvailableWalletToken(payAmount string, walletAddress []mdb.WalletAddress) (string, error) { + nowTime := time.Now().Unix() + ctx := context.Background() + walletToken := "" + for _, address := range walletAddress { + result, err := data.GetExpirationTimeByAmount(ctx, address.Token, payAmount) + if err != nil { + return "", err + } + // 这个钱包金额被占用了 + if result != "" { + endTime := mathutil.MustInt64(result) + // 但是过期了 + if endTime < nowTime { + // 删掉过期,还能继续用这个地址 + err = data.ClearPayCache(address.Token, payAmount) + if err != nil { + return "", err + } + } else { + continue + } + } + walletToken = address.Token + break + } + return walletToken, nil +} + +// GenerateCode 订单号生成 +func GenerateCode() string { + date := time.Now().Format("20060102") + r := rand.Intn(1000) + code := fmt.Sprintf("%s%d%03d", date, time.Now().UnixNano()/1e6, r) + return code +} + +// GetOrderInfoByTradeId 通过交易号获取订单 +func GetOrderInfoByTradeId(tradeId string) (*mdb.Orders, error) { + order, err := data.GetOrderInfoByTradeId(tradeId) + if err != nil { + return nil, err + } + if order.ID <= 0 { + return nil, constant.OrderNotExists + } + return order, nil +} diff --git a/src/model/service/pay_service.go b/src/model/service/pay_service.go new file mode 100644 index 0000000..93ccfa5 --- /dev/null +++ b/src/model/service/pay_service.go @@ -0,0 +1,28 @@ +package service + +import ( + "errors" + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/model/data" + "github.com/assimon/luuu/model/mdb" + "github.com/assimon/luuu/model/response" +) + +// GetCheckoutCounterByTradeId 获取收银台详情,通过订单 +func GetCheckoutCounterByTradeId(tradeId string) (*response.CheckoutCounterResponse, error) { + orderInfo, err := data.GetOrderInfoByTradeId(tradeId) + if err != nil { + return nil, err + } + if orderInfo.ID <= 0 || orderInfo.Status != mdb.StatusWaitPay { + return nil, errors.New("不存在待支付订单或已过期!") + } + resp := &response.CheckoutCounterResponse{ + TradeId: orderInfo.TradeId, + ActualAmount: orderInfo.ActualAmount, + Token: orderInfo.Token, + ExpirationTime: orderInfo.CreatedAt.AddMinutes(config.GetOrderExpirationTime()).TimestampWithMillisecond(), + RedirectUrl: orderInfo.RedirectUrl, + } + return resp, nil +} diff --git a/src/model/service/task_service.go b/src/model/service/task_service.go new file mode 100644 index 0000000..e8ff3d6 --- /dev/null +++ b/src/model/service/task_service.go @@ -0,0 +1,136 @@ +package service + +import ( + "context" + "fmt" + "github.com/assimon/luuu/model/data" + "github.com/assimon/luuu/model/request" + "github.com/assimon/luuu/util/http_client" + "github.com/assimon/luuu/util/json" + "github.com/assimon/luuu/util/log" + "github.com/golang-module/carbon/v2" + "github.com/gookit/goutil/mathutil" + "github.com/gookit/goutil/stdutil" + "github.com/shopspring/decimal" + "net/http" + "sync" + "time" +) + +const UsdtTrc20ApiUri = "https://apilist.tronscan.org/api/token_trc20/transfers" + +type UsdtTrc20Resp struct { + Total int `json:"total"` + RangeTotal int `json:"rangeTotal"` + TokenTransfers []TokenTransfers `json:"token_transfers"` +} + +type TokenInfo struct { + TokenID string `json:"tokenId"` + TokenAbbr string `json:"tokenAbbr"` + TokenName string `json:"tokenName"` + TokenDecimal int `json:"tokenDecimal"` + TokenCanShow int `json:"tokenCanShow"` + TokenType string `json:"tokenType"` + TokenLogo string `json:"tokenLogo"` + TokenLevel string `json:"tokenLevel"` + Vip bool `json:"vip"` +} +type TokenTransfers struct { + TransactionID string `json:"transaction_id"` + BlockTs int64 `json:"block_ts"` + FromAddress string `json:"from_address"` + ToAddress string `json:"to_address"` + Block int `json:"block"` + ContractAddress string `json:"contract_address"` + Quant string `json:"quant"` + ApprovalAmount string `json:"approval_amount"` + EventType string `json:"event_type"` + ContractType string `json:"contract_type"` + Confirmed bool `json:"confirmed"` + ContractRet string `json:"contractRet"` + FinalResult string `json:"finalResult"` + TokenInfo TokenInfo `json:"tokenInfo"` + FromAddressIsContract bool `json:"fromAddressIsContract"` + ToAddressIsContract bool `json:"toAddressIsContract"` + Revert bool `json:"revert"` +} + +// Trc20CallBack trc20回调 +func Trc20CallBack(token string, wg *sync.WaitGroup) { + defer wg.Done() + defer func() { + if err := recover(); err != nil { + log.Sugar.Error(err) + } + }() + client := http_client.GetHttpClient() + startTime := carbon.Now().AddHours(-24).TimestampWithMillisecond() + endTime := carbon.Now().TimestampWithMillisecond() + resp, err := client.R().SetQueryParams(map[string]string{ + "limit": "200", + "start": "0", + "direction": "in", + "tokens": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", + "relatedAddress": token, + "start_timestamp": stdutil.ToString(startTime), + "end_timestamp": stdutil.ToString(endTime), + }).Get(UsdtTrc20ApiUri) + if err != nil { + panic(err) + } + if resp.StatusCode() != http.StatusOK { + panic(err) + } + var trc20Resp UsdtTrc20Resp + err = json.Cjson.Unmarshal(resp.Body(), &trc20Resp) + if err != nil { + panic(err) + } + if trc20Resp.Total <= 0 { + return + } + ctx := context.Background() + nowTime := time.Now().Unix() + for _, transfer := range trc20Resp.TokenTransfers { + if transfer.ToAddress != token || transfer.FinalResult != "SUCCESS" { + continue + } + x, _ := decimal.NewFromString(transfer.Quant) + y, _ := decimal.NewFromString("1000000") + quant := x.Div(y).InexactFloat64() + amount := fmt.Sprintf("%.4f", quant) + result, err := data.GetExpirationTimeByAmount(ctx, token, amount) + if err != nil { + panic(err) + } + if result != "" { + expTime := mathutil.MustInt64(result) + // 但是过期了 + if expTime < nowTime { + // 删掉过期 + _ = data.ClearPayCache(token, amount) + continue + } + } + // 该钱包下有无匹配金额订单 + tradeId, err := data.GetTradeIdByAmount(ctx, token, amount) + if err != nil { + panic(err) + } + if tradeId == "" { + continue + } + // 到这一步就匹配到金额了 + req := &request.OrderProcessingRequest{ + Token: token, + TradeId: tradeId, + Amount: amount, + BlockTransactionId: transfer.TransactionID, + } + err = OrderProcessing(req) + if err != nil { + panic(err) + } + } +} diff --git a/src/mq/handle/callback_queue.go b/src/mq/handle/callback_queue.go new file mode 100644 index 0000000..8f2da06 --- /dev/null +++ b/src/mq/handle/callback_queue.go @@ -0,0 +1,67 @@ +package handle + +import ( + "context" + "errors" + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/model/data" + "github.com/assimon/luuu/model/mdb" + "github.com/assimon/luuu/model/response" + "github.com/assimon/luuu/util/http_client" + "github.com/assimon/luuu/util/json" + "github.com/assimon/luuu/util/log" + "github.com/assimon/luuu/util/sign" + "github.com/hibiken/asynq" +) + +const QueueOrderCallback = "order:callback" + +func NewOrderCallbackQueue(order *mdb.Orders) (*asynq.Task, error) { + payload, err := json.Cjson.Marshal(order) + if err != nil { + return nil, err + } + return asynq.NewTask(QueueOrderCallback, payload), nil +} + +func OrderCallbackHandle(ctx context.Context, t *asynq.Task) error { + var order mdb.Orders + err := json.Cjson.Unmarshal(t.Payload(), &order) + if err != nil { + return err + } + defer func() { + if err := recover(); err != nil { + log.Sugar.Error(err) + } + }() + defer func() { + data.SaveCallBackOrdersResp(&order) + }() + client := http_client.GetHttpClient() + orderResp := response.OrderNotifyResponse{ + TradeId: order.TradeId, + OrderId: order.OrderId, + Amount: order.Amount, + ActualAmount: order.ActualAmount, + Token: order.Token, + BlockTransactionId: order.BlockTransactionId, + Status: mdb.StatusPaySuccess, + } + signature, err := sign.Get(orderResp, config.GetApiAuthToken()) + if err != nil { + return err + } + orderResp.Signature = signature + resp, err := client.R().SetHeader("powered-by", "Epusdt(https://github.com/assimon/epusdt)").SetBody(orderResp).Post(order.NotifyUrl) + if err != nil { + return err + } + body := string(resp.Body()) + if body != "ok" { + order.CallBackConfirm = mdb.CallBackConfirmNo + return errors.New("not ok") + } + order.CallBackConfirm = mdb.CallBackConfirmOk + return nil +} diff --git a/src/mq/handle/order_expiration_queue.go b/src/mq/handle/order_expiration_queue.go new file mode 100644 index 0000000..8ce2344 --- /dev/null +++ b/src/mq/handle/order_expiration_queue.go @@ -0,0 +1,37 @@ +package handle + +import ( + "context" + "fmt" + "github.com/assimon/luuu/model/data" + "github.com/assimon/luuu/model/mdb" + "github.com/hibiken/asynq" +) + +const QueueOrderExpiration = "order:expiration" + +func NewOrderExpirationQueue(tradeId string) (*asynq.Task, error) { + return asynq.NewTask(QueueOrderExpiration, []byte(tradeId)), nil +} + +// OrderExpirationHandle 设置订单过期 +func OrderExpirationHandle(ctx context.Context, t *asynq.Task) error { + tradeId := string(t.Payload()) + orderInfo, err := data.GetOrderInfoByTradeId(tradeId) + if err != nil { + return err + } + if orderInfo.ID <= 0 || orderInfo.Status != mdb.StatusWaitPay { + return nil + } + err = data.UpdateOrderIsExpirationById(orderInfo.ID) + if err != nil { + return err + } + actualAmount := fmt.Sprintf("%.4f", orderInfo.ActualAmount) + err = data.ClearPayCache(orderInfo.Token, actualAmount) + if err != nil { + return err + } + return nil +} diff --git a/src/mq/queue.go b/src/mq/queue.go new file mode 100644 index 0000000..30f9cbd --- /dev/null +++ b/src/mq/queue.go @@ -0,0 +1,51 @@ +package mq + +import ( + "fmt" + "github.com/assimon/luuu/mq/handle" + "github.com/assimon/luuu/util/log" + "github.com/hibiken/asynq" + "github.com/spf13/viper" +) + +var MClient *asynq.Client + +func Start() { + redis := asynq.RedisClientOpt{ + Addr: fmt.Sprintf( + "%s:%s", + viper.GetString("redis_host"), + viper.GetString("redis_port")), + DB: viper.GetInt("redis_db"), + Password: viper.GetString("redis_passwd"), + } + initClient(redis) + go initListen(redis) +} + +func initClient(redis asynq.RedisClientOpt) { + MClient = asynq.NewClient(redis) +} + +func initListen(redis asynq.RedisClientOpt) { + srv := asynq.NewServer( + redis, + asynq.Config{ + // Specify how many concurrent workers to use + Concurrency: viper.GetInt("queue_concurrency"), + // Optionally specify multiple queues with different priority. + Queues: map[string]int{ + "critical": viper.GetInt("queue_level_critical"), + "default": viper.GetInt("queue_level_default"), + "low": viper.GetInt("queue_level_low"), + }, + Logger: log.Sugar, + }, + ) + mux := asynq.NewServeMux() + mux.HandleFunc(handle.QueueOrderExpiration, handle.OrderExpirationHandle) + mux.HandleFunc(handle.QueueOrderCallback, handle.OrderCallbackHandle) + if err := srv.Run(mux); err != nil { + log.Sugar.Fatalf("[queue] could not run server: %v", err) + } +} diff --git a/src/route/router.go b/src/route/router.go new file mode 100644 index 0000000..0be1056 --- /dev/null +++ b/src/route/router.go @@ -0,0 +1,27 @@ +package route + +import ( + "github.com/assimon/luuu/controller/comm" + "github.com/assimon/luuu/middleware" + "github.com/labstack/echo/v4" + "net/http" +) + +// RegisterRoute 路由注册 +func RegisterRoute(e *echo.Echo) { + e.Any("/", func(c echo.Context) error { + return c.String(http.StatusOK, "hello epusdt, https://github.com/assimon/epusdt") + }) + // ==== 支付相关===== + payRoute := e.Group("/pay") + // 收银台 + payRoute.GET("/checkout-counter/:trade_id", comm.Ctrl.CheckoutCounter) + // 状态检测 + payRoute.GET("/check-status/:trade_id", comm.Ctrl.CheckStatus) + + apiV1Route := e.Group("/api/v1") + // ====订单相关==== + orderRoute := apiV1Route.Group("/order", middleware.CheckApiSign()) + // 创建订单 + orderRoute.POST("/create-transaction", comm.Ctrl.CreateTransaction) +} diff --git a/src/static/index.html b/src/static/index.html new file mode 100644 index 0000000..5559153 --- /dev/null +++ b/src/static/index.html @@ -0,0 +1,243 @@ + + + + + + + + Epusdt - 优雅的usdt支付中间件 + + + + + +
+ +
+ 订单编号:{{.TradeId}} +
+
当前USDT支付区块网络协议为TRC20
+
!!到账金额需要与下方显示的金额一致,否则系統无法确认!!
+
尝试点击钱包地址或金额可直接复制👇
+
+

{{.ActualAmount}} + USDT

+

+ {{.Token}} +

+
+ +
+
+
+ 00 + : + 00 + : + 00 +
+
+ + + +
+
+
+
+ + + + + + + + \ No newline at end of file diff --git a/src/static/reset.css b/src/static/reset.css new file mode 100644 index 0000000..9b99f95 --- /dev/null +++ b/src/static/reset.css @@ -0,0 +1,44 @@ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td, +article, aside, canvas, details, embed, +figure, figcaption, footer, header, hgroup, +menu, nav, output, ruby, section, summary, +time, mark, audio, video { + margin: 0; + padding: 0; + border: 0; + font-size: 100%; + font: inherit; + vertical-align: baseline; +} +/* HTML5 display-role reset for older browsers */ +article, aside, details, figcaption, figure, +footer, header, hgroup, menu, nav, section { + display: block; +} +body { + line-height: 1; + background-color: #fafbfc; +} +ol, ul { + list-style: none; +} +blockquote, q { + quotes: none; +} +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} +table { + border-collapse: collapse; + border-spacing: 0; +} diff --git a/src/task/listen.go b/src/task/listen.go new file mode 100644 index 0000000..238c9a9 --- /dev/null +++ b/src/task/listen.go @@ -0,0 +1,12 @@ +package task + +import "github.com/robfig/cron/v3" + +func Start() { + c := cron.New() + // 汇率监听 + c.AddJob("@every 60s", UsdtRateJob{}) + // trc20钱包监听 + c.AddJob("@every 10s", ListenTrc20Job{}) + c.Start() +} diff --git a/src/task/listen_trc20_job.go b/src/task/listen_trc20_job.go new file mode 100644 index 0000000..c4a180e --- /dev/null +++ b/src/task/listen_trc20_job.go @@ -0,0 +1,32 @@ +package task + +import ( + "github.com/assimon/luuu/model/data" + "github.com/assimon/luuu/model/service" + "github.com/assimon/luuu/util/log" + "sync" +) + +type ListenTrc20Job struct { +} + +var gListenTrc20JobLock sync.Mutex + +func (r ListenTrc20Job) Run() { + gListenTrc20JobLock.Lock() + defer gListenTrc20JobLock.Unlock() + walletAddress, err := data.GetAvailableWalletAddress() + if err != nil { + log.Sugar.Error(err) + return + } + if len(walletAddress) <= 0 { + return + } + var wg sync.WaitGroup + for _, address := range walletAddress { + wg.Add(1) + go service.Trc20CallBack(address.Token, &wg) + } + wg.Wait() +} diff --git a/src/task/usdt_rate_job.go b/src/task/usdt_rate_job.go new file mode 100644 index 0000000..6e2b5e4 --- /dev/null +++ b/src/task/usdt_rate_job.go @@ -0,0 +1,66 @@ +package task + +import ( + "fmt" + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/util/http_client" + "github.com/assimon/luuu/util/json" + "github.com/assimon/luuu/util/log" + "strconv" + "time" +) + +const UsdtRateApiUri = "https://api.coinmarketcap.com/data-api/v3/cryptocurrency/detail/chart" + +type UsdtRateJob struct { +} + +type UsdtRateResp struct { + Data Data `json:"data"` + Status Status `json:"status"` +} + +type Status struct { + Timestamp time.Time `json:"timestamp"` + ErrorCode string `json:"error_code"` + ErrorMessage string `json:"error_message"` + Elapsed string `json:"elapsed"` + CreditCount int `json:"credit_count"` +} + +type Data struct { + Points map[string]Points `json:"points"` +} + +type Points struct { + V []float64 `json:"v"` + C []float64 `json:"c"` +} + +func (r UsdtRateJob) Run() { + client := http_client.GetHttpClient() + resp, err := client.R().SetQueryString("id=825&range=1H&convertId=2787").SetHeader("Accept", "application/json").Get(UsdtRateApiUri) + if err != nil { + log.Sugar.Error("usdt rate get err:", err.Error()) + return + } + var usdtResp UsdtRateResp + err = json.Cjson.Unmarshal(resp.Body(), &usdtResp) + if err != nil { + log.Sugar.Error("Unmarshal usdt resp err:", err.Error()) + return + } + if usdtResp.Status.ErrorCode != "0" { + log.Sugar.Error("usdt resp err:", usdtResp.Status.ErrorMessage) + return + } + for _, points := range usdtResp.Data.Points { + if len(points.C) > 0 && points.C[0] > 0 { + config.UsdtRate, err = strconv.ParseFloat(fmt.Sprintf("%.2f", points.C[0]), 64) + if err != nil { + log.Sugar.Error("Calculate UsdtRate err:", err.Error()) + } + return + } + } +} diff --git a/src/telegram/command.go b/src/telegram/command.go new file mode 100644 index 0000000..449d2f9 --- /dev/null +++ b/src/telegram/command.go @@ -0,0 +1,14 @@ +package telegram + +import tb "gopkg.in/telebot.v3" + +const ( + START_CMD = "/start" +) + +var Cmds = []tb.Command{ + { + Text: START_CMD, + Description: "开始", + }, +} diff --git a/src/telegram/handle.go b/src/telegram/handle.go new file mode 100644 index 0000000..418f864 --- /dev/null +++ b/src/telegram/handle.go @@ -0,0 +1,136 @@ +package telegram + +import ( + "fmt" + "github.com/assimon/luuu/model/data" + "github.com/assimon/luuu/model/mdb" + "github.com/gookit/goutil/mathutil" + "github.com/gookit/goutil/strutil" + tb "gopkg.in/telebot.v3" +) + +const ( + ReplayAddWallet = "请发给我一个合法的钱包地址" +) + +func OnTextMessageHandle(c tb.Context) error { + if c.Message().ReplyTo.Text == ReplayAddWallet { + defer bots.Delete(c.Message().ReplyTo) + _, err := data.AddWalletAddress(c.Message().Text) + if err != nil { + return c.Send(err.Error()) + } + c.Send(fmt.Sprintf("钱包[%s]添加成功!", c.Message().Text)) + return WalletList(c) + } + return nil +} + +func WalletList(c tb.Context) error { + wallets, err := data.GetAllWalletAddress() + if err != nil { + return err + } + var btnList [][]tb.InlineButton + for _, wallet := range wallets { + status := "已启用✅" + if wallet.Status == mdb.TokenStatusDisable { + status = "已禁用🚫" + } + var temp []tb.InlineButton + btnInfo := tb.InlineButton{ + Unique: wallet.Token, + Text: fmt.Sprintf("%s[%s]", wallet.Token, status), + Data: strutil.MustString(wallet.ID), + } + bots.Handle(&btnInfo, WalletInfo) + btnList = append(btnList, append(temp, btnInfo)) + } + addBtn := tb.InlineButton{Text: "添加钱包地址", Unique: "AddWallet"} + bots.Handle(&addBtn, func(c tb.Context) error { + return c.Send(ReplayAddWallet, &tb.ReplyMarkup{ + ForceReply: true, + }) + }) + btnList = append(btnList, []tb.InlineButton{addBtn}) + return c.EditOrSend("请点击钱包继续操作", &tb.ReplyMarkup{ + InlineKeyboard: btnList, + }) +} + +func WalletInfo(c tb.Context) error { + id := mathutil.MustUint(c.Data()) + tokenInfo, err := data.GetWalletAddressById(id) + if err != nil { + return c.Send(err.Error()) + } + enableBtn := tb.InlineButton{ + Text: "启用", + Unique: "enableBtn", + Data: c.Data(), + } + disableBtn := tb.InlineButton{ + Text: "禁用", + Unique: "disableBtn", + Data: c.Data(), + } + delBtn := tb.InlineButton{ + Text: "删除", + Unique: "delBtn", + Data: c.Data(), + } + backBtn := tb.InlineButton{ + Text: "返回", + Unique: "WalletList", + } + bots.Handle(&enableBtn, EnableWallet) + bots.Handle(&disableBtn, DisableWallet) + bots.Handle(&delBtn, DelWallet) + bots.Handle(&backBtn, WalletList) + return c.EditOrReply(tokenInfo.Token, &tb.ReplyMarkup{InlineKeyboard: [][]tb.InlineButton{ + { + enableBtn, + disableBtn, + delBtn, + }, + { + backBtn, + }, + }}) +} + +func EnableWallet(c tb.Context) error { + id := mathutil.MustUint(c.Data()) + if id <= 0 { + return c.Send("请求不合法!") + } + err := data.ChangeWalletAddressStatus(id, mdb.TokenStatusEnable) + if err != nil { + return c.Send(err.Error()) + } + return WalletList(c) +} + +func DisableWallet(c tb.Context) error { + id := mathutil.MustUint(c.Data()) + if id <= 0 { + return c.Send("请求不合法!") + } + err := data.ChangeWalletAddressStatus(id, mdb.TokenStatusDisable) + if err != nil { + return c.Send(err.Error()) + } + return WalletList(c) +} + +func DelWallet(c tb.Context) error { + id := mathutil.MustUint(c.Data()) + if id <= 0 { + return c.Send("请求不合法!") + } + err := data.DeleteWalletAddressById(id) + if err != nil { + return c.Send(err.Error()) + } + return WalletList(c) +} diff --git a/src/telegram/telegram.go b/src/telegram/telegram.go new file mode 100644 index 0000000..9f793f4 --- /dev/null +++ b/src/telegram/telegram.go @@ -0,0 +1,58 @@ +package telegram + +import ( + "github.com/assimon/luuu/config" + "github.com/assimon/luuu/util/log" + tb "gopkg.in/telebot.v3" + "gopkg.in/telebot.v3/middleware" + "time" +) + +var bots *tb.Bot + +// BotStart 机器人启动 +func BotStart() { + var err error + botSetting := tb.Settings{ + Token: config.TgBotToken, + Poller: &tb.LongPoller{Timeout: 10 * time.Second}, + } + if config.TgProxy != "" { + botSetting.URL = config.TgProxy + } + bots, err = tb.NewBot(botSetting) + if err != nil { + log.Sugar.Error(err.Error()) + return + } + err = bots.SetCommands(Cmds) + if err != nil { + log.Sugar.Error(err.Error()) + return + } + RegisterHandle() + bots.Start() +} + +// RegisterHandle 注册处理器 +func RegisterHandle() { + adminOnly := bots.Group() + adminOnly.Use(middleware.Whitelist(config.TgManage)) + adminOnly.Handle(START_CMD, WalletList) + adminOnly.Handle(tb.OnText, OnTextMessageHandle) +} + +// SendToBot 主动发送消息机器人消息 +func SendToBot(msg string) { + go func() { + user := tb.User{ + ID: config.TgManage, + } + _, err := bots.Send(&user, msg, &tb.SendOptions{ + ParseMode: tb.ModeHTML, + }) + if err != nil { + log.Sugar.Error(err) + } + }() +} diff --git a/src/util/constant/errno.go b/src/util/constant/errno.go new file mode 100644 index 0000000..ff8df5c --- /dev/null +++ b/src/util/constant/errno.go @@ -0,0 +1,50 @@ +package constant + +var Errno = map[int]string{ + 400: "系统错误", + 401: "签名认证错误", + 10001: "钱包地址已存在,请勿重复添加", + 10002: "支付交易已存在,请勿重复创建", + 10003: "无可用钱包地址,无法发起支付", + 10004: "支付金额有误, 无法满足最小支付单位", + 10005: "无可用金额通道", + 10006: "汇率计算错误", + 10007: "订单区块已处理", + 10008: "订单不存在", + 10009: "无法解析请求参数", +} + +var ( + SystemErr = Err(400) + SignatureErr = Err(401) + WalletAddressAlreadyExists = Err(10001) + OrderAlreadyExists = Err(10002) + NotAvailableWalletAddress = Err(10003) + PayAmountErr = Err(10004) + NotAvailableAmountErr = Err(10005) + RateAmountErr = Err(10006) + OrderBlockAlreadyProcess = Err(10007) + OrderNotExists = Err(10008) + ParamsMarshalErr = Err(10009) +) + +type RspError struct { + Code int + Msg string +} + +func (re *RspError) Error() string { + return re.Msg +} + +func Err(code int) (err error) { + err = &RspError{ + Code: code, + Msg: Errno[code], + } + return err +} + +func (re *RspError) Render() (code int, msg string) { + return re.Code, re.Msg +} diff --git a/src/util/http/response.go b/src/util/http/response.go new file mode 100644 index 0000000..f2bc788 --- /dev/null +++ b/src/util/http/response.go @@ -0,0 +1,73 @@ +package http + +import ( + "github.com/assimon/luuu/util/constant" + "github.com/assimon/luuu/util/page" + "github.com/labstack/echo/v4" + "net/http" +) + +type Resp struct{} + +type Response struct { + StatusCode int `json:"status_code"` + Message string `json:"message"` + Data interface{} `json:"data"` + RequestID string `json:"request_id"` +} + +func (r *Resp) View(e echo.Context, code int, html string) error { + return e.HTML(code, html) +} + +// SucView 成功返回 +func (r *Resp) SucView(e echo.Context, html string) error { + return r.View(e, http.StatusOK, html) +} + +func (r *Resp) Json(e echo.Context, code int, data interface{}) error { + return e.JSON(code, data) +} + +// SucJson 成功返回json +func (r *Resp) SucJson(e echo.Context, data interface{}, message ...string) error { + rp := new(Response) + rp.StatusCode = http.StatusOK + if len(message) == 0 { + rp.Message = "success" + } else { + for _, m := range message { + rp.Message += "," + m + } + } + rp.Data = data + rp.RequestID = e.Request().Header.Get(echo.HeaderXRequestID) + return r.Json(e, http.StatusOK, rp) +} + +// SucJsonPage 分页封装返回json +func (r *Resp) SucJsonPage(e echo.Context, data interface{}, pagination page.Pagination, message ...string) error { + type PageData struct { + List interface{} `json:"list"` + Pagination page.Pagination `json:"pagination"` + } + pageDate := PageData{ + List: data, + Pagination: pagination, + } + return r.SucJson(e, pageDate, message...) +} + +// FailJson 失败json +func (r *Resp) FailJson(e echo.Context, err error) error { + rr := new(Response) + switch err.(type) { + case *constant.RspError: + rr.StatusCode, rr.Message = err.(*constant.RspError).Render() + default: + rr.StatusCode = 400 + rr.Message = err.Error() + } + rr.RequestID = e.Request().Header.Get(echo.HeaderXRequestID) + return r.Json(e, http.StatusOK, &rr) +} diff --git a/src/util/http_client/client.go b/src/util/http_client/client.go new file mode 100644 index 0000000..bee9bc6 --- /dev/null +++ b/src/util/http_client/client.go @@ -0,0 +1,18 @@ +package http_client + +import ( + "github.com/go-resty/resty/v2" + "time" +) + +// GetHttpClient 获取请求客户端 +func GetHttpClient(proxys ...string) *resty.Client { + client := resty.New() + // 如果有代理 + if len(proxys) > 0 { + proxy := proxys[0] + client.SetProxy(proxy) + } + client.SetTimeout(time.Second * 5) + return client +} diff --git a/src/util/json/cjson.go b/src/util/json/cjson.go new file mode 100644 index 0000000..acff333 --- /dev/null +++ b/src/util/json/cjson.go @@ -0,0 +1,5 @@ +package json + +import jsoniter "github.com/json-iterator/go" + +var Cjson = jsoniter.ConfigCompatibleWithStandardLibrary diff --git a/src/util/log/log.go b/src/util/log/log.go new file mode 100644 index 0000000..f30e893 --- /dev/null +++ b/src/util/log/log.go @@ -0,0 +1,42 @@ +package log + +import ( + "fmt" + "github.com/assimon/luuu/config" + "github.com/natefinch/lumberjack" + "github.com/spf13/viper" + "go.uber.org/zap" + "go.uber.org/zap/zapcore" + "time" +) + +var Sugar *zap.SugaredLogger + +func Init() { + writeSyncer := getLogWriter() + encoder := getEncoder() + core := zapcore.NewCore(encoder, writeSyncer, zapcore.DebugLevel) + logger := zap.New(core, zap.AddCaller()) + Sugar = logger.Sugar() +} + +func getEncoder() zapcore.Encoder { + encoderConfig := zap.NewProductionEncoderConfig() + encoderConfig.EncodeTime = zapcore.ISO8601TimeEncoder + encoderConfig.EncodeLevel = zapcore.CapitalLevelEncoder + return zapcore.NewJSONEncoder(encoderConfig) +} + +func getLogWriter() zapcore.WriteSyncer { + file := fmt.Sprintf("%s/log_%s.log", + config.LogSavePath, + time.Now().Format("20060102")) + lumberJackLogger := &lumberjack.Logger{ + Filename: file, + MaxSize: viper.GetInt("log_max_size"), + MaxBackups: viper.GetInt("max_backups"), + MaxAge: viper.GetInt("log_max_age"), + Compress: false, + } + return zapcore.AddSync(lumberJackLogger) +} diff --git a/src/util/page/page.go b/src/util/page/page.go new file mode 100644 index 0000000..bbf4e37 --- /dev/null +++ b/src/util/page/page.go @@ -0,0 +1,25 @@ +package page + +import "math" + +const ( + DefaultPageSize = 10 + MaxPageSize = 100 + DefaultPage = 1 +) + +type Pagination struct { + CurrentPage int `json:"current_page"` // 当前页码 + PerPage int `json:"per_page"` // 当前页行数 + TotalPage int `json:"total_page"` // 总页码 + Total int64 `json:"total"` // 总行数 +} + +func GetPagination(page, pageSize int, total int64) Pagination { + return Pagination{ + Total: total, + CurrentPage: page, + PerPage: pageSize, + TotalPage: int(math.Ceil(float64(total) / float64(pageSize))), + } +} diff --git a/src/util/sign/sign.go b/src/util/sign/sign.go new file mode 100644 index 0000000..22881d8 --- /dev/null +++ b/src/util/sign/sign.go @@ -0,0 +1,117 @@ +package sign + +import ( + "errors" + "github.com/assimon/luuu/util/json" + "github.com/gookit/goutil/strutil" + "reflect" + "sort" + "strconv" +) + +// Get 获取签名 +func Get(data interface{}, bizKey string) (string, error) { + var err error + signStr := "" + switch v := reflect.ValueOf(data); v.Kind() { + case reflect.Map: + signStr, err = MapToParams(data.(map[string]interface{})) + if err != nil { + return "", err + } + case reflect.Struct: + signStr, err = Struct2map(v.Interface()) + if err != nil { + return "", err + } + default: + return "", errors.New("type err") + } + sign := strutil.Md5(signStr + bizKey) + return sign, nil +} + +func Struct2map(content interface{}) (string, error) { + var params map[string]interface{} + marshal, err := json.Cjson.Marshal(content) + if err != nil { + return "", err + } + if err = json.Cjson.Unmarshal(marshal, ¶ms); err != nil { + return "", err + } + paramsUrl, err := MapToParams(params) + return paramsUrl, err +} + +func MapToParams(params map[string]interface{}) (string, error) { + var tempArr []string + temString := "" + for k, v := range params { + if k == "signature" { + continue + } + if v == nil { + continue + } + fv := "" + switch v.(type) { + case float64: + ft := v.(float64) + fv = strconv.FormatFloat(ft, 'f', -1, 64) + case float32: + ft := v.(float32) + fv = strconv.FormatFloat(float64(ft), 'f', -1, 64) + case int: + it := v.(int) + fv = strconv.Itoa(it) + case uint: + it := v.(uint) + fv = strconv.Itoa(int(it)) + case int8: + it := v.(int8) + fv = strconv.Itoa(int(it)) + case uint8: + it := v.(uint8) + fv = strconv.Itoa(int(it)) + case int16: + it := v.(int16) + fv = strconv.Itoa(int(it)) + case uint16: + it := v.(uint16) + fv = strconv.Itoa(int(it)) + case int32: + it := v.(int32) + fv = strconv.Itoa(int(it)) + case uint32: + it := v.(uint32) + fv = strconv.Itoa(int(it)) + case int64: + it := v.(int64) + fv = strconv.FormatInt(it, 10) + case uint64: + it := v.(uint64) + fv = strconv.FormatUint(it, 10) + case string: + fv = v.(string) + case []byte: + fv = string(v.([]byte)) + default: + return "", errors.New("signature marshal error") + } + // 空值不参与签名 + if fv == "" { + continue + } + tempArr = append(tempArr, k+"="+fv) + } + sort.Strings(tempArr) + for n, v := range tempArr { + if n+1 < len(tempArr) { + temString = temString + v + "&" + } else { + temString = temString + v + } + } + return temString, nil +} diff --git a/wiki/API.md b/wiki/API.md new file mode 100644 index 0000000..abefe1b --- /dev/null +++ b/wiki/API.md @@ -0,0 +1,194 @@ +# 前言 +开发者可通过`Epusdt`提供的`http api`将交易功能集成至任何系统 + +# 接口统一加密方式 +### 签名算法MD5 +签名生成的通用步骤如下: + +第一步,将所有非空参数值的参数按照参数名ASCII码从小到大排序(字典序),使用URL键值对的格式(即key1=value1&key2=value2…)拼接成`待加密参数`。 + +重要规则: +◆ 参数名ASCII码从小到大排序(字典序); +◆ 如果参数的值为空不参与签名; +◆ 参数名区分大小写; +第二步,`待加密参数`最后拼接上`api接口认证token`得到`待签名字符串`,并对`待签名字符串`进行MD5运算,再将得到的`MD5字符串`所有字符转换为`小写`,得到签名`signature`。 注意:`signature`的长度为32个字节。 + +举例: + +假设传送的参数如下: +``` +order_id : 20220201030210321 +amount : 42 +notify_url : http://example.com/notify +redirect_url : http://example.com/redirect +``` + +假设api接口认证token为:`epusdt_password_xasddawqe`(api接口认证token可以在`.env`文件设置) + +第一步:对参数按照key=value的格式,并按照参数名ASCII字典序排序如下: +``` +amount=42¬ify_url=http://example.com/notify&order_id=20220201030210321&redirect_url=http://example.com/redirect +``` +第二步:拼接API密钥并加密: +``` +MD5(amount=42¬ify_url=http://example.com/notify&order_id=20220201030210321&redirect_url=http://example.com/redirectepusdt_password_xasddawqe) +``` + +最终得到最终发送的数据: +``` +order_id : 20220201030210321 +amount : 42 +notify_url : http://example.com/notify +redirect_url : http://example.com/redirect +signature : 1cd4b52df5587cfb1968b0c0c6e156cd +``` + +### PHP加密示例 +```php + function epusdtSign(array $parameter, string $signKey) + { + ksort($parameter); + reset($parameter); + $sign = ''; + $urls = ''; + foreach ($parameter as $key => $val) { + if ($val == '') continue; + if ($key != 'signature') { + if ($sign != '') { + $sign .= "&"; + $urls .= "&"; + } + $sign .= "$key=$val"; + $urls .= "$key=" . urlencode($val); + } + } + $sign = md5($sign . $signKey);//密码追加进入开始MD5签名 + return $sign; + } +``` + +# 创建交易接口 + +## POST 创建交易 + +POST /api/v1/order/create-transaction + +> Body 请求参数 + +```json +{ + "order_id": "2022123321312321321", + "amount": 100, + "notify_url": "http://example.com/", + "redirect_url": "http://example.com/", + "signature": "xsadaxsaxsa" +} +``` + +### 请求参数 + +|名称|位置|类型|必选| 中文名 | 说明 | +|---|---|---|---|-----------|---------------| +|body|body|object| 否 || | +|» order_id|body|string| 是 | 请求支付订单号 | | +|» amount|body|number| 是 | 支付金额(CNY) | 小数点保留后2位,最少0.01 | +|» notify_url|body|string| 是 | 异步回调地址 | | +|» redirect_url|body|string| 否 | 同步跳转地址 || +|» signature|body|string| 是 | 签名 | 接口统一加密方式 | + +> 返回示例 + +> 成功 + +```json +{ + "status_code": 200, + "message": "success", + "data": { + "trade_id": "202203271648380592218340", + "order_id": "9", + "amount": 53, + "actual_amount": 7.9104, + "token": "TNEns8t9jbWENbStkQdVQtHMGpbsYsQjZK", + "expiration_time": 1648381192, + "payment_url": "http://example.com/pay/checkout-counter/202203271648380592218340" + }, + "request_id": "b1344d70-ff19-4543-b601-37abfb3b3686" +} +``` +### 返回结果 + +|状态码|状态码含义|说明|数据模型| +|---|---|---|---| +|200|[OK](https://tools.ietf.org/html/rfc7231#section-6.3.1)|成功|Inline| + +### 返回数据结构 + +状态码 **200** + +| 名称 | 类型 | 解释 | 说明 | +|--------------------|---------|-----------|-------------------------------| +| » status_code | integer | 请求状态 | 请参考下方[status_code返回状态码及含义](#status_code返回状态码及含义) | +| » message | string | 消息 || +| » data | object | 返回数据 || +| »» trade_id | string | 交易号 || +| »» order_id | string | 请求支付订单号 || +| »» amount | float | 请求支付金额 | CNY,保留2位小数 | +| »» actual_amount | float | 实际需要支付的金额 | USDT,保留四位小数 | +| »» token | string | 钱包地址 | | +| »» expiration_time | integer | 过期时间 | 时间戳秒 | +| »» payment_url | string | 收银台地址 | | +| » request_id | string | true | | + + +# 异步回调 + +支付成功后,`Epusdt`会向目标服务器发生异步通知,告知该笔交易已经支付完成。 +失败`Epusdt`最高最多重试5次,请注意验证消息签名。 +目标服务器处理完成后请返回字符串`ok`即可,否则`Epusdt`会一直重试发送消息,最高5次 + +POST 【异步回调地址】 + +> Body 请求参数 + +```json +{ + "trade_id": "202203251648208648961728", + "order_id": "2022123321312321321", + "amount": 100, + "actual_amount": 15.625, + "token": "TNEns8t9jbWENbStkQdVQtHMGpbsYsQjZK", + "block_transaction_id": "123333333321232132131", + "signature": "xsadaxsaxsa", + "status": 2 +} +``` + +### 请求参数 + +|名称|位置| 类型 |必选| 中文名 | 说明 | +|---|---|--------|---|---------------------|-----------------| +|body|body| object | 否 || | +|» trade_id|body| string | 是 | 交易号 | | +|» order_id|body| string | 是 | 请求支付订单号 | | +|» amount|body| float | 是 | 支付金额(CNY) | 小数点保留后2位 | +|» actual_amount|body| float | 是 | 实际需要支付的usdt金额(USDT) | 小数点保留后4位 | +|» token|body| string | 是 | 钱包地址 | | +|» block_transaction_id|body| string | 是 | 区块交易号 | | +|» signature|body| string | 是 | 签名 | | +|» status|body| int | 是 | 订单状态 | 1:等待支付,2:支付成功,3:已过期 | + +# status_code返回状态码及含义 + +| 状态码 | 说明 | +|-----|-----| +|400|系统错误| +|401|签名认证错误| +|10002|支付交易已存在,请勿重复创建| +|10003|无可用钱包地址,无法发起支付| +|10004|支付金额有误, 无法满足最小支付单位| +|10005|无可用金额通道| +|10006|汇率计算错误| +|10007|订单区块已处理| +|10008|订单不存在| +|10009|无法解析参数| diff --git a/wiki/BT_RUN.md b/wiki/BT_RUN.md new file mode 100644 index 0000000..f246bec --- /dev/null +++ b/wiki/BT_RUN.md @@ -0,0 +1,175 @@ +## 前言 +本教程基于`宝塔`操作面板演示`Epusdt`如何运行,如果你未使用`宝塔`面板和有更强的服务器运维基础相信你也能根据教程的一些操作找到灵感! + +## 准备工作 +- 请确保已经安装并启动了`Mysql`和`redis`、`Supervisord`服务 +- 准备一个`telgeram`机器人🤖(用于操作你的钱包和接收交易通知),申请教程参考:[https://w37fhy.cn/2364.html](https://w37fhy.cn/2364.html) +- 准备一个收银台域名,并完成解析(例如:`upay.dujiaoka.com`)。用于支付请求发起和扫码页面 + +## 开始使用 +### 一、新增网站 +在`宝塔`面板网站里新增一个网站,无需`php`和`ftp`纯静态即可,但是需要数据库! +将提前解析好的收银台域名绑定。 +![新增网站](img/add_web.png) + +### 二、导入Sql +登录管理刚刚新增数据库,导入`Epusdt`所需的sql文件。 + +以下为示范0.01版本 最新数据库请以 https://github.com/assimon/epusdt/blob/master/sql/ 为准 + +#### 1.手动下载导入 + +数据库地址:https://github.com/assimon/epusdt/blob/master/sql/v0.0.1.sql +![导入Sql](img/sql.png) + +#### 2.使用phpMyAdmin导入 +使用文本编辑器打开`.sql`文件,如下: +```sql +-- auto-generated definition +create table orders +( + id int auto_increment + primary key, + trade_id varchar(32) not null comment 'epusdt订单号', + order_id varchar(32) not null comment '客户交易id', + block_transaction_id varchar(128) null comment '区块唯一编号', + actual_amount decimal(19, 4) not null comment '订单实际需要支付的金额,保留4位小数', + amount decimal(19, 4) not null comment '订单金额,保留4位小数', + token varchar(50) not null comment '所属钱包地址', + status int default 1 not null comment '1:等待支付,2:支付成功,3:已过期', + notify_url varchar(128) not null comment '异步回调地址', + redirect_url varchar(128) null comment '同步回调地址', + callback_num int default 0 null comment '回调次数', + callback_confirm int default 2 null comment '回调是否已确认? 1是 2否', + created_at timestamp null, + updated_at timestamp null, + deleted_at timestamp null, + constraint orders_order_id_uindex + unique (order_id), + constraint orders_trade_id_uindex + unique (trade_id) +); + +create index orders_block_transaction_id_index + on orders (block_transaction_id); + +-- auto-generated definition +create table wallet_address +( + id int auto_increment + primary key, + token varchar(50) not null comment '钱包token', + status int default 1 not null comment '1:启用 2:禁用', + created_at timestamp null, + updated_at timestamp null, + deleted_at timestamp null +) + comment '钱包表'; + +create index wallet_address_token_index + on wallet_address (token); +``` +复制-粘贴至`phpmyadmin`的SQL面板,然后执行 +![导入Sql](img/run_sql.png) + +### 三、配置Epusdt +1.将编译好的`Epusdt`项目压缩包上传至刚刚新增的网站目录,随后解压。 +![网站目录](img/web_tree.png) +2.将`.env.example`重命名为`.env`文件,这个是配置文件 +3.编辑`.env`文件,填入你的配置 +```dotenv +app_name=epusdt +#下面配置你的域名,收银台会需要 +app_uri=https://upay.dujiaoka.com +#是否开启debug,默认false +app_debug=false +#http服务监听端口 +http_listen=:8000 + +#静态资源文件目录 +static_path=/static +#缓存路径 +runtime_root_path=/runtime + +#日志配置 +log_save_path=/logs +log_max_size=32 +log_max_age=7 +max_backups=3 + +# mysql配置 +mysql_host=127.0.0.1 +mysql_port=3306 +mysql_user=mysql账号 +mysql_passwd=mysql密码 +mysql_database=数据库 +mysql_table_prefix= +mysql_max_idle_conns=10 +mysql_max_open_conns=100 +mysql_max_life_time=6 + +# redis配置 +redis_host=127.0.0.1 +redis_port=6379 +redis_passwd= +redis_db=5 +redis_pool_size=5 +redis_max_retries=3 +redis_idle_timeout=1000 + +# 消息队列配置 +queue_concurrency=10 +queue_level_critical=6 +queue_level_default=3 +queue_level_low=1 + +#机器人Apitoken +tg_bot_token= +#telegram代理url(大陆地区服务器可使用一台国外服务器做反代tg的url),如果运行的本来就是境外服务器,则无需填写 +tg_proxy= +#管理员userid +tg_manage= + +#api接口认证token(用于发起交易的签名认证,请勿外泄) +api_auth_token= + +#订单过期时间(单位分钟) +order_expiration_time=10 + +#强制汇率(设置此参数后每笔交易将按照此汇率计算,例如:6.4) +forced_usdt_rate= +``` +4. ⚠️注意:配置文件里面不认识的不要修改,留空即可,不会改又要瞎改,除非你对项目源代码很熟悉很有信心😁 + +### 四、配置反向代理 +由于`Epusdt`会自动开启`http`服务并监听配置端口,所以可以直接用ip访问,例如: `http://127.0.0.1:8000`。 +这会显得非常不美观,还没有https。 +所以我们需要借助nginx的`反向代理`来为`Epusdt`绑定一个域名 +点击`宝塔`->`网站`->点击刚刚新增网站的`设置`->反向代理设置 +![反向代理](img/fanxiang.png) + +### 五、赋予Epusdt执行权限 +`linux`服务器需要赋予`Epust`执行权限方可启动。 +1.通过`ssh`进入服务器终端 +2.进入`epusdt`可执行文件所在目录(目录位置可以参考宝塔面板的网站根目录) +3.执行命令```chmod +x epusdt```赋予权限(根据你的实际目录来,不用一比一抄我的,每个人的目录都不一样) +![执行权限](img/chmodx.png) + + +### 六、配置supervisor +为了保证`Epusdt`常驻后台运行,我们需要配置`supervisor`来实现进程监听 +打开`宝塔supervisor`,添加守护进程 +![supervisor](img/supervisor.png) +启动命令为:epusdt所在目录+epusdt执行文件+空格+http+空格+start(例如:`/www/wwwroot/upay/epusdt-dev/epusdt http start`) +出现如下图则代表成功: +![supervisor成功](img/supervisor_success.png) + +### 七、测试 +以上步骤完成无误后,进入`telegram`机器人🤖,如果机器人有反馈则代表运行正常! +![telegram机器人](img/epusdt_bot.png) + + +## 其他注意事项 +- 1.所有`.env`配置文件有了修改后都需要重启supervisor进程 +- 2.教程所示的目录均为参考,请勿1:1照抄,根据自己实际情况来 +- 3.`windows`与`linux`不同,`windows`请直接运行`epusdt.exe`即可,无需赋予执行权限 diff --git a/wiki/img/add_web.png b/wiki/img/add_web.png new file mode 100644 index 0000000..6860788 Binary files /dev/null and b/wiki/img/add_web.png differ diff --git a/wiki/img/chmodx.png b/wiki/img/chmodx.png new file mode 100644 index 0000000..bd75119 Binary files /dev/null and b/wiki/img/chmodx.png differ diff --git a/wiki/img/dujiaoka_epusdt.png b/wiki/img/dujiaoka_epusdt.png new file mode 100644 index 0000000..ba7cf87 Binary files /dev/null and b/wiki/img/dujiaoka_epusdt.png differ diff --git a/wiki/img/epusdt_bot.png b/wiki/img/epusdt_bot.png new file mode 100644 index 0000000..90224d7 Binary files /dev/null and b/wiki/img/epusdt_bot.png differ diff --git a/wiki/img/fanxiang.png b/wiki/img/fanxiang.png new file mode 100644 index 0000000..a7d0c72 Binary files /dev/null and b/wiki/img/fanxiang.png differ diff --git a/wiki/img/implementation_principle.jpg b/wiki/img/implementation_principle.jpg new file mode 100644 index 0000000..4d116ce Binary files /dev/null and b/wiki/img/implementation_principle.jpg differ diff --git a/wiki/img/run_sql.png b/wiki/img/run_sql.png new file mode 100644 index 0000000..f4c4aad Binary files /dev/null and b/wiki/img/run_sql.png differ diff --git a/wiki/img/sql.png b/wiki/img/sql.png new file mode 100644 index 0000000..843c6a1 Binary files /dev/null and b/wiki/img/sql.png differ diff --git a/wiki/img/supervisor.png b/wiki/img/supervisor.png new file mode 100644 index 0000000..a2a03f7 Binary files /dev/null and b/wiki/img/supervisor.png differ diff --git a/wiki/img/supervisor_success.png b/wiki/img/supervisor_success.png new file mode 100644 index 0000000..e3d0c05 Binary files /dev/null and b/wiki/img/supervisor_success.png differ diff --git a/wiki/img/usdt_thanks.jpeg b/wiki/img/usdt_thanks.jpeg new file mode 100644 index 0000000..9cc23d8 Binary files /dev/null and b/wiki/img/usdt_thanks.jpeg differ diff --git a/wiki/img/usdtlogo.png b/wiki/img/usdtlogo.png new file mode 100644 index 0000000..842ddc7 Binary files /dev/null and b/wiki/img/usdtlogo.png differ diff --git a/wiki/img/web_tree.png b/wiki/img/web_tree.png new file mode 100644 index 0000000..9528093 Binary files /dev/null and b/wiki/img/web_tree.png differ