chore: initial commit

This commit is contained in:
2024-04-16 22:27:52 +01:00
commit 531b5dabe2
194 changed files with 27071 additions and 0 deletions

1
.gitattributes vendored Normal file
View File

@@ -0,0 +1 @@
* text=auto

9
.gitignore vendored Normal file
View File

@@ -0,0 +1,9 @@
*.exe
*.exe~
*.dll
*.so
*.dylib
*.test
*.out
go.work
*.env

660
LICENSE Normal file
View File

@@ -0,0 +1,660 @@
GNU AFFERO GENERAL PUBLIC LICENSE
Version 3, 19 November 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU Affero General Public License is a free, copyleft license for
software and other kinds of works, specifically designed to ensure
cooperation with the community in the case of network server software.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
our General Public Licenses are 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.
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.
Developers that use our General Public Licenses protect your rights
with two steps: (1) assert copyright on the software, and (2) offer
you this License which gives you legal permission to copy, distribute
and/or modify the software.
A secondary benefit of defending all users' freedom is that
improvements made in alternate versions of the program, if they
receive widespread use, become available for other developers to
incorporate. Many developers of free software are heartened and
encouraged by the resulting cooperation. However, in the case of
software used on network servers, this result may fail to come about.
The GNU General Public License permits making a modified version and
letting the public access it on a server without ever releasing its
source code to the public.
The GNU Affero General Public License is designed specifically to
ensure that, in such cases, the modified source code becomes available
to the community. It requires the operator of a network server to
provide the source code of the modified version running there to the
users of that server. Therefore, public use of a modified version, on
a publicly accessible server, gives the public access to the source
code of the modified version.
An older license, called the Affero General Public License and
published by Affero, was designed to accomplish similar goals. This is
a different license, not a version of the Affero GPL, but Affero has
released a new version of the Affero GPL which permits relicensing under
this license.
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 Affero 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. Remote Network Interaction; Use with the GNU General Public License.
Notwithstanding any other provision of this License, if you modify the
Program, your modified version must prominently offer all users
interacting with it remotely through a computer network (if your version
supports such interaction) an opportunity to receive the Corresponding
Source of your version by providing access to the Corresponding Source
from a network server at no charge, through some standard or customary
means of facilitating copying of software. This Corresponding Source
shall include the Corresponding Source for any work covered by version 3
of the GNU General Public License that is incorporated pursuant to the
following paragraph.
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 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 work with which it is combined will remain governed by version
3 of the GNU General Public License.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU Affero 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 Affero 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 Affero 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 Affero 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) 2024 Declan Teevan
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero 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 Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If your software can interact with users remotely through a computer
network, you should also make sure that it provides a way for users to
get its source. For example, if your program is a web application, its
interface could display a "Source" link that leads users to an archive
of the code. There are many ways you could offer source, and different
solutions will be better for different programs; see section 13 for the
specific requirements.
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 AGPL, see
<https://www.gnu.org/licenses/>.

13
Makefile Normal file
View File

@@ -0,0 +1,13 @@
install-tools:
go install github.com/bufbuild/buf/cmd/buf@v1.27.2
go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@v4.17.0
generate-protobufs:
buf generate
format:
buf format -w
gofmt -w -s .
deploy-docker:
docker compose -f deploy/docker/compose.yaml -f deploy/docker/compose.override.yaml up --build

108
README.md Normal file
View File

@@ -0,0 +1,108 @@
# Stocklet
An event-driven microservices-based distributed e-commerce example application written in Golang. *(mouthful)*
## 📘 About
This project was originally built as an experiment with event-driven architecture. But I hope it can future serve as a beneficial demonstration of utilising the architecture and exemplify the implementation of some other miscellaneous microservice patterns.
Any ideas, suggestions or direct contributions to better conform with general and evolving industry practices are welcome and will be greatly appreciated, as I'd like for this project to evolve to the stage of being somewhat a reflection of a production-ready enterprise application.
⚠️ The application should be considered in the experimental prototype stage. Breaking changes can be expected between any future commits to this repo, in order to ease the development process and allow for clean refactoring of the project.
## 📝 Features
* Monorepository layout
* Microservice architecture
* Event-driven architecture
* Interfacing with services using gRPC
* User-facing RESTful HTTP APIs with gRPC-Gateway
* Distributed tracing with OpenTelemetry
* Transactional outbox pattern with Debezium
* API gateway pattern using Envoy
* Distributed transactions utilising the saga pattern
## 🗃️ Architecture
### 🔎 Overview
![Architecture Overview](/docs/imgs/overview.svg)
### 🧰 Technical Stack
#### Libraries, Frameworks and Tools
* API Tooling
* [google.golang.org/grpc](https://pkg.go.dev/google.golang.org/grpc)
* [github.com/grpc-ecosystem/grpc-gateway/v2](https://pkg.go.dev/github.com/grpc-ecosystem/grpc-gateway/v2)
* Client Libraries
* [go.opentelemetry.io/otel](https://pkg.go.dev/go.opentelemetry.io/otel)
* [github.com/twmb/franz-go](https://pkg.go.dev/github.com/twmb/franz-go)
* [github.com/jackc/pgx/v5](https://pkg.go.dev/github.com/jackc/pgx/v5)
* Protobuf Libraries
* [google.golang.org/protobuf](https://pkg.go.dev/google.golang.org/protobuf)
* [github.com/bufbuild/protovalidate-go](https://pkg.go.dev/github.com/bufbuild/protovalidate-go)
* Tools
* [plantuml.com](https://plantuml.com/)
* [github.com/bufbuild/buf/cmd/buf](https://buf.build/docs/installation)
* [github.com/golang-migrate/migrate/v4](https://pkg.go.dev/github.com/golang-migrate/migrate/v4#section-readme)
* Miscellaneous
* [golang.org/x/crypto/bcrypt](https://pkg.go.dev/golang.org/x/crypto/bcrypt)
* [github.com/rs/zerolog](https://pkg.go.dev/github.com/rs/zerolog)
* [github.com/lestrrat-go/jwx/v2](https://pkg.go.dev/github.com/lestrrat-go/jwx/v2)
* [github.com/doug-martin/goqu/v9](https://pkg.go.dev/github.com/doug-martin/goqu/v9)
#### Infrastructure
* Message Brokers
* [Kafka](https://hub.docker.com/r/bitnami/kafka)
* Databases
* [PostgreSQL](https://hub.docker.com/_/postgres)
* Miscellaneous
* [OpenTelemetry](https://opentelemetry.io/)
* [Envoy](https://www.envoyproxy.io/)
* [Debezium Connect](https://hub.docker.com/r/debezium/connect)
* Provisioning and Deployment
* [Docker](https://www.docker.com/) and [Docker Compose](https://docs.docker.com/compose/)
### 🧩 Services
| Name | gRPC (w/ Gateway) | Produces Events | Consumes Events |
| :-: | :-: | :-: | :-: |
| [auth](/internal/svc/auth/) | ✔️ | ❌ | ✔️ |
| [order](/internal/svc/order/) | ✔️ | ✔️ | ✔️ |
| [payment](/internal/svc/payment/) | ✔️ | ✔️ | ✔️ |
| [product](/internal/svc/product/) | ✔️ | ✔️ | ✔️ |
| [shipping](/internal/svc/shipping/) | ✔️ | ✔️ | ✔️ |
| [user](/internal/svc/user/) | ✔️ | ✔️ | ❌ |
| [warehouse](/internal/svc/warehouse/) | ✔️ | ✔️ | ✔️ |
Each service is prepared by a [``service-init``](/cmd/service-init/) container; a deployment responsible for performing any database migrations and configuring Debezium outbox connectors for that service.
### 📇 Events
The events are schemed and serialised using [protocol buffers](https://protobuf.dev/). They are dispatched using the [transactional outbox pattern](https://microservices.io/patterns/data/transactional-outbox.html), with [Debezium](https://debezium.io/) used as a relay to read and publish events from database outbox tables to the message broker.
Further documentation on the events can be found at [``/docs/EVENTS.md``](/docs/EVENTS.md)
## 💻 Deployment
### Using Docker
The application can be deployed using [Docker Compose](https://docs.docker.com/compose/) (with the compose files located in [``/deploy/docker/``](/deploy/docker/)). Ensure the correct configuration is in place by copying and removing ``.example`` from the end of the example environment files located in [``/deploy/configs/``](/deploy/configs/).
Deploy using the following command: ``docker compose -f deploy/docker/compose.yaml -f deploy/docker/compose.override.yaml up --build``
## 🧪 Contributing
If you like this project then please leave a ⭐ to show your support. All forms of feedback and contributions are welcome and greatly appreciated!
Have any [ideas for improvements?](/docs/ROADMAP.md) Please don't hesistate to [open an issue](https://github.com/hexolan/stocklet/issues/new) to discuss, or a [pull request](https://github.com/hexolan/stocklet/compare) with [enhancements](https://github.com/hexolan/stocklet/fork).
## 📓 License
This project is licensed under the [GNU Affero General Public License v3](/LICENSE).

23
buf.gen.yaml Normal file
View File

@@ -0,0 +1,23 @@
version: v1
plugins:
- plugin: buf.build/protocolbuffers/go:v1.31.0
out: internal/pkg/protogen
opt:
- paths=import
- module=github.com/hexolan/stocklet/internal/pkg/protogen
- plugin: buf.build/grpc/go:v1.3.0
out: internal/pkg/protogen
opt:
- paths=import
- module=github.com/hexolan/stocklet/internal/pkg/protogen
- plugin: buf.build/grpc-ecosystem/gateway:v2.18.0
out: internal/pkg/protogen
opt:
- paths=import
- module=github.com/hexolan/stocklet/internal/pkg/protogen
- plugin: buf.build/grpc-ecosystem/openapiv2:v2.18.0
out: schema/openapi
opt:
- output_format=yaml
- allow_merge=true
- merge_file_name=services

3
buf.work.yaml Normal file
View File

@@ -0,0 +1,3 @@
version: v1
directories:
- schema/protobufs

View File

@@ -0,0 +1,16 @@
FROM golang:1.22 AS build
WORKDIR /app
# Install required modules
COPY go.mod go.sum ./
RUN go mod download
# Build the service
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/auth-service ./cmd/auth-service
# Runtime Environment
FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/auth-service .
EXPOSE 90 9090
CMD ["./auth-service"]

View File

@@ -0,0 +1,3 @@
FROM envoyproxy/envoy:v1.28-latest
COPY envoy.yaml /etc/envoy/envoy.yaml
RUN chmod go+r /etc/envoy/envoy.yaml

View File

@@ -0,0 +1,190 @@
static_resources:
listeners:
- address:
socket_address:
address: 0.0.0.0
port_value: 80
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
codec_type: AUTO
stat_prefix: ingress_http
generate_request_id: true
tracing:
provider:
name: envoy.tracers.opentelemetry
typed_config:
"@type": type.googleapis.com/envoy.config.trace.v3.OpenTelemetryConfig
grpc_service:
envoy_grpc:
cluster_name: otel_collector
timeout: 0.5s
service_name: edge-gateway
route_config:
name: local_route
virtual_hosts:
- name: services
domains:
- "*"
routes:
- match:
prefix: /v1/auth/
route:
cluster: auth_service_gw
- match:
prefix: /v1/order/
route:
cluster: order_service_gw
- match:
prefix: /v1/payment/
route:
cluster: payment_service_gw
- match:
prefix: /v1/product/
route:
cluster: product_service_gw
- match:
prefix: /v1/shipping/
route:
cluster: shipping_service_gw
- match:
prefix: /v1/user/
route:
cluster: user_service_gw
- match:
prefix: /v1/warehouse/
route:
cluster: warehouse_service_gw
http_filters:
- name: envoy.filters.http.jwt_authn
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.jwt_authn.v3.JwtAuthentication
providers:
default_provider:
remote_jwks:
http_uri:
uri: http://auth-service:90/v1/auth/jwks
cluster: auth_service_gw
timeout: 1s
cache_duration:
seconds: 300
from_headers:
- name: Authorization
forward: true
forward_payload_header: x-jwt-payload
rules:
- match:
prefix: /
requires:
requires_any:
requirements:
- provider_name: default_provider
- allow_missing: {}
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- name: otel_collector
type: STRICT_DNS
lb_policy: ROUND_ROBIN
typed_extension_protocol_options:
envoy.extensions.upstreams.http.v3.HttpProtocolOptions:
"@type": type.googleapis.com/envoy.extensions.upstreams.http.v3.HttpProtocolOptions
explicit_http_config:
http2_protocol_options: {}
load_assignment:
cluster_name: otel_collector
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: otel-collector
port_value: 4317
- name: auth_service_gw
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: auth_service_gw
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: auth-service
port_value: 90
- name: order_service_gw
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: order_service_gw
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: order-service
port_value: 90
- name: payment_service_gw
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: payment_service_gw
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: payment-service
port_value: 90
- name: product_service_gw
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: product_service_gw
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: product-service
port_value: 90
- name: shipping_service_gw
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: shipping_service_gw
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: shipping-service
port_value: 90
- name: user_service_gw
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: user_service_gw
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: user-service
port_value: 90
- name: warehouse_service_gw
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: warehouse_service_gw
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address:
address: warehouse-service
port_value: 90

View File

@@ -0,0 +1,16 @@
FROM golang:1.22 AS build
WORKDIR /app
# Install required modules
COPY go.mod go.sum ./
RUN go mod download
# Build the service
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/order-service ./cmd/order-service
# Runtime Environment
FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/order-service .
EXPOSE 90 9090
CMD ["./order-service"]

View File

@@ -0,0 +1,2 @@
FROM otel/opentelemetry-collector-contrib:0.90.1
COPY config.yaml /etc/otelcol-contrib/config.yaml

View File

@@ -0,0 +1,23 @@
receivers:
otlp:
protocols:
grpc:
http:
exporters:
debug:
verbosity: detailed
processors:
batch:
service:
pipelines:
traces:
receivers: [otlp]
processors: [batch]
exporters: [debug]
metrics:
receivers: [otlp]
processors: [batch]
exporters: [debug]

View File

@@ -0,0 +1,16 @@
FROM golang:1.22 AS build
WORKDIR /app
# Install required modules
COPY go.mod go.sum ./
RUN go mod download
# Build the service
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/payment-service ./cmd/payment-service
# Runtime Environment
FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/payment-service .
EXPOSE 90 9090
CMD ["./payment-service"]

View File

@@ -0,0 +1,16 @@
FROM golang:1.22 AS build
WORKDIR /app
# Install required modules
COPY go.mod go.sum ./
RUN go mod download
# Build the service
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/product-service ./cmd/product-service
# Runtime Environment
FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/product-service .
EXPOSE 90 9090
CMD ["./product-service"]

View File

@@ -0,0 +1,15 @@
FROM golang:1.22 AS build
WORKDIR /app
# Install required modules
COPY go.mod go.sum ./
RUN go mod download
# Build the service
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/service-init ./cmd/service-init
# Runtime Environment
FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/service-init .
CMD ["./service-init"]

View File

@@ -0,0 +1,16 @@
FROM golang:1.22 AS build
WORKDIR /app
# Install required modules
COPY go.mod go.sum ./
RUN go mod download
# Build the service
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/shipping-service ./cmd/shipping-service
# Runtime Environment
FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/shipping-service .
EXPOSE 90 9090
CMD ["./shipping-service"]

View File

@@ -0,0 +1,16 @@
FROM golang:1.22 AS build
WORKDIR /app
# Install required modules
COPY go.mod go.sum ./
RUN go mod download
# Build the service
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/user-service ./cmd/user-service
# Runtime Environment
FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/user-service .
EXPOSE 90 9090
CMD ["./user-service"]

View File

@@ -0,0 +1,16 @@
FROM golang:1.22 AS build
WORKDIR /app
# Install required modules
COPY go.mod go.sum ./
RUN go mod download
# Build the service
COPY . .
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o /bin/warehouse-service ./cmd/warehouse-service
# Runtime Environment
FROM gcr.io/distroless/static-debian12
COPY --from=build /bin/warehouse-service .
EXPOSE 90 9090
CMD ["./warehouse-service"]

99
cmd/auth-service/main.go Normal file
View File

@@ -0,0 +1,99 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/rs/zerolog/log"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/hexolan/stocklet/internal/pkg/messaging"
"github.com/hexolan/stocklet/internal/pkg/metrics"
"github.com/hexolan/stocklet/internal/pkg/serve"
"github.com/hexolan/stocklet/internal/pkg/storage"
"github.com/hexolan/stocklet/internal/svc/auth"
"github.com/hexolan/stocklet/internal/svc/auth/api"
"github.com/hexolan/stocklet/internal/svc/auth/controller"
)
func loadConfig() *auth.ServiceConfig {
// Load the main service configuration
cfg, err := auth.NewServiceConfig()
if err != nil {
log.Panic().Err(err).Msg("")
}
// Configure metrics (logging and OTEL)
metrics.ConfigureLogger()
metrics.InitTracerProvider(&cfg.Shared.Otel, "auth")
return cfg
}
func usePostgresController(cfg *auth.ServiceConfig) (auth.StorageController, *pgxpool.Pool) {
// load the Postgres configuration
if err := cfg.Postgres.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Postgres connection
client, err := storage.NewPostgresConn(&cfg.Postgres)
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewPostgresController(client)
return controller, client
}
func useKafkaController(cfg *auth.ServiceConfig) (auth.ConsumerController, *kgo.Client) {
// load the Kafka configuration
if err := cfg.Kafka.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Kafka connection
client, err := messaging.NewKafkaConn(&cfg.Kafka, kgo.ConsumerGroup("auth-service"))
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewKafkaController(client)
return controller, client
}
func main() {
cfg := loadConfig()
// Create the storage controller
store, storeCl := usePostgresController(cfg)
defer storeCl.Close()
// Create the service (& API interfaces)
svc := auth.NewAuthService(cfg, store)
grpcSvr := api.PrepareGrpc(cfg, svc)
gatewayMux := api.PrepareGateway(cfg)
// Create the consumer
consumer, consCl := useKafkaController(cfg)
defer consCl.Close()
consumer.Attach(svc)
// Serve the API interfaces
go consumer.Start()
go serve.Gateway(gatewayMux)
serve.Grpc(grpcSvr)
}

99
cmd/order-service/main.go Normal file
View File

@@ -0,0 +1,99 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/rs/zerolog/log"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/hexolan/stocklet/internal/pkg/messaging"
"github.com/hexolan/stocklet/internal/pkg/metrics"
"github.com/hexolan/stocklet/internal/pkg/serve"
"github.com/hexolan/stocklet/internal/pkg/storage"
"github.com/hexolan/stocklet/internal/svc/order"
"github.com/hexolan/stocklet/internal/svc/order/api"
"github.com/hexolan/stocklet/internal/svc/order/controller"
)
func loadConfig() *order.ServiceConfig {
// Load the core service configuration
cfg, err := order.NewServiceConfig()
if err != nil {
log.Panic().Err(err).Msg("")
}
// Configure metrics (logging and OTEL)
metrics.ConfigureLogger()
metrics.InitTracerProvider(&cfg.Shared.Otel, "order")
return cfg
}
func usePostgresController(cfg *order.ServiceConfig) (order.StorageController, *pgxpool.Pool) {
// load the Postgres configuration
if err := cfg.Postgres.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Postgres connection
client, err := storage.NewPostgresConn(&cfg.Postgres)
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewPostgresController(client)
return controller, client
}
func useKafkaController(cfg *order.ServiceConfig) (order.ConsumerController, *kgo.Client) {
// load the Kafka configuration
if err := cfg.Kafka.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Kafka connection
client, err := messaging.NewKafkaConn(&cfg.Kafka, kgo.ConsumerGroup("order-service"))
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewKafkaController(client)
return controller, client
}
func main() {
cfg := loadConfig()
// Create the storage controller
store, storeCl := usePostgresController(cfg)
defer storeCl.Close()
// Create the service (& API interfaces)
svc := order.NewOrderService(cfg, store)
grpcSvr := api.PrepareGrpc(cfg, svc)
gatewayMux := api.PrepareGateway(cfg)
// Create the consumer
consumer, consCl := useKafkaController(cfg)
defer consCl.Close()
consumer.Attach(svc)
// Serve/start the interfaces
go consumer.Start()
go serve.Gateway(gatewayMux)
serve.Grpc(grpcSvr)
}

View File

@@ -0,0 +1,99 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/rs/zerolog/log"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/hexolan/stocklet/internal/pkg/messaging"
"github.com/hexolan/stocklet/internal/pkg/metrics"
"github.com/hexolan/stocklet/internal/pkg/serve"
"github.com/hexolan/stocklet/internal/pkg/storage"
"github.com/hexolan/stocklet/internal/svc/payment"
"github.com/hexolan/stocklet/internal/svc/payment/api"
"github.com/hexolan/stocklet/internal/svc/payment/controller"
)
func loadConfig() *payment.ServiceConfig {
// Load the core service configuration
cfg, err := payment.NewServiceConfig()
if err != nil {
log.Panic().Err(err).Msg("")
}
// Configure metrics (logging and OTEL)
metrics.ConfigureLogger()
metrics.InitTracerProvider(&cfg.Shared.Otel, "payment")
return cfg
}
func usePostgresController(cfg *payment.ServiceConfig) (payment.StorageController, *pgxpool.Pool) {
// load the Postgres configuration
if err := cfg.Postgres.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Postgres connection
client, err := storage.NewPostgresConn(&cfg.Postgres)
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewPostgresController(client)
return controller, client
}
func useKafkaController(cfg *payment.ServiceConfig) (payment.ConsumerController, *kgo.Client) {
// load the Kafka configuration
if err := cfg.Kafka.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Kafka connection
client, err := messaging.NewKafkaConn(&cfg.Kafka, kgo.ConsumerGroup("payment-service"))
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewKafkaController(client)
return controller, client
}
func main() {
cfg := loadConfig()
// Create the storage controller
store, storeCl := usePostgresController(cfg)
defer storeCl.Close()
// Create the service (& API interfaces)
svc := payment.NewPaymentService(cfg, store)
grpcSvr := api.PrepareGrpc(cfg, svc)
gatewayMux := api.PrepareGateway(cfg)
// Create the consumer
consumer, consCl := useKafkaController(cfg)
defer consCl.Close()
consumer.Attach(svc)
// Serve/start the interfaces
go consumer.Start()
go serve.Gateway(gatewayMux)
serve.Grpc(grpcSvr)
}

View File

@@ -0,0 +1,99 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/rs/zerolog/log"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/hexolan/stocklet/internal/pkg/messaging"
"github.com/hexolan/stocklet/internal/pkg/metrics"
"github.com/hexolan/stocklet/internal/pkg/serve"
"github.com/hexolan/stocklet/internal/pkg/storage"
"github.com/hexolan/stocklet/internal/svc/product"
"github.com/hexolan/stocklet/internal/svc/product/api"
"github.com/hexolan/stocklet/internal/svc/product/controller"
)
func loadConfig() *product.ServiceConfig {
// Load the core service configuration
cfg, err := product.NewServiceConfig()
if err != nil {
log.Panic().Err(err).Msg("")
}
// Configure metrics (logging and OTEL)
metrics.ConfigureLogger()
metrics.InitTracerProvider(&cfg.Shared.Otel, "product")
return cfg
}
func usePostgresController(cfg *product.ServiceConfig) (product.StorageController, *pgxpool.Pool) {
// load the Postgres configuration
if err := cfg.Postgres.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Postgres connection
client, err := storage.NewPostgresConn(&cfg.Postgres)
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewPostgresController(client)
return controller, client
}
func useKafkaController(cfg *product.ServiceConfig) (product.ConsumerController, *kgo.Client) {
// load the Kafka configuration
if err := cfg.Kafka.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Kafka connection
client, err := messaging.NewKafkaConn(&cfg.Kafka, kgo.ConsumerGroup("product-service"))
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewKafkaController(client)
return controller, client
}
func main() {
cfg := loadConfig()
// Create the storage controller
store, storeCl := usePostgresController(cfg)
defer storeCl.Close()
// Create the service (& API interfaces)
svc := product.NewProductService(cfg, store)
grpcSvr := api.PrepareGrpc(cfg, svc)
gatewayMux := api.PrepareGateway(cfg)
// Create the consumer
consumer, consCl := useKafkaController(cfg)
defer consCl.Close()
consumer.Attach(svc)
// Serve/start the interfaces
go consumer.Start()
go serve.Gateway(gatewayMux)
serve.Grpc(grpcSvr)
}

View File

@@ -0,0 +1,63 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/hexolan/stocklet/internal/pkg/config"
)
// Init Container Configuration
type InitConfig struct {
// Name of the service (e.g. 'auth' or 'order')
//
// Env Var: "INIT_SVC_NAME"
ServiceName string
// Env Var: "INIT_MIGRATIONS" (optional. accepts 'false')
// Defaults to true
ApplyMigrations bool
// 'ApplyDebezium' will default to false unless
// the debezium host is provided.
//
// Env Var: "INIT_DEBEZIUM_HOST" (optional)
// e.g. "http://debezium:8083"
ApplyDebezium bool
DebeziumHost string
}
func (opts *InitConfig) Load() error {
// ServiceName
opt, err := config.RequireFromEnv("INIT_SVC_NAME")
if err != nil {
return err
}
opts.ServiceName = opt
// ApplyMigrations
opts.ApplyMigrations = true
if opt, _ := config.RequireFromEnv("INIT_MIGRATIONS"); opt == "false" {
opts.ApplyMigrations = false
}
// ApplyDebezium and DebeziumHost
if opt, err := config.RequireFromEnv("INIT_DEBEZIUM_HOST"); err == nil {
opts.ApplyDebezium = true
opts.DebeziumHost = opt
}
return nil
}

View File

@@ -0,0 +1,67 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"bytes"
"encoding/json"
"net/http"
"github.com/rs/zerolog/log"
"github.com/hexolan/stocklet/internal/pkg/config"
)
func applyPostgresOutbox(cfg *InitConfig, conf *config.PostgresConfig) {
payloadB, err := json.Marshal(map[string]string{
"connector.class": "io.debezium.connector.postgresql.PostgresConnector",
"plugin.name": "pgoutput",
"tasks.max": "1",
"table.include.list": "public.event_outbox",
"transforms": "outbox",
"transforms.outbox.type": "io.debezium.transforms.outbox.EventRouter",
"transforms.outbox.route.topic.replacement": "${routedByValue}",
"value.converter": "io.debezium.converters.BinaryDataConverter",
"topic.prefix": cfg.ServiceName,
"database.hostname": conf.Host,
"database.port": conf.Port,
"database.user": conf.Username,
"database.password": conf.Password,
"database.dbname": conf.Database,
})
if err != nil {
log.Panic().Err(err).Msg("debezium connect: failed to marshal debezium cfg")
}
url := cfg.DebeziumHost + "/connectors/" + cfg.ServiceName + "-outbox/config"
log.Info().Str("url", url).Msg("debezium url")
req, err := http.NewRequest(
"PUT",
url,
bytes.NewReader(payloadB),
)
req.Header.Set("Accept", "application/json")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
res, err := client.Do(req)
if err != nil {
log.Panic().Err(err).Msg("debezium connect: failed to perform debezium request")
}
log.Info().Str("status", res.Status).Msg("debezium connect: applied outbox config")
}

52
cmd/service-init/main.go Normal file
View File

@@ -0,0 +1,52 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/rs/zerolog/log"
"github.com/hexolan/stocklet/internal/pkg/config"
)
func main() {
// Load the init container cfg options
cfg := InitConfig{}
if err := cfg.Load(); err != nil {
log.Panic().Err(err).Msg("missing required configuration")
}
// If migrations or debezium are enabled,
// then a database configuration will be required.
if cfg.ApplyMigrations || cfg.ApplyDebezium {
// Support for dynamic loading of configuration
// (e.g. mongo config instead of postgres config)
pgConf := config.PostgresConfig{}
if err := pgConf.Load(); err == nil {
// Using postgres as a database.
if cfg.ApplyMigrations {
applyPostgresMigrations(&pgConf)
}
if cfg.ApplyDebezium {
applyPostgresOutbox(&cfg, &pgConf)
}
} else {
log.Panic().Msg("unable to load any db configs (unable to perform migrations or apply connector cfgs)")
}
}
log.Info().Str("svc", cfg.ServiceName).Msg("completed init for service")
}

View File

@@ -0,0 +1,43 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/golang-migrate/migrate/v4"
_ "github.com/golang-migrate/migrate/v4/database/postgres"
_ "github.com/golang-migrate/migrate/v4/source/file"
"github.com/rs/zerolog/log"
"github.com/hexolan/stocklet/internal/pkg/config"
)
func applyPostgresMigrations(conf *config.PostgresConfig) {
m, err := migrate.New("file:///migrations", conf.GetDSN())
if err != nil {
log.Panic().Err(err).Msg("migrate: failed to open client")
}
err = m.Up()
if err != nil {
if err.Error() == "no change" {
log.Info().Err(err).Msg("migrate: migrations up to date")
} else {
log.Panic().Err(err).Msg("migrate: raised when performing db migration")
}
}
log.Info().Msg("migrate: succesfully performed postgres migrations")
}

View File

@@ -0,0 +1,99 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/rs/zerolog/log"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/hexolan/stocklet/internal/pkg/messaging"
"github.com/hexolan/stocklet/internal/pkg/metrics"
"github.com/hexolan/stocklet/internal/pkg/serve"
"github.com/hexolan/stocklet/internal/pkg/storage"
"github.com/hexolan/stocklet/internal/svc/shipping"
"github.com/hexolan/stocklet/internal/svc/shipping/api"
"github.com/hexolan/stocklet/internal/svc/shipping/controller"
)
func loadConfig() *shipping.ServiceConfig {
// Load the core service configuration
cfg, err := shipping.NewServiceConfig()
if err != nil {
log.Panic().Err(err).Msg("")
}
// Configure metrics (logging and OTEL)
metrics.ConfigureLogger()
metrics.InitTracerProvider(&cfg.Shared.Otel, "shipping")
return cfg
}
func usePostgresController(cfg *shipping.ServiceConfig) (shipping.StorageController, *pgxpool.Pool) {
// load the Postgres configuration
if err := cfg.Postgres.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Postgres connection
client, err := storage.NewPostgresConn(&cfg.Postgres)
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewPostgresController(client)
return controller, client
}
func useKafkaController(cfg *shipping.ServiceConfig) (shipping.ConsumerController, *kgo.Client) {
// load the Kafka configuration
if err := cfg.Kafka.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Kafka connection
client, err := messaging.NewKafkaConn(&cfg.Kafka, kgo.ConsumerGroup("shipping-service"))
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewKafkaController(client)
return controller, client
}
func main() {
cfg := loadConfig()
// Create the storage controller
store, storeCl := usePostgresController(cfg)
defer storeCl.Close()
// Create the service (& API interfaces)
svc := shipping.NewShippingService(cfg, store)
grpcSvr := api.PrepareGrpc(cfg, svc)
gatewayMux := api.PrepareGateway(cfg)
// Create the consumer
consumer, consCl := useKafkaController(cfg)
defer consCl.Close()
consumer.Attach(svc)
// Serve/start the interfaces
go consumer.Start()
go serve.Gateway(gatewayMux)
serve.Grpc(grpcSvr)
}

75
cmd/user-service/main.go Normal file
View File

@@ -0,0 +1,75 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/rs/zerolog/log"
"github.com/hexolan/stocklet/internal/pkg/metrics"
"github.com/hexolan/stocklet/internal/pkg/serve"
"github.com/hexolan/stocklet/internal/pkg/storage"
"github.com/hexolan/stocklet/internal/svc/user"
"github.com/hexolan/stocklet/internal/svc/user/api"
"github.com/hexolan/stocklet/internal/svc/user/controller"
)
func loadConfig() *user.ServiceConfig {
// Load the core service configuration
cfg, err := user.NewServiceConfig()
if err != nil {
log.Panic().Err(err).Msg("")
}
// Configure metrics (logging and OTEL)
metrics.ConfigureLogger()
metrics.InitTracerProvider(&cfg.Shared.Otel, "user")
return cfg
}
func usePostgresController(cfg *user.ServiceConfig) (user.StorageController, *pgxpool.Pool) {
// load the Postgres configuration
if err := cfg.Postgres.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Postgres connection
client, err := storage.NewPostgresConn(&cfg.Postgres)
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewPostgresController(client, &cfg.ServiceOpts)
return controller, client
}
func main() {
cfg := loadConfig()
// Create the storage controller
store, storeCl := usePostgresController(cfg)
defer storeCl.Close()
// Create the service (& API interfaces)
svc := user.NewUserService(cfg, store)
grpcSvr := api.PrepareGrpc(cfg, svc)
gatewayMux := api.PrepareGateway(cfg)
// Serve/start the interfaces
go serve.Gateway(gatewayMux)
serve.Grpc(grpcSvr)
}

View File

@@ -0,0 +1,99 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package main
import (
"github.com/jackc/pgx/v5/pgxpool"
"github.com/rs/zerolog/log"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/hexolan/stocklet/internal/pkg/messaging"
"github.com/hexolan/stocklet/internal/pkg/metrics"
"github.com/hexolan/stocklet/internal/pkg/serve"
"github.com/hexolan/stocklet/internal/pkg/storage"
"github.com/hexolan/stocklet/internal/svc/warehouse"
"github.com/hexolan/stocklet/internal/svc/warehouse/api"
"github.com/hexolan/stocklet/internal/svc/warehouse/controller"
)
func loadConfig() *warehouse.ServiceConfig {
// Load the core service configuration
cfg, err := warehouse.NewServiceConfig()
if err != nil {
log.Panic().Err(err).Msg("")
}
// Configure metrics (logging and OTEL)
metrics.ConfigureLogger()
metrics.InitTracerProvider(&cfg.Shared.Otel, "warehouse")
return cfg
}
func usePostgresController(cfg *warehouse.ServiceConfig) (warehouse.StorageController, *pgxpool.Pool) {
// load the Postgres configuration
if err := cfg.Postgres.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Postgres connection
client, err := storage.NewPostgresConn(&cfg.Postgres)
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewPostgresController(client)
return controller, client
}
func useKafkaController(cfg *warehouse.ServiceConfig) (warehouse.ConsumerController, *kgo.Client) {
// load the Kafka configuration
if err := cfg.Kafka.Load(); err != nil {
log.Panic().Err(err).Msg("")
}
// open a Kafka connection
client, err := messaging.NewKafkaConn(&cfg.Kafka, kgo.ConsumerGroup("warehouse-service"))
if err != nil {
log.Panic().Err(err).Msg("")
}
controller := controller.NewKafkaController(client)
return controller, client
}
func main() {
cfg := loadConfig()
// Create the storage controller
store, storeCl := usePostgresController(cfg)
defer storeCl.Close()
// Create the service (& API interfaces)
svc := warehouse.NewWarehouseService(cfg, store)
grpcSvr := api.PrepareGrpc(cfg, svc)
gatewayMux := api.PrepareGateway(cfg)
// Create the consumer
consumer, consCl := useKafkaController(cfg)
defer consCl.Close()
consumer.Attach(svc)
// Serve/start the interfaces
go consumer.Start()
go serve.Gateway(gatewayMux)
serve.Grpc(grpcSvr)
}

View File

@@ -0,0 +1,8 @@
INIT_SVC_NAME=auth
INIT_MIGRATIONS=true
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=auth-service-postgres
PG_PORT=5432

View File

@@ -0,0 +1,13 @@
MODE=dev
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=auth-service-postgres
PG_PORT=5432
KAFKA_BROKERS=kafka:19092
OTEL_COLLECTOR_GRPC=otel-collector:4317
# base64 encoded EC256/EC512 private key
AUTH_PRIVATE_KEY=LS0tLS1CRUdJTiBFQyBQUklWQVRFIEtFWS0tLS0tCk1IY0NBUUVFSUJ5RHBLV1pHS3YxNDdvZGlUR2N4V0l0NWxEbEtRQW5zdDZQQkw3bUNGMFJvQW9HQ0NxR1NNNDkKQXdFSG9VUURRZ0FFbUM0UVdtek1ta3lkT0xMZUxYdHVIa3RqVGtQZzM5djRkSnNFZEhGcGdQM1M0ZXp4a2ZYaApmSVZiQlR6OXA4OFFBSkRsL0ZOVFFjUXFUYlZ2bCsybE9RPT0KLS0tLS1FTkQgRUMgUFJJVkFURSBLRVktLS0tLQ==

View File

@@ -0,0 +1,9 @@
INIT_SVC_NAME=order
INIT_MIGRATIONS=true
INIT_DEBEZIUM_HOST=http://debezium:8083
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=order-service-postgres
PG_PORT=5432

View File

@@ -0,0 +1,10 @@
MODE=dev
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=order-service-postgres
PG_PORT=5432
KAFKA_BROKERS=kafka:19092
OTEL_COLLECTOR_GRPC=otel-collector:4317

View File

@@ -0,0 +1,9 @@
INIT_SVC_NAME=payment
INIT_MIGRATIONS=true
INIT_DEBEZIUM_HOST=http://debezium:8083
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=payment-service-postgres
PG_PORT=5432

View File

@@ -0,0 +1,10 @@
MODE=dev
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=payment-service-postgres
PG_PORT=5432
KAFKA_BROKERS=kafka:19092
OTEL_COLLECTOR_GRPC=otel-collector:4317

View File

@@ -0,0 +1,9 @@
INIT_SVC_NAME=product
INIT_MIGRATIONS=true
INIT_DEBEZIUM_HOST=http://debezium:8083
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=product-service-postgres
PG_PORT=5432

View File

@@ -0,0 +1,10 @@
MODE=dev
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=product-service-postgres
PG_PORT=5432
KAFKA_BROKERS=kafka:19092
OTEL_COLLECTOR_GRPC=otel-collector:4317

View File

@@ -0,0 +1,9 @@
INIT_SVC_NAME=shipping
INIT_MIGRATIONS=true
INIT_DEBEZIUM_HOST=http://debezium:8083
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=shipping-service-postgres
PG_PORT=5432

View File

@@ -0,0 +1,10 @@
MODE=dev
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=shipping-service-postgres
PG_PORT=5432
KAFKA_BROKERS=kafka:19092
OTEL_COLLECTOR_GRPC=otel-collector:4317

View File

@@ -0,0 +1,9 @@
INIT_SVC_NAME=user
INIT_MIGRATIONS=true
INIT_DEBEZIUM_HOST=http://debezium:8083
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=user-service-postgres
PG_PORT=5432

View File

@@ -0,0 +1,12 @@
MODE=dev
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=user-service-postgres
PG_PORT=5432
KAFKA_BROKERS=kafka:19092
OTEL_COLLECTOR_GRPC=otel-collector:4317
AUTH_SERVICE_GRPC=auth-service:9090

View File

@@ -0,0 +1,9 @@
INIT_SVC_NAME=warehouse
INIT_MIGRATIONS=true
INIT_DEBEZIUM_HOST=http://debezium:8083
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=warehouse-service-postgres
PG_PORT=5432

View File

@@ -0,0 +1,10 @@
MODE=dev
PG_DB=postgres
PG_USER=postgres
PG_PASS=postgres
PG_HOST=warehouse-service-postgres
PG_PORT=5432
KAFKA_BROKERS=kafka:19092
OTEL_COLLECTOR_GRPC=otel-collector:4317

View File

@@ -0,0 +1,63 @@
services:
# Services
auth-service:
ports:
- 91:90
- 9091:9090
order-service:
ports:
- 92:90
- 9092:9090
payment-service:
ports:
- 93:90
- 9093:9090
product-service:
ports:
- 94:90
- 9094:9090
shipping-service:
ports:
- 95:90
- 9095:9090
user-service:
ports:
- 96:90
- 9096:9090
warehouse-service:
ports:
- 97:90
- 9097:9090
# Development Utilities
dev-kafka-ui:
image: provectuslabs/kafka-ui:latest
restart: unless-stopped
environment:
KAFKA_CLUSTERS_0_NAME: "kafka"
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: "kafka:19092"
DYNAMIC_CONFIG_ENABLED: "true"
ports:
- 8080:8080
networks:
- stocklet-network
dev-adminer:
image: adminer:latest
restart: unless-stopped
ports:
- 8081:8080
networks:
- stocklet-auth-network
- stocklet-order-network
- stocklet-payment-network
- stocklet-product-network
- stocklet-shipping-network
- stocklet-user-network
- stocklet-warehouse-network

479
deploy/docker/compose.yaml Normal file
View File

@@ -0,0 +1,479 @@
services:
# Infrastructure
edge-gateway:
image: stocklet/edge-gateway
build:
context: ../../build/edge-gateway
ports:
- 80:80
depends_on:
- otel-collector
networks:
- stocklet-network
otel-collector:
image: stocklet/otel-collector
build:
context: ../../build/otel-collector
networks:
- stocklet-network
kafka:
image: bitnami/kafka:3.4
restart: unless-stopped
environment:
- KAFKA_CFG_NODE_ID=0
- KAFKA_CFG_PROCESS_ROLES=controller,broker
- KAFKA_CFG_LISTENERS=CONTROLLER://:19093,INTERNAL://:19092,EXTERNAL://:9092
- KAFKA_CFG_ADVERTISED_LISTENERS=INTERNAL://kafka:19092,EXTERNAL://localhost:9092
- KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP=CONTROLLER:PLAINTEXT,INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
- KAFKA_CFG_CONTROLLER_QUORUM_VOTERS=0@kafka:19093
- KAFKA_CFG_INTER_BROKER_LISTENER_NAME=INTERNAL
- KAFKA_CFG_CONTROLLER_LISTENER_NAMES=CONTROLLER
- KAFKA_KRAFT_CLUSTER_ID=g9rbXaCaSGqB3CURPeEvTA
healthcheck:
test: ["CMD-SHELL", "kafka-topics.sh --bootstrap-server localhost:9092 --list"]
interval: 10s
timeout: 5s
retries: 5
start_period: 30s
depends_on:
- otel-collector
volumes:
- stocklet-kafka-volume:/bitnami/kafka
networks:
- stocklet-network
debezium:
image: debezium/connect:latest
restart: unless-stopped
environment:
- GROUP_ID=0
- BOOTSTRAP_SERVERS=kafka:19092
- CONFIG_STORAGE_TOPIC=debezium-config
- STATUS_STORAGE_TOPIC=debezium-status
- OFFSET_STORAGE_TOPIC=debezium-offset
healthcheck:
test: ["CMD-SHELL", "curl --silent --fail -X GET http://localhost:8083/connectors"]
interval: 10s
timeout: 5s
retries: 10
start_period: 15s
depends_on:
kafka:
condition: service_healthy
order-service-postgres:
condition: service_healthy
networks:
- stocklet-network
- stocklet-order-network
- stocklet-payment-network
- stocklet-product-network
- stocklet-shipping-network
- stocklet-user-network
- stocklet-warehouse-network
# Services
auth-service:
image: stocklet/auth-service
build:
context: ../../
dockerfile: build/auth-service/Dockerfile
depends_on:
init-auth-service:
condition: service_completed_successfully
auth-service-postgres:
condition: service_healthy
kafka:
condition: service_healthy
env_file:
- ../configs/auth.env
networks:
- stocklet-network
- stocklet-auth-network
order-service:
image: stocklet/order-service
build:
context: ../../
dockerfile: build/order-service/Dockerfile
depends_on:
init-order-service:
condition: service_completed_successfully
order-service-postgres:
condition: service_healthy
kafka:
condition: service_healthy
env_file:
- ../configs/order.env
networks:
- stocklet-network
- stocklet-order-network
payment-service:
image: stocklet/payment-service
build:
context: ../../
dockerfile: build/payment-service/Dockerfile
depends_on:
init-payment-service:
condition: service_completed_successfully
payment-service-postgres:
condition: service_healthy
kafka:
condition: service_healthy
env_file:
- ../configs/payment.env
networks:
- stocklet-network
- stocklet-payment-network
product-service:
image: stocklet/product-service
build:
context: ../../
dockerfile: build/product-service/Dockerfile
depends_on:
init-product-service:
condition: service_completed_successfully
product-service-postgres:
condition: service_healthy
kafka:
condition: service_healthy
env_file:
- ../configs/product.env
networks:
- stocklet-network
- stocklet-product-network
shipping-service:
image: stocklet/shipping-service
build:
context: ../../
dockerfile: build/shipping-service/Dockerfile
depends_on:
init-shipping-service:
condition: service_completed_successfully
shipping-service-postgres:
condition: service_healthy
kafka:
condition: service_healthy
env_file:
- ../configs/shipping.env
networks:
- stocklet-network
- stocklet-shipping-network
user-service:
image: stocklet/user-service
build:
context: ../../
dockerfile: build/user-service/Dockerfile
depends_on:
init-user-service:
condition: service_completed_successfully
user-service-postgres:
condition: service_healthy
kafka:
condition: service_healthy
env_file:
- ../configs/user.env
networks:
- stocklet-network
- stocklet-user-network
warehouse-service:
image: stocklet/warehouse-service
build:
context: ../../
dockerfile: build/warehouse-service/Dockerfile
depends_on:
init-warehouse-service:
condition: service_completed_successfully
warehouse-service-postgres:
condition: service_healthy
kafka:
condition: service_healthy
env_file:
- ../configs/warehouse.env
networks:
- stocklet-network
- stocklet-warehouse-network
# Service Databases
auth-service-postgres:
image: postgres:16-bookworm
restart: unless-stopped
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 30s
timeout: 15s
retries: 3
start_period: 30s
command: ["postgres", "-c", "wal_level=logical"]
volumes:
- stocklet-auth-postgres-volume:/var/lib/postgresql
networks:
- stocklet-auth-network
order-service-postgres:
image: postgres:16-bookworm
restart: unless-stopped
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 30s
timeout: 15s
retries: 3
start_period: 30s
command: ["postgres", "-c", "wal_level=logical"]
volumes:
- stocklet-order-postgres-volume:/var/lib/postgresql
networks:
- stocklet-order-network
payment-service-postgres:
image: postgres:16-bookworm
restart: unless-stopped
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 30s
timeout: 15s
retries: 3
start_period: 30s
command: ["postgres", "-c", "wal_level=logical"]
volumes:
- stocklet-payment-postgres-volume:/var/lib/postgresql
networks:
- stocklet-payment-network
product-service-postgres:
image: postgres:16-bookworm
restart: unless-stopped
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 30s
timeout: 15s
retries: 3
start_period: 30s
command: ["postgres", "-c", "wal_level=logical"]
volumes:
- stocklet-product-postgres-volume:/var/lib/postgresql
networks:
- stocklet-product-network
shipping-service-postgres:
image: postgres:16-bookworm
restart: unless-stopped
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 30s
timeout: 15s
retries: 3
start_period: 30s
command: ["postgres", "-c", "wal_level=logical"]
volumes:
- stocklet-shipping-postgres-volume:/var/lib/postgresql
networks:
- stocklet-shipping-network
user-service-postgres:
image: postgres:16-bookworm
restart: unless-stopped
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 30s
timeout: 15s
retries: 3
start_period: 30s
command: ["postgres", "-c", "wal_level=logical"]
volumes:
- stocklet-user-postgres-volume:/var/lib/postgresql
networks:
- stocklet-user-network
warehouse-service-postgres:
image: postgres:16-bookworm
restart: unless-stopped
environment:
POSTGRES_DB: "postgres"
POSTGRES_USER: "postgres"
POSTGRES_PASSWORD: "postgres"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER -d $$POSTGRES_DB"]
interval: 30s
timeout: 15s
retries: 3
start_period: 30s
command: ["postgres", "-c", "wal_level=logical"]
volumes:
- stocklet-warehouse-postgres-volume:/var/lib/postgresql
networks:
- stocklet-warehouse-network
# Service Init Containers
init-auth-service:
image: stocklet/service-init
build:
context: ../../
dockerfile: build/service-init/Dockerfile
depends_on:
auth-service-postgres:
condition: service_healthy
env_file:
- ../configs/auth-init.env
volumes:
- ../../schema/sql/auth:/migrations
networks:
- stocklet-auth-network
init-order-service:
image: stocklet/service-init
build:
context: ../../
dockerfile: build/service-init/Dockerfile
depends_on:
debezium:
condition: service_healthy
order-service-postgres:
condition: service_healthy
env_file:
- ../configs/order-init.env
volumes:
- ../../schema/sql/order:/migrations
networks:
- stocklet-network
- stocklet-order-network
init-payment-service:
image: stocklet/service-init
build:
context: ../../
dockerfile: build/service-init/Dockerfile
depends_on:
debezium:
condition: service_healthy
payment-service-postgres:
condition: service_healthy
env_file:
- ../configs/payment-init.env
volumes:
- ../../schema/sql/payment:/migrations
networks:
- stocklet-network
- stocklet-payment-network
init-product-service:
image: stocklet/service-init
build:
context: ../../
dockerfile: build/service-init/Dockerfile
depends_on:
debezium:
condition: service_healthy
product-service-postgres:
condition: service_healthy
env_file:
- ../configs/product-init.env
volumes:
- ../../schema/sql/product:/migrations
networks:
- stocklet-network
- stocklet-product-network
init-shipping-service:
image: stocklet/service-init
build:
context: ../../
dockerfile: build/service-init/Dockerfile
depends_on:
debezium:
condition: service_healthy
shipping-service-postgres:
condition: service_healthy
env_file:
- ../configs/shipping-init.env
volumes:
- ../../schema/sql/shipping:/migrations
networks:
- stocklet-network
- stocklet-shipping-network
init-user-service:
image: stocklet/service-init
build:
context: ../../
dockerfile: build/service-init/Dockerfile
depends_on:
debezium:
condition: service_healthy
user-service-postgres:
condition: service_healthy
env_file:
- ../configs/user-init.env
volumes:
- ../../schema/sql/user:/migrations
networks:
- stocklet-network
- stocklet-user-network
init-warehouse-service:
image: stocklet/service-init
build:
context: ../../
dockerfile: build/service-init/Dockerfile
depends_on:
debezium:
condition: service_healthy
warehouse-service-postgres:
condition: service_healthy
env_file:
- ../configs/warehouse-init.env
volumes:
- ../../schema/sql/warehouse:/migrations
networks:
- stocklet-network
- stocklet-warehouse-network
networks:
stocklet-network:
stocklet-auth-network:
stocklet-order-network:
stocklet-payment-network:
stocklet-product-network:
stocklet-shipping-network:
stocklet-user-network:
stocklet-warehouse-network:
volumes:
stocklet-kafka-volume:
stocklet-auth-postgres-volume:
stocklet-order-postgres-volume:
stocklet-payment-postgres-volume:
stocklet-product-postgres-volume:
stocklet-shipping-postgres-volume:
stocklet-user-postgres-volume:
stocklet-warehouse-postgres-volume:

120
docs/EVENTS.md Normal file
View File

@@ -0,0 +1,120 @@
# Stocklet Docs: Events
## Table of Contents
* [Repository Overview](/README.md)
* [Documentation: Overview](/docs/README.md)
* [Documentation: Events](/docs/EVENTS.md)
* [Documentation: Feature Roadmap](/docs/ROADMAP.md)
## Overview
The events are schemed and serialised using [protocol buffers](https://protobuf.dev/). The events schemas can be found in [``/schema/protobufs/stocklet/events/``](/schema/protobufs/stocklet/events/)
They are dispatched using the [transactional outbox pattern](https://microservices.io/patterns/data/transactional-outbox.html). Debezium is used as a relay to publish events from database outbox tables to the message broker (Kafka). The Debezium connectors are configured by the ``service-init`` containers, which are also responsible for performing database migrations for their respective services.
## Services
### Auth Service
**Produces:**
* n/a
**Consumes:**
* UserDeletedEvent
### Order Service
**Produces:**
* OrderCreatedEvent
* OrderPendingEvent
* OrderRejectedEvent
* OrderApprovedEvent
**Consumes:**
* ProductPriceQuoteEvent
* StockReservationEvent
* ShipmentAllocationEvent
* PaymentProcessedEvent
### Payment Service
**Produces:**
* BalanceCreatedEvent
* BalanceCreditedEvent
* BalanceDebitedEvent
* BalanceClosedEvent
* TransactionLoggedEvent
* TransactionReversedEvent *(currently unused)*
* PaymentProcessedEvent
**Consumes:**
* UserCreatedEvent
* UserDeletedEvent
* ShipmentAllocationEvent
### Product Service
**Produces:**
* ProductCreatedEvent
* ProductPriceUpdatedEvent
* ProductDeletedEvent
* ProductPriceQuoteEvent
**Consumes:**
* OrderCreatedEvent
### Shipping Service
**Produces:**
* ShipmentAllocationEvent
* ShipmentDispatchedEvent *(currently unused)*
**Consumes:**
* StockReservationEvent
* PaymentProcessedEvent
### User Service
**Produces:**
* UserCreatedEvent
* UserEmailUpdatedEvent
* UserDeletedEvent
**Consumes:**
* n/a
### Warehouse Service
**Produces:**
* StockCreatedEvent
* StockAddedEvent *(currently unused)*
* StockRemovedEvent
* StockReservationEvent
**Consumes:**
* OrderPendingEvent
* ShipmentAllocationEvent
* PaymentProcessedEvent
## Miscellaneous
### Place Order Saga
The place order [saga](https://microservices.io/patterns/data/saga.html) is initiated when a new order is created.
![Place Order Saga](/docs/imgs/placeordersaga.svg)

18
docs/README.md Normal file
View File

@@ -0,0 +1,18 @@
# Stocklet Docs
## Table of Contents
* [Repository Overview](/README.md)
* [Documentation: Overview](/docs/README.md)
* [Documentation: Events](/docs/EVENTS.md)
* [Documentation: Feature Roadmap](/docs/ROADMAP.md)
## Formatting, styling, etc
The code has been formatted using [`gofmt`](https://pkg.go.dev/cmd/gofmt).
The protobuf schema files have been formatted using [`buf format`](https://buf.build/docs/reference/cli/buf/format).
The markdown files have been linted and formatted using [markdownlint](https://github.com/DavidAnson/markdownlint).
I used [PlantUML](https://plantuml.com/) as the tool to help make the diagrams. The PlantUML files are avaliable alongside the resulting images: [`/docs/imgs/overview.plantuml`](/docs/imgs/overview.plantuml) and [`/docs/imgs/placeordersaga.plantuml`](/docs/imgs/placeordersaga.plantuml)

35
docs/ROADMAP.md Normal file
View File

@@ -0,0 +1,35 @@
# Stocklet Docs: Feature Roadmap
## Table of Contents
* [Repository Overview](/README.md)
* [Documentation: Overview](/docs/README.md)
* [Documentation: Events](/docs/EVENTS.md)
* [Documentation: Feature Roadmap](/docs/ROADMAP.md)
## Prologue
This document should be considered a brainstorm of ideas.
There is no guarantee that I will implement any listed features or functionality below. After all, I initially made this application as an experiment with EDA, and there are areas that could use improvement and expansion (the application is a prototype in current format). Some of the current implemented functionality is quite bare-bones, so if I come to revisit this project at a later date this document is where I'd first look.
However, contributions are welcome; if you feel like implementing something (already below or not), or otherwise spot other areas that could use improvement, then please feel free to open an issue to discuss or a pull request with your implementation.
## Feature Ideas
* Front-end user interface
* Allow interfaces with the application through alternatives means
* Notification service
* Send notifications to users (e.g. through a mock email or a unread messages mechanism) upon reciept of events related to order status changes (i.e. OrderApprovedEvent)
* Product recommendation service
* Provide a list of recommended products catered to specific customers
## Miscellaneous Ideas
* Integration tests
* Ensured idempotency in event consumers (service-side)
* Clear-up of event processes
* Kubernetes deployment (prepare manifest files)
* Interchangable infrastructure
* Support for NATS as a message broker
* Support for MongoDB as a database

125
docs/imgs/overview.plantuml Normal file
View File

@@ -0,0 +1,125 @@
' Copyright (C) 2024 Declan Teevan
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero 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 Affero General Public License for more details.
'
' You should have received a copy of the GNU Affero General Public License
' along with this program. If not, see <https://www.gnu.org/licenses/>.
@startuml overview
!theme mars
cloud "API Gateway (Envoy)" as APIGateway
queue "Message Broker (Kafka)" as MsgBroker
collections "Message Relay (Debezium)" as OutboxConnector
database "Auth Database" as AuthDB
database "Order Database" as OrderDB
database "Payment Database" as PaymentDB
database "Product Database" as ProductDB
database "Shipping Database" as ShippingDB
database "User Database" as UserDB
database "Warehouse Database" as WarehouseDB
rectangle "Auth Service" as AuthService {
agent "gRPC Gateway" as AuthGateway
agent "Event Consumer" as AuthConsumer
usecase "gRPC Service" as AuthGrpc
AuthGrpc <-u- AuthGateway
AuthGrpc <-u- AuthConsumer
AuthGrpc --> AuthDB
}
rectangle "Order Service" as OrderService {
agent "gRPC Gateway" as OrderGateway
agent "Event Consumer" as OrderConsumer
usecase "gRPC Service" as OrderGrpc
OrderGrpc <-u- OrderGateway
OrderGrpc <-u- OrderConsumer
OrderGrpc --> OrderDB
}
rectangle "Payment Service" as PaymentService {
agent "gRPC Gateway" as PaymentGateway
agent "Event Consumer" as PaymentConsumer
usecase "gRPC Service" as PaymentGrpc
PaymentGrpc <-u- PaymentGateway
PaymentGrpc <-u- PaymentConsumer
PaymentGrpc --> PaymentDB
}
rectangle "Product Service" as ProductService {
agent "gRPC Gateway" as ProductGateway
agent "Event Consumer" as ProductConsumer
usecase "gRPC Service" as ProductGrpc
ProductGrpc <-u- ProductGateway
ProductGrpc <-u- ProductConsumer
ProductGrpc --> ProductDB
}
rectangle "Shipping Service" as ShippingService {
agent "gRPC Gateway" as ShippingGateway
agent "Event Consumer" as ShippingConsumer
usecase "gRPC Service" as ShippingGrpc
ShippingGrpc <-u- ShippingGateway
ShippingGrpc <-u- ShippingConsumer
ShippingGrpc --> ShippingDB
}
rectangle "User Service" as UserService {
agent "gRPC Gateway" as UserGateway
usecase "gRPC Service" as UserGrpc
UserGrpc <-u- UserGateway
UserGrpc --> UserDB
}
rectangle "Warehouse Service" as WarehouseService {
agent "gRPC Gateway" as WarehouseGateway
agent "Event Consumer" as WarehouseConsumer
usecase "gRPC Service" as WarehouseGrpc
WarehouseGrpc <-u- WarehouseGateway
WarehouseGrpc <-u- WarehouseConsumer
WarehouseGrpc --> WarehouseDB
}
APIGateway ....> AuthGateway : "HTTP"
APIGateway ....> OrderGateway : "HTTP"
APIGateway ....> PaymentGateway : "HTTP"
APIGateway ....> ProductGateway : "HTTP"
APIGateway ....> ShippingGateway : "HTTP"
APIGateway ....> UserGateway : "HTTP"
APIGateway ....> WarehouseGateway : "HTTP"
UserGrpc .l.> AuthGrpc : "gRPC "
AuthDB ---[hidden]> OutboxConnector
OrderDB ---> OutboxConnector : "Outbox"
PaymentDB ---> OutboxConnector : "Outbox"
ProductDB ---> OutboxConnector : "Outbox"
ShippingDB ---> OutboxConnector : "Outbox"
UserDB ---> OutboxConnector : "Outbox"
WarehouseDB ---> OutboxConnector : "Outbox"
OutboxConnector ..> MsgBroker : "Publish Events"
MsgBroker ...> AuthConsumer
MsgBroker ...> OrderConsumer
MsgBroker ...> PaymentConsumer
MsgBroker ...> ProductConsumer
MsgBroker ...> ShippingConsumer
MsgBroker ...> WarehouseConsumer
@enduml

235
docs/imgs/overview.svg Normal file
View File

@@ -0,0 +1,235 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg style="width:2273px;height:799px;background:#F9F9F9;" contentStyleType="text/css" preserveAspectRatio="none" version="1.1" viewBox="0 0 2273 799" width="2273px" height="799px" xmlns="http://www.w3.org/2000/svg" zoomAndPan="magnify">
<rect x="355" y="240.33" width="324" height="180.98" rx="3.5" ry="3.5" fill="none" stroke="#393939"/>
<text x="466.5" y="255.3255" fill="#aa0000" font-family="sans-serif" font-size="14" font-weight="bold" textLength="101">Auth Service</text>
<rect x="899" y="240.33" width="324" height="180.98" rx="3.5" ry="3.5" fill="none" stroke="#393939"/>
<text x="1006" y="255.3255" fill="#aa0000" font-family="sans-serif" font-size="14" font-weight="bold" textLength="110">Order Service</text>
<rect x="7" y="240.33" width="324" height="180.98" rx="3.5" ry="3.5" fill="none" stroke="#393939"/>
<text x="103" y="255.3255" fill="#aa0000" font-family="sans-serif" font-size="14" font-weight="bold" textLength="132">Payment Service</text>
<rect x="1595" y="240.33" width="324" height="180.98" rx="3.5" ry="3.5" fill="none" stroke="#393939"/>
<text x="1694" y="255.3255" fill="#aa0000" font-family="sans-serif" font-size="14" font-weight="bold" textLength="126">Product Service</text>
<rect x="1247" y="240.33" width="324" height="180.98" rx="3.5" ry="3.5" fill="none" stroke="#393939"/>
<text x="1343" y="255.3255" fill="#aa0000" font-family="sans-serif" font-size="14" font-weight="bold" textLength="132">Shipping Service</text>
<rect x="703" y="240.33" width="172" height="180.98" rx="3.5" ry="3.5" fill="none" stroke="#393939"/>
<text x="738.5" y="255.3255" fill="#aa0000" font-family="sans-serif" font-size="14" font-weight="bold" textLength="101">User Service</text>
<rect x="1943" y="240.33" width="324" height="180.98" rx="3.5" ry="3.5" fill="none" stroke="#393939"/>
<text x="2028" y="255.3255" fill="#aa0000" font-family="sans-serif" font-size="14" font-weight="bold" textLength="154">Warehouse Service</text>
<rect x="541.5" y="275.33" width="121" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="551.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="101">gRPC Gateway</text>
<rect x="371.5" y="275.33" width="135" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="381.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="115">Event Consumer</text>
<ellipse cx="548" cy="388.97" rx="69.695" ry="16.339" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="498.9952" y="392.7169" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="92">gRPC Service</text>
<rect x="1085.5" y="275.33" width="121" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1095.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="101">gRPC Gateway</text>
<rect x="915.5" y="275.33" width="135" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="925.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="115">Event Consumer</text>
<ellipse cx="1084" cy="388.97" rx="69.695" ry="16.339" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1034.9952" y="392.7169" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="92">gRPC Service</text>
<rect x="193.5" y="275.33" width="121" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="203.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="101">gRPC Gateway</text>
<rect x="23.5" y="275.33" width="135" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="33.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="115">Event Consumer</text>
<ellipse cx="245" cy="388.97" rx="69.695" ry="16.339" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="195.9952" y="392.7169" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="92">gRPC Service</text>
<rect x="1611.5" y="275.33" width="121" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1621.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="101">gRPC Gateway</text>
<rect x="1767.5" y="275.33" width="135" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1777.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="115">Event Consumer</text>
<ellipse cx="1684" cy="388.97" rx="69.695" ry="16.339" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1634.9952" y="392.7169" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="92">gRPC Service</text>
<rect x="1263.5" y="275.33" width="121" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1273.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="101">gRPC Gateway</text>
<rect x="1419.5" y="275.33" width="135" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1429.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="115">Event Consumer</text>
<ellipse cx="1333" cy="388.97" rx="69.695" ry="16.339" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1283.9952" y="392.7169" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="92">gRPC Service</text>
<rect x="733.5" y="275.33" width="121" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="743.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="101">gRPC Gateway</text>
<ellipse cx="789" cy="388.97" rx="69.695" ry="16.339" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="739.9952" y="392.7169" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="92">gRPC Service</text>
<rect x="1959.5" y="275.33" width="121" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1969.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="101">gRPC Gateway</text>
<rect x="2115.5" y="275.33" width="135" height="36.297" rx="3.5" ry="3.5" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="2125.5" y="298.3255" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="115">Event Consumer</text>
<ellipse cx="2029" cy="388.97" rx="69.695" ry="16.339" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1979.9952" y="392.7169" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="92">gRPC Service</text>
<path d="m1070 15.172c5.4911-6.4527 10.042-5.2213 14.147 1.4901 2.7313-5.4791 7.0687-5.7562 11.295-1.7871 3.576-5.5135 9.4015-6.3142 12.857 0.1297 2.6823-7.4612 9.5927-8.132 14.188-1.9965 3.8339-5.0856 8.5963-6.5214 12.24 0.1971 3.0805-6.9608 9.13-5.7752 12.622-0.4224 3.6635-6.7824 9.7619-5.3161 13.163 0.2793 4.9362-5.2013 9.0352-5.1569 13.045 1.0585 3.0979-5.8676 8.3856-6.6034 12.147-0.6841 3.7356-5.9711 9.003-3.9224 11.553 1.2315 3.9632-6.1481 10.525-7.7457 14.63-0.1506 5.4721-4.6659 9.3889-3.7267 12.679 2.5322 9.9117 0.8413 10.886 6.7954 6.8826 14.323 4.5218 7.4814 1.516 15.979-8.3014 16.038-4.3159 6.2151-8.7435 6.3016-13.012-0.0493-3.4762 5.7854-7.6474 7.2374-12.601 1.6346-2.6926 6.8991-8.3328 6.5007-12.641 1.7541-2.9934 5.9135-8.361 6.5345-12.089 0.7594-3.6337 7.4321-7.797 8.2751-13.21 1.6749-4.2643 6.3206-9.4279 6.7135-13.142-0.5331-3.5472 5.4016-8.6662 5.0352-12.113-0.1153-4.2878 5.5717-9.3755 3.5168-12.014-1.8172-3.7949 6.6718-9.5568 5.9823-12.732-0.5957-3.7371 6.1477-9.2733 5.3515-12.709-0.3236-5.1111 6.4543-9.9946 5.1088-13.264-1.8249-4.7758 6.2175-11.49 4.2948-13.852-2.5578-7.6724-2.0457-8.6329-7.251-4.694-13.372-5.5616-7.9984-3.6489-13 4.9242-16.873" fill="#313139" stroke="#E7E7E7" stroke-width=".5"/>
<text x="1076.5" y="35.0355" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="139">API Gateway (Envoy)</text>
<path d="m1032 765.9h174c5 0 5 13.148 5 13.148s0 13.148-5 13.148h-174c-5 0-5-13.148-5-13.148s0-13.148 5-13.148" fill="#E55756" stroke="#191919" stroke-width="1.5"/>
<path d="m1206 765.9c-5 0-5 13.148-5 13.148 0 13.148 5 13.148 5 13.148" fill="none" stroke="#191919" stroke-width="1.5"/>
<text x="1032" y="783.8955" fill="#FFFFFF" font-family="sans-serif" font-size="14" textLength="164">Message Broker (Kafka)</text>
<rect x="1018.5" y="656.61" width="205" height="32.297" rx="3.5" ry="3.5" fill="#E55756" stroke="#191919" stroke-width="1.5"/>
<rect x="1014.5" y="652.61" width="205" height="32.297" rx="3.5" ry="3.5" fill="#E55756" stroke="#191919" stroke-width="1.5"/>
<text x="1022.5" y="673.6055" fill="#ffffff" font-family="sans-serif" font-size="14" textLength="189">Message Relay (Debezium)</text>
<path d="m629 478.31c0-10 61-10 61-10s61 0 61 10v25.297c0 10-61 10-61 10s-61 0-61-10v-25.297" fill="#A4DBD8" stroke="#191919" stroke-width=".5"/>
<path d="m629 478.31c0 10 61 10 61 10s61 0 61-10" fill="none" stroke="#191919" stroke-width=".5"/>
<text x="639" y="505.3055" fill="#191919" font-family="sans-serif" font-size="14" textLength="102">Auth Database</text>
<path d="m1014.5 478.31c0-10 64.5-10 64.5-10s64.5 0 64.5 10v25.297c0 10-64.5 10-64.5 10s-64.5 0-64.5-10v-25.297" fill="#A4DBD8" stroke="#191919" stroke-width=".5"/>
<path d="m1014.5 478.31c0 10 64.5 10 64.5 10s64.5 0 64.5-10" fill="none" stroke="#191919" stroke-width=".5"/>
<text x="1024.5" y="505.3055" fill="#191919" font-family="sans-serif" font-size="14" textLength="109">Order Database</text>
<path d="m440 478.31c0-10 77-10 77-10s77 0 77 10v25.297c0 10-77 10-77 10s-77 0-77-10v-25.297" fill="#A4DBD8" stroke="#191919" stroke-width=".5"/>
<path d="m440 478.31c0 10 77 10 77 10s77 0 77-10" fill="none" stroke="#191919" stroke-width=".5"/>
<text x="450" y="505.3055" fill="#191919" font-family="sans-serif" font-size="14" textLength="134">Payment Database</text>
<path d="m1364 478.31c0-10 72-10 72-10s72 0 72 10v25.297c0 10-72 10-72 10s-72 0-72-10v-25.297" fill="#A4DBD8" stroke="#191919" stroke-width=".5"/>
<path d="m1364 478.31c0 10 72 10 72 10s72 0 72-10" fill="none" stroke="#191919" stroke-width=".5"/>
<text x="1374" y="505.3055" fill="#191919" font-family="sans-serif" font-size="14" textLength="124">Product Database</text>
<path d="m1179 478.31c0-10 75-10 75-10s75 0 75 10v25.297c0 10-75 10-75 10s-75 0-75-10v-25.297" fill="#A4DBD8" stroke="#191919" stroke-width=".5"/>
<path d="m1179 478.31c0 10 75 10 75 10s75 0 75-10" fill="none" stroke="#191919" stroke-width=".5"/>
<text x="1189" y="505.3055" fill="#191919" font-family="sans-serif" font-size="14" textLength="130">Shipping Database</text>
<path d="m786 478.31c0-10 61-10 61-10s61 0 61 10v25.297c0 10-61 10-61 10s-61 0-61-10v-25.297" fill="#A4DBD8" stroke="#191919" stroke-width=".5"/>
<path d="m786 478.31c0 10 61 10 61 10s61 0 61-10" fill="none" stroke="#191919" stroke-width=".5"/>
<text x="796" y="505.3055" fill="#191919" font-family="sans-serif" font-size="14" textLength="102">User Database</text>
<path d="m1905.5 478.31c0-10 84.5-10 84.5-10s84.5 0 84.5 10v25.297c0 10-84.5 10-84.5 10s-84.5 0-84.5-10v-25.297" fill="#A4DBD8" stroke="#191919" stroke-width=".5"/>
<path d="m1905.5 478.31c0 10 84.5 10 84.5 10s84.5 0 84.5-10" fill="none" stroke="#191919" stroke-width=".5"/>
<text x="1915.5" y="505.3055" fill="#191919" font-family="sans-serif" font-size="14" textLength="149">Warehouse Database</text>
<g stroke="#191919">
<path d="m591.84 312.07c-10.02 17.35-22.187 38.426-31.807 55.066" fill="none"/>
<polygon points="557.03 372.33 565 366.54 559.53 368 558.07 362.54" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m459.5 312.07c20.48 17.56 47.055 40.354 66.415 56.954" fill="none"/>
<polygon points="530.47 372.93 526.24 364.04 526.67 369.68 521.03 370.11" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m569.26 404.94c23.67 16.67 57.274 40.325 84.424 59.445" fill="none"/>
<polygon points="658.59 467.84 653.53 459.39 654.5 464.96 648.93 465.93" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1134.3 312.07c-11.51 17.35-25.613 38.62-36.653 55.26" fill="none"/>
<polygon points="1094.4 372.33 1102.7 367.04 1097.1 368.16 1096 362.62" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1002 312.07c18.85 17.45 43.066 39.865 61.026 56.485" fill="none"/>
<polygon points="1067.4 372.63 1063.5 363.58 1063.8 369.23 1058.1 369.45" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1083.2 405.59c-0.84 16.81-1.8786 37.668-2.8286 56.558" fill="none"/>
<polygon points="1080.1 468.14 1084.5 459.35 1080.3 463.15 1076.5 458.95" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m252.31 312.07c-1.67 17.35-3.6257 37.648-5.2257 54.288" fill="none"/>
<polygon points="246.51 372.33 251.35 363.75 246.99 367.35 243.39 362.99" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m119.97 312.07c29.1 17.66 68.311 41.466 95.621 58.046" fill="none"/>
<polygon points="220.72 373.23 215.1 365.14 216.45 370.64 210.95 371.98" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m281.4 403.35c44.88 16.5 116.15 42.7 169.85 62.44" fill="none"/>
<polygon points="456.88 467.86 449.81 461 452.19 466.14 447.05 468.51" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1674.3 312.07c2.22 17.35 4.8382 37.669 6.9682 54.309" fill="none"/>
<polygon points="1682 372.33 1684.8 362.9 1681.4 367.37 1676.9 363.91" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1806.6 312.07c-28.54 17.66-66.908 41.422-93.698 58.002" fill="none"/>
<polygon points="1707.8 373.23 1717.6 371.9 1712.1 370.6 1713.3 365.09" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1650 403.66c-40.99 16.53-104.91 42.296-153.55 61.906" fill="none"/>
<polygon points="1490.9 467.81 1500.8 468.15 1495.6 465.94 1497.8 460.74" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1325.7 312.07c1.67 17.35 3.6257 37.648 5.2257 54.288" fill="none"/>
<polygon points="1331.5 372.33 1334.6 362.99 1331 367.35 1326.6 363.75" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1458 312.07c-29.1 17.66-68.311 41.466-95.621 58.046" fill="none"/>
<polygon points="1357.3 373.23 1367 371.98 1361.6 370.64 1362.9 365.14" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1321 405.16c-13.21 16.71-30.841 39.032-45.881 58.072" fill="none"/>
<polygon points="1271.4 467.94 1280.1 463.36 1274.5 464.02 1273.8 458.4" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m793.06 312.07c-0.93 17.35-2.0095 37.629-2.8995 54.269" fill="none"/>
<polygon points="789.84 372.33 794.32 363.56 790.11 367.34 786.33 363.13" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m798.06 405.59c9.75 16.81 22.321 38.469 33.271 57.359" fill="none"/>
<polygon points="834.34 468.14 833.29 458.35 831.83 463.81 826.37 462.36" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m2021.7 312.07c1.67 17.35 3.6257 37.648 5.2257 54.288" fill="none"/>
<polygon points="2027.5 372.33 2030.6 362.99 2027 367.35 2022.6 363.75" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m2154 312.07c-29.1 17.66-68.311 41.466-95.621 58.046" fill="none"/>
<polygon points="2053.3 373.23 2063 371.98 2057.6 370.64 2058.9 365.14" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m2022.9 405.59c-6.56 16.81-14.849 38.07-22.219 56.96" fill="none"/>
<polygon points="1998.5 468.14 2005.5 461.21 2000.3 463.48 1998.1 458.3" fill="#191919"/>
</g>
<path d="m1091.2 53.75c-84.62 35.35-251.59 107.17-388.2 178.58-25.5 13.34-48.457 27.059-68.517 39.549" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="629.39 275.05 639.14 273.69 633.63 272.41 634.92 266.9" fill="#191919" stroke="#191919"/>
<text x="881" y="158.3972" fill="#d40000" font-family="sans-serif" font-size="13" textLength="32">HTTP</text>
<path d="m1146 53.46v215.39" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="1146 274.85 1150 265.85 1146 269.85 1142 265.85" fill="#191919" stroke="#191919"/>
<text x="1147" y="158.3972" fill="#d40000" font-family="sans-serif" font-size="13" textLength="32">HTTP</text>
<path d="m1061.2 44.48c-147.63 24.93-459.62 85.62-706.19 187.85-27.52 11.42-51.519 26.034-71.349 39.354" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="278.67 275.03 288.37 273.33 282.82 272.24 283.91 266.69" fill="#191919" stroke="#191919"/>
<text x="608" y="158.3972" fill="#d40000" font-family="sans-serif" font-size="13" textLength="32">HTTP</text>
<path d="m1197.8 53.79c80.83 35.69 241.35 108.29 373.19 178.54 25.22 13.44 47.957 27.014 68.007 39.414" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="1644.1 274.9 1638.6 266.76 1639.9 272.27 1634.4 273.57" fill="#191919" stroke="#191919"/>
<text x="1433" y="158.3972" fill="#d40000" font-family="sans-serif" font-size="13" textLength="32">HTTP</text>
<path d="m1161.2 53.46c34.72 50.97 115.99 170.28 147.43 216.43" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="1312 274.85 1310.2 265.16 1309.2 270.72 1303.6 269.66" fill="#191919" stroke="#191919"/>
<text x="1236" y="158.3972" fill="#d40000" font-family="sans-serif" font-size="13" textLength="32">HTTP</text>
<path d="m1115.7 53.69c-68.87 51.13-231.12 171.57-293.15 217.62" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="817.71 274.89 827.32 272.74 821.72 271.91 822.55 266.31" fill="#191919" stroke="#191919"/>
<text x="991" y="158.3972" fill="#d40000" font-family="sans-serif" font-size="13" textLength="32">HTTP</text>
<path d="m1230.9 45.15c145.06 25.63 448.21 86.93 688.11 187.18 27.49 11.49 51.497 26.098 71.327 39.398" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="1995.3 275.07 1990.1 266.74 1991.2 272.29 1985.6 273.38" fill="#191919" stroke="#191919"/>
<text x="1723" y="158.3972" fill="#d40000" font-family="sans-serif" font-size="13" textLength="32">HTTP</text>
<path d="m624.03 388.97h95.18" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="618.03 388.97 627.03 392.97 623.03 388.97 627.03 384.97" fill="#191919" stroke="#191919"/>
<text x="636" y="382.0372" fill="#d40000" font-family="sans-serif" font-size="13" textLength="33">gRPC</text>
<path d="m1083.9 513.76c8.04 35.7 22.512 100.07 29.862 132.7" fill="none" stroke="#191919"/>
<polygon points="1115.1 652.31 1117 642.65 1114 647.43 1109.2 644.41" fill="#191919" stroke="#191919"/>
<text x="1102" y="587.6772" fill="#d40000" font-family="sans-serif" font-size="13" textLength="46">Outbox</text>
<path d="m584.8 514.07c64.03 20.69 162.86 52.14 249.2 77.54 74.32 21.86 154.32 43.577 212.2 58.977" fill="none" stroke="#191919"/>
<polygon points="1052 652.13 1044.3 645.95 1047.2 650.84 1042.3 653.68" fill="#191919" stroke="#191919"/>
<text x="835" y="587.6772" fill="#d40000" font-family="sans-serif" font-size="13" textLength="46">Outbox</text>
<path d="m1396.8 513.94c-63.77 35.77-183.49 102.92-241.55 135.48" fill="none" stroke="#191919"/>
<polygon points="1150 652.35 1159.8 651.44 1154.4 649.9 1155.9 644.46" fill="#191919" stroke="#191919"/>
<text x="1289" y="587.6772" fill="#d40000" font-family="sans-serif" font-size="13" textLength="46">Outbox</text>
<path d="m1237.4 513.76c-27.11 35.7-76.79 101.14-101.58 133.77" fill="none" stroke="#191919"/>
<polygon points="1132.2 652.31 1140.9 647.56 1135.3 648.33 1134.5 642.72" fill="#191919" stroke="#191919"/>
<text x="1191" y="587.6772" fill="#d40000" font-family="sans-serif" font-size="13" textLength="46">Outbox</text>
<path d="m880.63 513.94c54.72 35.77 156.91 102.57 206.73 135.13" fill="none" stroke="#191919"/>
<polygon points="1092.4 652.35 1087 644.08 1088.2 649.62 1082.7 650.78" fill="#191919" stroke="#191919"/>
<text x="999" y="587.6772" fill="#d40000" font-family="sans-serif" font-size="13" textLength="46">Outbox</text>
<path d="m1937.1 514.06c-26.65 10.46-59.69 22.41-90.1 30.55-218.03 58.35-474.41 94.886-617.08 112.48" fill="none" stroke="#191919"/>
<polygon points="1224 657.82 1233.4 660.69 1228.9 657.21 1232.4 652.75" fill="#191919" stroke="#191919"/>
<text x="1717" y="587.6772" fill="#d40000" font-family="sans-serif" font-size="13" textLength="46">Outbox</text>
<path d="m1119 689.31v70.16" fill="none" stroke="#191919" stroke-dasharray="7.0,7.0"/>
<polygon points="1119 765.47 1123 756.47 1119 760.47 1115 756.47" fill="#191919" stroke="#191919"/>
<text x="1120" y="731.9672" fill="#d40000" font-family="sans-serif" font-size="13" textLength="92">Publish Events</text>
<g stroke="#191919">
<path d="m1026.7 774.11c-196.78-9.64-639.66-38.43-639.66-102.36v-283.78c0-29.53 16.147-53.891 31.347-71.561" fill="none" stroke-dasharray="7.0,7.0"/>
<polygon points="422.26 311.86 413.36 316.07 419 315.65 419.42 321.29" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1065.1 765.54c-45.77-14.2-104.07-42.38-104.07-93.79v-283.78c0-27.01 6.8378-51.603 13.308-70.193" fill="none" stroke-dasharray="7.0,7.0"/>
<polygon points="976.28 312.11 969.54 319.3 974.64 316.83 977.1 321.93" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1026.5 777.94c-249.82-1.53-919.51-14.21-919.51-106.19v-283.78c0-26.84-5.0216-51.582-9.7316-70.242" fill="none" stroke-dasharray="7.0,7.0"/>
<polygon points="95.8 311.91 94.124 321.62 97.024 316.76 101.88 319.66" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1211.5 773.51c190.62-10.6 609.5-40.82 609.5-101.76v-283.78c0-26.75 4.3884-51.481 8.5084-70.171" fill="none" stroke-dasharray="7.0,7.0"/>
<polygon points="1830.8 311.94 1825 319.87 1829.7 316.82 1832.8 321.59" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1211.4 774.37c129.57-7.72 349.61-31.34 349.61-102.62v-283.78c0-31.88-22.059-55.527-43.399-72.267" fill="none" stroke-dasharray="7.0,7.0"/>
<polygon points="1512.9 312 1517.5 320.7 1516.8 315.09 1522.4 314.41" fill="#191919"/>
</g>
<g stroke="#191919">
<path d="m1211.3 778.21c254.53-0.79 947.71-11.62 947.71-106.46v-283.78c0-27.15 7.4748-51.763 14.535-70.303" fill="none" stroke-dasharray="7.0,7.0"/>
<polygon points="2175.7 312.06 2168.7 319.05 2173.9 316.73 2176.2 321.89" fill="#191919"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 22 KiB

View File

@@ -0,0 +1,81 @@
' Copyright (C) 2024 Declan Teevan
'
' This program is free software: you can redistribute it and/or modify
' it under the terms of the GNU Affero 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 Affero General Public License for more details.
'
' You should have received a copy of the GNU Affero General Public License
' along with this program. If not, see <https://www.gnu.org/licenses/>.
@startuml placeordersaga
!theme mars
|Order|
start
:OrderCreatedEvent;
|Product|
:ProductPriceQuoteEvent;
if (type) is (<color:red>UNAVALIABLE) then
|Order|
:<color:red>OrderRejectedEvent;
kill
else (<color:green>AVALIABLE)
endif
|Order|
:OrderPendingEvent;
|Warehouse|
:StockReservationEvent;
if (type) is (<color:red>INSUFFICIENT_STOCK) then
|Order|
:<color:red>OrderRejectedEvent;
kill
else (<color:green>STOCK_RESERVED)
endif
|Shipping|
:ShipmentAllocationEvent;
if (type) is (<color:red>FAILED) then
|Warehouse|
:StockReservationEvent\n<color:grey>type: STOCK_RETURNED;
|Order|
:<color:red>OrderRejectedEvent;
kill
else (<color:green>ALLOCATED)
endif
|Payment|
:PaymentProcessedEvent;
if (type) is (<color:red>FAILED) then
|Shipping|
:ShipmentAllocationEvent\n<color:grey>type: ALLOCATION_RELEASED;
|Warehouse|
:StockReservationEvent\n<color:grey>type: STOCK_RETURNED;
|Order|
:<color:red>OrderRejectedEvent;
kill
else (<color:green>SUCCESS)
endif
fork
|Warehouse|
:StockReservationEvent\n<color:grey>type: STOCK_CONSUMED;
kill
fork again
|Order|
:<color:green>OrderApprovedEvent;
stop
end merge
@enduml

View File

@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg style="width:1250px;height:1276px;background:#F9F9F9;" contentStyleType="text/css" preserveAspectRatio="none" version="1.1" viewBox="0 0 1250 1276" width="1250px" height="1276px" xmlns="http://www.w3.org/2000/svg" zoomAndPan="magnify">
<rect width="1250" height="1276" fill="#F9F9F9"/>
<rect x="15" y="12.745" width="1217" height="20.953" fill="none"/>
<ellipse cx="93.5" cy="48.698" rx="10" ry="10" fill="#222" stroke="#222"/>
<rect x="23.5" y="78.698" width="140" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="33.5" y="99.8369" fill="#000000" font-family="sans-serif" font-size="12" textLength="120">OrderCreatedEvent</text>
<rect x="21" y="235.04" width="145" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="31" y="256.1768" fill="#FF0000" font-family="sans-serif" font-size="12" textLength="125">OrderRejectedEvent</text>
<rect x="23" y="311.01" width="141" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="33" y="332.1455" fill="#000000" font-family="sans-serif" font-size="12" textLength="121">OrderPendingEvent</text>
<rect x="21" y="467.35" width="145" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="31" y="488.4854" fill="#FF0000" font-family="sans-serif" font-size="12" textLength="125">OrderRejectedEvent</text>
<rect x="21" y="723.61" width="145" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="31" y="744.7471" fill="#FF0000" font-family="sans-serif" font-size="12" textLength="125">OrderRejectedEvent</text>
<rect x="21" y="1037.8" width="145" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="31" y="1058.9619" fill="#FF0000" font-family="sans-serif" font-size="12" textLength="125">OrderRejectedEvent</text>
<rect x="118" y="1172.9" width="149" height="33.969" rx="3.5" ry="3.5" fill="#f1f1f1" stroke="#181818" stroke-width=".5"/>
<text transform="translate(0 33.158)" x="128" y="1160.9307" fill="#008000" font-family="sans-serif" font-size="12px" textLength="129">OrderApprovedEvent</text>
<circle cx="192.5" cy="1252.9" r="11" fill="none" stroke="#222"/>
<circle cx="192.5" cy="1252.9" r="6" fill="#222" stroke="#222"/>
<line x1="15" x2="15" y1="12.745" y2="1264.8" stroke="#000" stroke-width="1.5"/>
<rect x="277" y="132.67" width="173" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="287" y="153.8057" fill="#000000" font-family="sans-serif" font-size="12" textLength="153">ProductPriceQuoteEvent</text>
<polygon points="351.5 186.64 375.5 186.64 387.5 198.64 375.5 210.64 351.5 210.64 339.5 198.64" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="367.5" y="220.8462" fill="#FF0000" font-family="sans-serif" font-size="11" textLength="74">UNAVALIABLE</text>
<text x="351.5" y="202.4438" fill="#000000" font-family="sans-serif" font-size="11" textLength="24">type</text>
<text x="387.5" y="196.0415" fill="#008000" font-family="sans-serif" font-size="11" textLength="58">AVALIABLE</text>
<line x1="271" x2="271" y1="12.745" y2="1264.8" stroke="#000" stroke-width="1.5"/>
<rect x="574.5" y="364.98" width="164" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="584.5" y="386.1143" fill="#000000" font-family="sans-serif" font-size="12" textLength="144">StockReservationEvent</text>
<polygon points="644.5 418.94 668.5 418.94 680.5 430.94 668.5 442.94 644.5 442.94 632.5 430.94" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="660.5" y="453.1548" fill="#FF0000" font-family="sans-serif" font-size="11" textLength="120">INSUFFICIENT_STOCK</text>
<text x="644.5" y="434.7524" fill="#000000" font-family="sans-serif" font-size="11" textLength="24">type</text>
<text x="680.5" y="428.3501" fill="#008000" font-family="sans-serif" font-size="11" textLength="103">STOCK_RESERVED</text>
<rect x="573.5" y="645.69" width="166" height="47.938" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="583.5" y="666.8252" fill="#000000" font-family="sans-serif" font-size="12" textLength="144">StockReservationEvent</text>
<text x="583.5" y="680.7939" fill="#808080" font-family="sans-serif" font-size="12" textLength="146">type: STOCK_RETURNED</text>
<rect x="573.5" y="969.89" width="166" height="47.938" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="583.5" y="991.0244" fill="#000000" font-family="sans-serif" font-size="12" textLength="144">StockReservationEvent</text>
<text x="583.5" y="1004.9932" fill="#808080" font-family="sans-serif" font-size="12" textLength="146">type: STOCK_RETURNED</text>
<rect x="483" y="1161.3" width="170" height="47.938" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="493" y="1182.4463" fill="#000000" font-family="sans-serif" font-size="12" textLength="144">StockReservationEvent</text>
<text x="493" y="1196.415" fill="#808080" font-family="sans-serif" font-size="12" textLength="150">type: STOCK_CONSUMED</text>
<line x1="465" x2="465" y1="12.745" y2="1264.8" stroke="#000" stroke-width="1.5"/>
<rect x="816.5" y="543.32" width="175" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="826.5" y="564.4541" fill="#000000" font-family="sans-serif" font-size="12" textLength="155">ShipmentAllocationEvent</text>
<polygon points="892 597.28 916 597.28 928 609.28 916 621.28 892 621.28 880 609.28" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="908" y="631.4946" fill="#FF0000" font-family="sans-serif" font-size="11" textLength="37">FAILED</text>
<text x="892" y="613.0923" fill="#000000" font-family="sans-serif" font-size="11" textLength="24">type</text>
<text x="928" y="606.6899" fill="#008000" font-family="sans-serif" font-size="11" textLength="65">ALLOCATED</text>
<rect x="805.5" y="901.95" width="197" height="47.938" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="815.5" y="923.0869" fill="#000000" font-family="sans-serif" font-size="12" textLength="155">ShipmentAllocationEvent</text>
<text x="815.5" y="937.0557" fill="#808080" font-family="sans-serif" font-size="12" textLength="177">type: ALLOCATION_RELEASED</text>
<line x1="799.5" x2="799.5" y1="12.745" y2="1264.8" stroke="#000" stroke-width="1.5"/>
<rect x="1022" y="799.58" width="175" height="33.969" rx="3.5" ry="3.5" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="1032" y="820.7158" fill="#000000" font-family="sans-serif" font-size="12" textLength="155">PaymentProcessedEvent</text>
<polygon points="1097.5 853.55 1121.5 853.55 1133.5 865.55 1121.5 877.55 1097.5 877.55 1085.5 865.55" fill="#F1F1F1" stroke="#181818" stroke-width=".5"/>
<text x="1113.5" y="887.7563" fill="#FF0000" font-family="sans-serif" font-size="11" textLength="37">FAILED</text>
<text x="1097.5" y="869.354" fill="#000000" font-family="sans-serif" font-size="11" textLength="24">type</text>
<text x="1133.5" y="862.9517" fill="#008000" font-family="sans-serif" font-size="11" textLength="55">SUCCESS</text>
<line x1="1016" x2="1016" y1="12.745" y2="1264.8" stroke="#000" stroke-width="1.5"/>
<line x1="1230" x2="1230" y1="12.745" y2="1264.8" stroke="#000" stroke-width="1.5"/>
<line x1="93.5" x2="93.5" y1="58.698" y2="78.698" stroke="#191919"/>
<polygon points="89.5 68.698 93.5 78.698 97.5 68.698 93.5 72.698" fill="#191919" stroke="#191919"/>
<line x1="192.5" x2="192.5" y1="1206.9" y2="1241.9" stroke="#191919"/>
<polygon transform="translate(0 33.158)" points="192.5 1208.8 196.5 1198.8 192.5 1202.8 188.5 1198.8" fill="#191919" stroke="#191919"/>
<line x1="387.5" x2="446" y1="198.64" y2="198.64" stroke="#191919"/>
<polygon points="442 247.77 446 257.77 450 247.77 446 251.77" fill="#191919" stroke="#191919"/>
<line x1="446" x2="446" y1="198.64" y2="296.01" stroke="#191919"/>
<line x1="446" x2="93.5" y1="296.01" y2="296.01" stroke="#191919"/>
<line x1="93.5" x2="93.5" y1="296.01" y2="311.01" stroke="#191919"/>
<polygon points="89.5 301.01 93.5 311.01 97.5 301.01 93.5 305.01" fill="#191919" stroke="#191919"/>
<line x1="363.5" x2="363.5" y1="166.64" y2="186.64" stroke="#191919"/>
<polygon points="359.5 176.64 363.5 186.64 367.5 176.64 363.5 180.64" fill="#191919" stroke="#191919"/>
<line x1="680.5" x2="904" y1="430.94" y2="430.94" stroke="#191919"/>
<polygon points="900 488.83 904 498.83 908 488.83 904 492.83" fill="#191919" stroke="#191919"/>
<line x1="904" x2="904" y1="430.94" y2="543.32" stroke="#191919"/>
<polygon points="900 533.32 904 543.32 908 533.32 904 537.32" fill="#191919" stroke="#191919"/>
<line x1="656.5" x2="656.5" y1="398.94" y2="418.94" stroke="#191919"/>
<polygon points="652.5 408.94 656.5 418.94 660.5 408.94 656.5 412.94" fill="#191919" stroke="#191919"/>
<line x1="568" x2="568" y1="1124.3" y2="1156.8" stroke="#181818" stroke-width=".88559"/>
<polygon points="564 1151.3 568 1161.3 572 1151.3 568 1155.3" fill="#181818" stroke="#181818"/>
<line x1="928" x2="1109.5" y1="609.28" y2="609.28" stroke="#191919"/>
<polygon points="1105.5 703.62 1109.5 713.62 1113.5 703.62 1109.5 707.62" fill="#191919" stroke="#191919"/>
<line x1="1109.5" x2="1109.5" y1="609.28" y2="799.58" stroke="#191919"/>
<polygon points="1105.5 789.58 1109.5 799.58 1113.5 789.58 1109.5 793.58" fill="#191919" stroke="#191919"/>
<line x1="904" x2="904" y1="577.28" y2="597.28" stroke="#191919"/>
<polygon points="900 587.28 904 597.28 908 587.28 904 591.28" fill="#191919" stroke="#191919"/>
<line x1="1133.5" x2="1211" y1="865.55" y2="865.55" stroke="#191919"/>
<polygon points="1207 982.62 1211 992.62 1215 982.62 1211 986.62" fill="#191919" stroke="#191919"/>
<line x1="1211" x2="1211" y1="865.55" y2="1098.8" stroke="#191919"/>
<line x1="1211" x2="656.5" y1="1098.8" y2="1098.8" stroke="#191919"/>
<line x1="656.5" x2="656.5" y1="1098.3" y2="1115.8" stroke="#191919" stroke-width="1.0794"/>
<polygon transform="translate(0 8.1941)" points="656.5 1113.8 660.5 1103.8 656.5 1107.8 652.5 1103.8" fill="#191919" stroke="#191919"/>
<line x1="1109.5" x2="1109.5" y1="833.55" y2="853.55" stroke="#191919"/>
<polygon points="1105.5 843.55 1109.5 853.55 1113.5 843.55 1109.5 847.55" fill="#191919" stroke="#191919"/>
<line x1="93.5" x2="93.5" y1="112.67" y2="117.67" stroke="#191919"/>
<line x1="93.5" x2="363.5" y1="117.67" y2="117.67" stroke="#191919"/>
<line x1="363.5" x2="363.5" y1="117.67" y2="132.67" stroke="#191919"/>
<polygon points="359.5 122.67 363.5 132.67 367.5 122.67 363.5 126.67" fill="#191919" stroke="#191919"/>
<line x1="363.5" x2="363.5" y1="210.64" y2="222.84" stroke="#191919"/>
<line x1="363.5" x2="93.5" y1="222.84" y2="222.84" stroke="#191919"/>
<line x1="93.5" x2="93.5" y1="222.84" y2="235.04" stroke="#191919"/>
<polygon points="89.5 225.04 93.5 235.04 97.5 225.04 93.5 229.04" fill="#191919" stroke="#191919"/>
<line x1="93.5" x2="93.5" y1="344.98" y2="349.98" stroke="#191919"/>
<line x1="93.5" x2="656.5" y1="349.98" y2="349.98" stroke="#191919"/>
<line x1="656.5" x2="656.5" y1="349.98" y2="364.98" stroke="#191919"/>
<polygon points="652.5 354.98 656.5 364.98 660.5 354.98 656.5 358.98" fill="#191919" stroke="#191919"/>
<line x1="656.5" x2="656.5" y1="442.94" y2="455.15" stroke="#191919"/>
<line x1="656.5" x2="93.5" y1="455.15" y2="455.15" stroke="#191919"/>
<line x1="93.5" x2="93.5" y1="455.15" y2="467.35" stroke="#191919"/>
<polygon points="89.5 457.35 93.5 467.35 97.5 457.35 93.5 461.35" fill="#191919" stroke="#191919"/>
<line x1="656.5" x2="656.5" y1="693.62" y2="706.11" stroke="#191919"/>
<line x1="656.5" x2="93.5" y1="706.11" y2="706.11" stroke="#191919"/>
<line x1="93.5" x2="93.5" y1="706.11" y2="723.61" stroke="#191919"/>
<polygon points="89.5 713.61 93.5 723.61 97.5 713.61 93.5 717.61" fill="#191919" stroke="#191919"/>
<line x1="904" x2="904" y1="621.28" y2="633.49" stroke="#191919"/>
<line x1="904" x2="656.5" y1="633.49" y2="633.49" stroke="#191919"/>
<line x1="656.5" x2="656.5" y1="633.49" y2="645.69" stroke="#191919"/>
<polygon points="652.5 635.69 656.5 645.69 660.5 635.69 656.5 639.69" fill="#191919" stroke="#191919"/>
<line x1="904" x2="904" y1="949.89" y2="954.89" stroke="#191919"/>
<line x1="904" x2="656.5" y1="954.89" y2="954.89" stroke="#191919"/>
<line x1="656.5" x2="656.5" y1="954.89" y2="969.89" stroke="#191919"/>
<polygon points="652.5 959.89 656.5 969.89 660.5 959.89 656.5 963.89" fill="#191919" stroke="#191919"/>
<line x1="656.5" x2="656.5" y1="1017.8" y2="1022.8" stroke="#191919"/>
<line x1="656.5" x2="93.5" y1="1022.8" y2="1022.8" stroke="#191919"/>
<line x1="93.5" x2="93.5" y1="1022.8" y2="1037.8" stroke="#191919"/>
<polygon points="89.5 1027.8 93.5 1037.8 97.5 1027.8 93.5 1031.8" fill="#191919" stroke="#191919"/>
<line x1="1109.5" x2="1109.5" y1="877.55" y2="889.75" stroke="#191919"/>
<line x1="1109.5" x2="904" y1="889.75" y2="889.75" stroke="#191919"/>
<line x1="904" x2="904" y1="889.75" y2="901.95" stroke="#191919"/>
<polygon points="900 891.95 904 901.95 908 891.95 904 895.95" fill="#191919" stroke="#191919"/>
<line x1="657.13" x2="192.5" y1="1123.8" y2="1123.8" stroke="#191919" stroke-width=".90845"/>
<line x1="192.5" x2="192.5" y1="1123.3" y2="1166.1" stroke="#191919" stroke-width="1.6355"/>
<polygon transform="translate(0 31.666)" points="192.5 1139.8 196.5 1129.8 192.5 1133.8 188.5 1129.8" fill="#191919" stroke="#191919"/>
<text x="117" y="29.4531" fill="#000000" font-family="sans-serif" font-size="18" textLength="52">Order</text>
<text x="334" y="29.4531" fill="#000000" font-family="sans-serif" font-size="18" textLength="68">Product</text>
<text x="582.25" y="29.4531" fill="#000000" font-family="sans-serif" font-size="18" textLength="100">Warehouse</text>
<text x="869.75" y="29.4531" fill="#000000" font-family="sans-serif" font-size="18" textLength="76">Shipping</text>
<text x="1084" y="29.4531" fill="#000000" font-family="sans-serif" font-size="18" textLength="78">Payment</text>
</svg>

After

Width:  |  Height:  |  Size: 14 KiB

71
go.mod Normal file
View File

@@ -0,0 +1,71 @@
module github.com/hexolan/stocklet
go 1.21.1
require (
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2
github.com/bufbuild/protovalidate-go v0.4.1
github.com/doug-martin/goqu/v9 v9.19.0
github.com/golang-migrate/migrate/v4 v4.16.2
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0
github.com/jackc/pgx/v5 v5.3.1
github.com/lestrrat-go/jwx/v2 v2.0.18
github.com/rs/zerolog v1.31.0
github.com/twmb/franz-go v1.15.0
github.com/twmb/franz-go/pkg/kadm v1.9.2
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1
go.opentelemetry.io/otel v1.21.0
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0
go.opentelemetry.io/otel/sdk v1.21.0
golang.org/x/crypto v0.16.0
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17
google.golang.org/grpc v1.59.0
google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1
)
require (
github.com/antlr4-go/antlr/v4 v4.13.0 // indirect
github.com/cenkalti/backoff/v4 v4.2.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/distribution/reference v0.5.0 // indirect
github.com/docker/distribution v2.8.3+incompatible // indirect
github.com/docker/docker v24.0.7+incompatible // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-logr/logr v1.3.0 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goccy/go-json v0.10.2 // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/google/cel-go v0.18.2 // indirect
github.com/hashicorp/errwrap v1.1.0 // indirect
github.com/hashicorp/go-multierror v1.1.1 // indirect
github.com/jackc/pgpassfile v1.0.0 // indirect
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a // indirect
github.com/jackc/puddle/v2 v2.2.0 // indirect
github.com/klauspost/compress v1.17.2 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.4 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/lib/pq v1.10.2 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/opencontainers/image-spec v1.1.0-rc5 // indirect
github.com/pierrec/lz4/v4 v4.1.18 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/stoewer/go-strcase v1.3.0 // indirect
github.com/twmb/franz-go/pkg/kmsg v1.6.1 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 // indirect
go.opentelemetry.io/otel/metric v1.21.0 // indirect
go.opentelemetry.io/otel/trace v1.21.0 // indirect
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
go.uber.org/atomic v1.11.0 // indirect
golang.org/x/net v0.18.0 // indirect
golang.org/x/sync v0.5.0 // indirect
golang.org/x/sys v0.15.0 // indirect
golang.org/x/text v0.14.0 // indirect
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 // indirect
)

252
go.sum Normal file
View File

@@ -0,0 +1,252 @@
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2 h1:iRWpWLm1nrsCHBVhibqPJQB3iIf3FRsAXioJVU8m6w0=
buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go v1.31.0-20231106192134-1baebb0a1518.2/go.mod h1:xafc+XIsTxTy76GJQ1TKgvJWsSugFBqMaN27WhUblew=
cloud.google.com/go v0.110.9 h1:e7ITSqGFFk4rbz/JFIqZh3G4VEHguhAL4BQcFlWtU68=
cloud.google.com/go/compute v1.23.2 h1:nWEMDhgbBkBJjfpVySqU4jgWdc22PLR0o4vEexZHers=
cloud.google.com/go/compute v1.23.2/go.mod h1:JJ0atRC0J/oWYiiVBmsSsrRnh92DhZPG4hFDcR04Rns=
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161 h1:L/gRVlceqvL25UVaW/CKtUDjefjrs0SPonmDGUVOYP0=
github.com/Azure/go-ansiterm v0.0.0-20230124172434-306776ec8161/go.mod h1:xomTg63KZ2rFqZQzSB4Vz2SUXa1BpHTVz9L5PTmPC4E=
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
github.com/Microsoft/go-winio v0.6.1 h1:9/kr64B9VUZrLm5YYwbGtUJnMgqWVOdUAXu6Migciow=
github.com/Microsoft/go-winio v0.6.1/go.mod h1:LRdKpFKfdobln8UmuiYcKPot9D2v6svN5+sAH+4kjUM=
github.com/antlr4-go/antlr/v4 v4.13.0 h1:lxCg3LAv+EUK6t1i0y1V6/SLeUi0eKEKdhQAlS8TVTI=
github.com/antlr4-go/antlr/v4 v4.13.0/go.mod h1:pfChB/xh/Unjila75QW7+VU4TSnWnnk9UTnmpPaOR2g=
github.com/bufbuild/protovalidate-go v0.4.1 h1:ye/8S72WbEklCeltPkSEeT8Eu1A7P/gmMsmapkwqTFk=
github.com/bufbuild/protovalidate-go v0.4.1/go.mod h1:+p5FXfOjSEgLz5WBDTOMPMdQPXqALEERbJZU7huDCtA=
github.com/cenkalti/backoff/v4 v4.2.1 h1:y4OZtCnogmCPw98Zjyt5a6+QwPLGkiQsYW5oUqylYbM=
github.com/cenkalti/backoff/v4 v4.2.1/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4 h1:/inchEIKaYC1Akx+H+gqO04wryn5h75LSazbRlnya1k=
github.com/cncf/xds/go v0.0.0-20230607035331-e9ce68804cb4/go.mod h1:eXthEFrGJvWHgFFCl3hGmgk+/aYT6PnTQLykKQRLhEs=
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
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/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/denisenkom/go-mssqldb v0.10.0/go.mod h1:xbL0rPBG9cCiLr28tMa8zpbdarY27NDyej4t/EjAShU=
github.com/dhui/dktest v0.3.16 h1:i6gq2YQEtcrjKbeJpBkWjE8MmLZPYllcjOFbTZuPDnw=
github.com/dhui/dktest v0.3.16/go.mod h1:gYaA3LRmM8Z4vJl2MA0THIigJoZrwOansEOsp+kqxp0=
github.com/distribution/reference v0.5.0 h1:/FUIFXtfc/x2gpa5/VGfiGLuOIdYa1t65IKK2OFGvA0=
github.com/distribution/reference v0.5.0/go.mod h1:BbU0aIcezP1/5jX/8MP0YiH4SdvB5Y4f/wlDRiLyi3E=
github.com/docker/distribution v2.8.3+incompatible h1:AtKxIZ36LoNK51+Z6RpzLpddBirtxJnzDrHLEKxTAYk=
github.com/docker/distribution v2.8.3+incompatible/go.mod h1:J2gT2udsDAN96Uj4KfcMRqY0/ypR+oyYUYmja8H+y+w=
github.com/docker/docker v24.0.7+incompatible h1:Wo6l37AuwP3JaMnZa226lzVXGA3F9Ig1seQen0cKYlM=
github.com/docker/docker v24.0.7+incompatible/go.mod h1:eEKB0N0r5NX/I1kEveEz05bcu8tLC/8azJZsviup8Sk=
github.com/docker/go-connections v0.4.0 h1:El9xVISelRB7BuFusrZozjnkIM5YnzCViNKohAFqRJQ=
github.com/docker/go-connections v0.4.0/go.mod h1:Gbd7IOopHjR8Iph03tsViu4nIes5XhDvyHbTtUxmeec=
github.com/docker/go-units v0.5.0 h1:69rxXcBk27SvSaaxTtLh/8llcHD8vYHT7WSdRZ/jvr4=
github.com/docker/go-units v0.5.0/go.mod h1:fgPhTUdO+D/Jk86RDLlptpiXQzgHJF7gydDDbaIK4Dk=
github.com/doug-martin/goqu/v9 v9.19.0 h1:PD7t1X3tRcUiSdc5TEyOFKujZA5gs3VSA7wxSvBx7qo=
github.com/doug-martin/goqu/v9 v9.19.0/go.mod h1:nf0Wc2/hV3gYK9LiyqIrzBEVGlI8qW3GuDCEobC4wBQ=
github.com/envoyproxy/protoc-gen-validate v1.0.2 h1:QkIBuU5k+x7/QXPvPPnWXWlCdaBFApVqftFV6k087DA=
github.com/envoyproxy/protoc-gen-validate v1.0.2/go.mod h1:GpiZQP3dDbg4JouG/NNS7QWXpgx6x8QiMKdmN72jogE=
github.com/felixge/httpsnoop v1.0.4 h1:NFTV2Zj1bL4mc9sqWACXbQFVBBg2W3GPvqp8/ESS2Wg=
github.com/felixge/httpsnoop v1.0.4/go.mod h1:m8KPJKqk1gH5J9DgRY2ASl2lWCfGKXixSwevea8zH2U=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
github.com/go-logr/logr v1.3.0 h1:2y3SDp0ZXuc6/cjLSZ+Q3ir+QB9T/iG5yYRXqsagWSY=
github.com/go-logr/logr v1.3.0/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
github.com/go-sql-driver/mysql v1.6.0/go.mod h1:DCzpHaOWr8IXmIStZouvnhqoel9Qv2LBy8hT2VhHyBg=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
github.com/golang-migrate/migrate/v4 v4.16.2 h1:8coYbMKUyInrFk1lfGfRovTLAW7PhWp8qQDT2iKfuoA=
github.com/golang-migrate/migrate/v4 v4.16.2/go.mod h1:pfcJX4nPHaVdc5nmdCikFBWtm+UBpiZjRNNsyBbp0/o=
github.com/golang-sql/civil v0.0.0-20190719163853-cb61b32ac6fe/go.mod h1:8vg3r2VgvsThLBIFL93Qb5yWzgyZWhEmBwUJWevAkK0=
github.com/golang/glog v1.1.2 h1:DVjP2PbBOzHyzA+dn3WhHIq4NdVu3Q+pvivFICf/7fo=
github.com/golang/glog v1.1.2/go.mod h1:zR+okUeTbrL6EL3xHUDxZuEtGv04p5shwip1+mL/rLQ=
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg=
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
github.com/google/cel-go v0.18.2 h1:L0B6sNBSVmt0OyECi8v6VOS74KOc9W/tLiWKfZABvf4=
github.com/google/cel-go v0.18.2/go.mod h1:kWcIzTsPX0zmQ+H3TirHstLLf9ep5QTsZBN9u4dOYLg=
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk=
github.com/hashicorp/errwrap v1.0.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/errwrap v1.1.0 h1:OxrOeh75EUXMY8TBjag2fzXGZ40LB6IKw45YeGUDY2I=
github.com/hashicorp/errwrap v1.1.0/go.mod h1:YH+1FKiLXxHSkmPseP+kNlulaMuP3n2brvKWEqk/Jc4=
github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+lD48awMYo=
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/jackc/pgpassfile v1.0.0 h1:/6Hmqy13Ss2zCq62VdNG8tM1wchn8zjSGOBJ6icpsIM=
github.com/jackc/pgpassfile v1.0.0/go.mod h1:CEx0iS5ambNFdcRtxPj5JhEz+xB6uRky5eyVu/W2HEg=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a h1:bbPeKD0xmW/Y25WS6cokEszi5g+S0QxI/d45PkRi7Nk=
github.com/jackc/pgservicefile v0.0.0-20221227161230-091c0ba34f0a/go.mod h1:5TJZWKEWniPve33vlWYSoGYefn3gLQRzjfDlhSJ9ZKM=
github.com/jackc/pgx/v5 v5.3.1 h1:Fcr8QJ1ZeLi5zsPZqQeUZhNhxfkkKBOgJuYkJHoBOtU=
github.com/jackc/pgx/v5 v5.3.1/go.mod h1:t3JDKnCBlYIc0ewLF0Q7B8MXmoIaBOZj/ic7iHozM/8=
github.com/jackc/puddle/v2 v2.2.0 h1:RdcDk92EJBuBS55nQMMYFXTxwstHug4jkhT5pq8VxPk=
github.com/jackc/puddle/v2 v2.2.0/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/klauspost/compress v1.17.2 h1:RlWWUY/Dr4fL8qk9YG7DTZ7PDgME2V4csBXA8L/ixi4=
github.com/klauspost/compress v1.17.2/go.mod h1:ntbaceVETuRiXiv4DpjP66DpAtAGkEQskQzEyD//IeE=
github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k=
github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU=
github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E=
github.com/lestrrat-go/httprc v1.0.4 h1:bAZymwoZQb+Oq8MEbyipag7iSq6YIga8Wj6GOiJGdI8=
github.com/lestrrat-go/httprc v1.0.4/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo=
github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
github.com/lestrrat-go/jwx/v2 v2.0.18 h1:HHZkYS5wWDDyAiNBwztEtDoX07WDhGEdixm8G06R50o=
github.com/lestrrat-go/jwx/v2 v2.0.18/go.mod h1:fAJ+k5eTgKdDqanzCuK6DAt3W7n3cs2/FX7JhQdk83U=
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lib/pq v1.10.1/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/lib/pq v1.10.2 h1:AqzbZs4ZoCBp+GtejcpCpcxM3zlSMx29dXbUSeVtJb8=
github.com/lib/pq v1.10.2/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
github.com/mattn/go-sqlite3 v1.14.7/go.mod h1:NyWgC/yNuGj7Q9rpYnZvas74GogHl5/Z4A/KQRfk6bU=
github.com/moby/term v0.5.0 h1:xt8Q1nalod/v7BqbG21f8mQPqH+xAaC9C3N3wfWbVP0=
github.com/moby/term v0.5.0/go.mod h1:8FzsFHVUBGZdbDsJw/ot+X+d5HLUbvklYLJ9uGfcI3Y=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/opencontainers/go-digest v1.0.0 h1:apOUWs51W5PlhuyGyz9FCeeBIOUDA/6nW8Oi/yOhh5U=
github.com/opencontainers/go-digest v1.0.0/go.mod h1:0JzlMkj0TRzQZfJkVvzbP0HBR3IKzErnv2BNG4W4MAM=
github.com/opencontainers/image-spec v1.1.0-rc5 h1:Ygwkfw9bpDvs+c9E34SdgGOj41dX/cbdlwvlWt0pnFI=
github.com/opencontainers/image-spec v1.1.0-rc5/go.mod h1:X4pATf0uXsnn3g5aiGIsVnJBR4mxhKzfwmvK/B2NTm8=
github.com/pierrec/lz4/v4 v4.1.18 h1:xaKrnTkyoqfh1YItXl56+6KJNVYWlEEPuAQW9xsplYQ=
github.com/pierrec/lz4/v4 v4.1.18/go.mod h1:gZWDp/Ze/IJXGXf23ltt2EXimqmTUXEy0GFuRQyBid4=
github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
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/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
github.com/rs/zerolog v1.31.0 h1:FcTR3NnLWW+NnTwwhFWiJSZr4ECLpqCm6QsEnyvbV4A=
github.com/rs/zerolog v1.31.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss=
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/stoewer/go-strcase v1.3.0 h1:g0eASXYtp+yvN9fK8sH94oCIk0fau9uV1/ZdJ0AVEzs=
github.com/stoewer/go-strcase v1.3.0/go.mod h1:fAH5hQ5pehh+j3nZfvwdk2RgEgQjAoM8wodgtPmh1xo=
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
github.com/stretchr/objx v0.5.0 h1:1zr/of2m5FGMsad5YfcqgdqdWrIhu+EBEJRhR1U7z/c=
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
github.com/twmb/franz-go v1.15.0 h1:bw5n1COKJzWpkCXG/kMtHrurcS9HSWV6e3If5CUdc+M=
github.com/twmb/franz-go v1.15.0/go.mod h1:nMAvTC2kHtK+ceaSHeHm4dlxC78389M/1DjpOswEgu4=
github.com/twmb/franz-go/pkg/kadm v1.9.2 h1:2Aj7DOaSFT5TyJ5BLEbAanXuby7CeWjpXW9ht8fy73c=
github.com/twmb/franz-go/pkg/kadm v1.9.2/go.mod h1:hUMoV4SRho+2ij/S9cL39JaLsr+XINjn0ZkCdBY2DXc=
github.com/twmb/franz-go/pkg/kmsg v1.6.1 h1:tm6hXPv5antMHLasTfKv9R+X03AjHSkSkXhQo2c5ALM=
github.com/twmb/franz-go/pkg/kmsg v1.6.1/go.mod h1:se9Mjdt0Nwzc9lnjJ0HyDtLyBnaBDAd7pCje47OhSyw=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1 h1:SpGay3w+nEwMpfVnbqOLH5gY52/foP8RE8UzTZ1pdSE=
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.46.1/go.mod h1:4UoMYEZOC0yN/sPGH76KPkkU7zgiEWYWL9vwmbnTJPE=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1 h1:aFJWCqJMNjENlcleuuOkGAPH82y0yULBScfXcIEdS24=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.46.1/go.mod h1:sEGXWArGqc3tVa+ekntsN65DmVbVeW+7lTKTjZF3/Fo=
go.opentelemetry.io/otel v1.21.0 h1:hzLeKBZEL7Okw2mGzZ0cc4k/A7Fta0uoPgaJCr8fsFc=
go.opentelemetry.io/otel v1.21.0/go.mod h1:QZzNPQPm1zLX4gZK4cMi+71eaorMSGT3A4znnUvNNEo=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0 h1:cl5P5/GIfFh4t6xyruOgJP5QiA1pw4fYYdv6nc6CBWw=
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.21.0/go.mod h1:zgBdWWAu7oEEMC06MMKc5NLbA/1YDXV1sMpSqEeLQLg=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0 h1:tIqheXEFWAZ7O8A7m+J0aPTmpJN3YQ7qetUAdkkkKpk=
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.21.0/go.mod h1:nUeKExfxAQVbiVFn32YXpXZZHZ61Cc3s3Rn1pDBGAb0=
go.opentelemetry.io/otel/metric v1.21.0 h1:tlYWfeo+Bocx5kLEloTjbcDwBuELRrIFxwdQ36PlJu4=
go.opentelemetry.io/otel/metric v1.21.0/go.mod h1:o1p3CA8nNHW8j5yuQLdc1eeqEaPfzug24uvsyIEJRWM=
go.opentelemetry.io/otel/sdk v1.21.0 h1:FTt8qirL1EysG6sTQRZ5TokkU8d0ugCj8htOgThZXQ8=
go.opentelemetry.io/otel/sdk v1.21.0/go.mod h1:Nna6Yv7PWTdgJHVRD9hIYywQBRx7pbox6nwBnZIxl/E=
go.opentelemetry.io/otel/trace v1.21.0 h1:WD9i5gzvoUPuXIXH24ZNBudiarZDKuekPqi/E8fpfLc=
go.opentelemetry.io/otel/trace v1.21.0/go.mod h1:LGbsEB0f9LGjN+OZaQQ26sohbOmiMR+BaslueVtS/qQ=
go.opentelemetry.io/proto/otlp v1.0.0 h1:T0TX0tmXU8a3CbNXzEKGeU5mIVOdf0oykP+u2lIVU/I=
go.opentelemetry.io/proto/otlp v1.0.0/go.mod h1:Sy6pihPLfYHkr3NkUbEhGHFhINUSI/v80hjKIs5JXpM=
go.uber.org/atomic v1.11.0 h1:ZvwS0R+56ePWxUNi+Atn9dWONBPp/AUETXlHW0DxSjE=
go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0=
go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto=
go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE=
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.16.0 h1:mMMrFzRSCF0GvB7Ne27XVtVAaXLrPmgPC7/v0tkwHaY=
golang.org/x/crypto v0.16.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa h1:FRnLl4eNAQl8hwxVVC17teOw8kdjVDVAiFMtgUdTSRQ=
golang.org/x/exp v0.0.0-20231110203233-9a3e6036ecaa/go.mod h1:zk2irFbV9DP96SEBUUAy67IdHUaZuSnrz1n472HUCLE=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.14.0 h1:dGoOF9QVLYng8IHTm7BAyWqCqSheQ5pYWGhzW00YJr0=
golang.org/x/mod v0.14.0/go.mod h1:hTbmBsO62+eylJbnUtE2MGJUyE7QWk4xUqPFrRgJ+7c=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.18.0 h1:mIYleuAkSbHh0tCv7RvjL3F6ZVbLjq4+R7zbOn3Kokg=
golang.org/x/net v0.18.0/go.mod h1:/czyP5RqHAH4odGYxBJ1qz0+CE5WZ+2j1YgoEo8F2jQ=
golang.org/x/oauth2 v0.12.0 h1:smVPGxink+n1ZI5pkQa8y6fZT0RW0MgCO5bFpepy4B4=
golang.org/x/oauth2 v0.12.0/go.mod h1:A74bZ3aGXgCY0qaIC9Ahg6Lglin4AMAco8cIv9baba4=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.5.0 h1:60k92dhOjHxJkrqnwsfl8KuaHbn/5dl0lUPUklKo3qE=
golang.org/x/sync v0.5.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.15.0 h1:h48lPFYpsTvQJZF4EKyI4aLHaev3CxivZmv7yZig9pc=
golang.org/x/sys v0.15.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.15.0/go.mod h1:BDl952bC7+uMoWR75FIrCDx79TPU9oHkTZ9yRbYOrX0=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/tools v0.15.0 h1:zdAyfUGbYmuVokhzVmghFl2ZJh5QhcfebBgmVPFYA+8=
golang.org/x/tools v0.15.0/go.mod h1:hpksKq4dtpQWS1uQ61JkdqWM3LscIS6Slf+VVkm+wQk=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405 h1:I6WNifs6pF9tNdSob2W24JtyxIYjzFB9qDlpUC76q+U=
google.golang.org/genproto v0.0.0-20231030173426-d783a09b4405/go.mod h1:3WDQMjmJk36UQhjQ89emUzb1mdaHcPeeAh4SCBKznB4=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17 h1:JpwMPBpFN3uKhdaekDpiNlImDdkUAyiJ6ez/uxGaUSo=
google.golang.org/genproto/googleapis/api v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:0xJLfVdJqpAPl8tDg1ujOCGzx6LFLttXT5NhllGOXY4=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17 h1:Jyp0Hsi0bmHXG6k9eATXoYtjd6e2UzZ1SCn/wIupY14=
google.golang.org/genproto/googleapis/rpc v0.0.0-20231106174013-bbf56f31fb17/go.mod h1:oQ5rr10WTTMvP4A36n8JpR1OrO1BEiV4f78CneXZxkA=
google.golang.org/grpc v1.59.0 h1:Z5Iec2pjwb+LEOqzpB2MR12/eKFhDPhuqW91O+4bwUk=
google.golang.org/grpc v1.59.0/go.mod h1:aUPDwccQo6OTjy7Hct4AfBPD1GptF4fyUjIkQ9YtF98=
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.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1 h1:fk72uXZyuZiTtW5tgd63jyVK6582lF61nRC/kGv6vCA=
google.golang.org/protobuf v1.31.1-0.20231027082548-f4a6c1f6e5c1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=

View File

@@ -0,0 +1,70 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package config
import (
"os"
"github.com/hexolan/stocklet/internal/pkg/errors"
)
// Load an option from an environment variable
func loadFromEnv(name string) *string {
value, exists := os.LookupEnv(name)
if !exists || value == "" {
return nil
}
return &value
}
// Require an option from an environment variable
func RequireFromEnv(name string) (string, error) {
value := loadFromEnv(name)
if value == nil {
return "", errors.NewServiceErrorf(errors.ErrCodeService, "failed to load required cfg option (%s)", name)
}
return *value, nil
}
// Shared configuration implemented by all services
type SharedConfig struct {
// Env Var: "MODE" (optional)
// 'dev' or 'development' -> true
// Defaults to false
DevMode bool
Otel OtelConfig
}
// Load the options in the shared config
func (cfg *SharedConfig) Load() error {
// Determine application mode
cfg.DevMode = false
if mode, err := RequireFromEnv("MODE"); err == nil && (mode == "dev" || mode == "development") {
cfg.DevMode = true
}
// load the Open Telemetry config
cfg.Otel = OtelConfig{}
if err := cfg.Otel.Load(); err != nil {
return err
}
// Config succesfully loaded
return nil
}

View File

@@ -0,0 +1,40 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package config
import (
"strings"
)
type KafkaConfig struct {
// Env Var: "KAFKA_BROKERS"
// Comma delimited from env var.
Brokers []string
}
func (cfg *KafkaConfig) Load() error {
// load configurations from env
brokersOpt, err := RequireFromEnv("KAFKA_BROKERS")
if err != nil {
return err
}
// Comma seperate the kafka brokers
cfg.Brokers = strings.Split(brokersOpt, ",")
// Config options were succesfully loaded
return nil
}

View File

@@ -0,0 +1,33 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package config
type OtelConfig struct {
// Env Var: "OTEL_COLLECTOR_GRPC"
CollectorGrpc string
}
func (cfg *OtelConfig) Load() error {
// Load configurations from env
if collectorGrpc, err := RequireFromEnv("OTEL_COLLECTOR_GRPC"); err != nil {
return err
} else {
cfg.CollectorGrpc = collectorGrpc
}
// Succesfully loaded config properties
return nil
}

View File

@@ -0,0 +1,85 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package config
import (
"fmt"
)
type PostgresConfig struct {
// Env Var: "PG_USER"
Username string
// Env Var: "PG_PASS"
Password string
// Env Var: "PG_HOST"
Host string
// Env Var: "PG_PORT" (optional)
// Defaults to "5432"
Port string
// Env Var: "PG_DB"
Database string
}
func (conf *PostgresConfig) GetDSN() string {
return fmt.Sprintf(
"postgresql://%s:%s@%s:%s/%s?sslmode=disable",
conf.Username,
conf.Password,
conf.Host,
conf.Port,
conf.Database,
)
}
func (cfg *PostgresConfig) Load() error {
// Load configurations from env
if opt, err := RequireFromEnv("PG_USER"); err != nil {
return err
} else {
cfg.Username = opt
}
if opt, err := RequireFromEnv("PG_PASS"); err != nil {
return err
} else {
cfg.Password = opt
}
if opt, err := RequireFromEnv("PG_HOST"); err != nil {
return err
} else {
cfg.Host = opt
}
if opt, err := RequireFromEnv("PG_PORT"); err != nil {
cfg.Port = "5432"
} else {
cfg.Port = opt
}
if opt, err := RequireFromEnv("PG_DB"); err != nil {
return err
} else {
cfg.Database = opt
}
// Config properties succesfully loaded
return nil
}

View File

@@ -0,0 +1,62 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package errors
import (
"google.golang.org/grpc/codes"
)
type ErrorCode int32
const (
ErrCodeUnknown ErrorCode = iota
ErrCodeService
ErrCodeExtService
ErrCodeNotFound
ErrCodeAlreadyExists
ErrCodeForbidden
ErrCodeUnauthorised
ErrCodeInvalidArgument
)
// Maps the custom service error codes
// to their gRPC status code equivalents.
func (c ErrorCode) GRPCCode() codes.Code {
codeMap := map[ErrorCode]codes.Code{
ErrCodeUnknown: codes.Unknown,
ErrCodeService: codes.Internal,
ErrCodeExtService: codes.Unavailable,
ErrCodeNotFound: codes.NotFound,
ErrCodeAlreadyExists: codes.AlreadyExists,
ErrCodeForbidden: codes.PermissionDenied,
ErrCodeUnauthorised: codes.PermissionDenied,
ErrCodeInvalidArgument: codes.InvalidArgument,
}
grpcCode, mapped := codeMap[c]
if mapped {
return grpcCode
}
return codes.Unknown
}

View File

@@ -0,0 +1,71 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package errors
import (
"fmt"
"google.golang.org/grpc/status"
)
type ServiceError struct {
code ErrorCode
msg string
wrapped error
}
func NewServiceError(code ErrorCode, msg string) error {
return &ServiceError{
code: code,
msg: msg,
}
}
func NewServiceErrorf(code ErrorCode, msg string, args ...interface{}) error {
return NewServiceError(code, fmt.Sprintf(msg, args...))
}
func WrapServiceError(code ErrorCode, msg string, wrapped error) error {
return &ServiceError{
code: code,
msg: msg,
wrapped: wrapped,
}
}
func (e ServiceError) Error() string {
if e.wrapped != nil {
return fmt.Sprintf("%s: %s", e.msg, e.wrapped.Error())
}
return e.msg
}
func (e ServiceError) Code() ErrorCode {
return e.code
}
// Set the gRPC status to only expose the top error message.
//
// This is to prevent any full error contexts (from wrapped errors) being exposed to users by the gateway.
// e.g. "{"code":2,"message":"something went wrong scanning order: failed to connect to `host=postgres user=postgres database=postgres`: hostname resolving error (lookup postgres on 127.0.0.11:53: server misbehaving)","details":[]}"
func (e ServiceError) GRPCStatus() *status.Status {
return status.New(e.Code().GRPCCode(), e.msg)
}
func (e ServiceError) Unwrap() error {
return e.wrapped
}

View File

@@ -0,0 +1,96 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package gwauth
import (
"context"
"encoding/base64"
"encoding/json"
"google.golang.org/grpc/metadata"
"github.com/hexolan/stocklet/internal/pkg/errors"
)
const JWTPayloadHeader string = "X-JWT-Payload"
type JWTClaims struct {
Subject string `json:"sub"`
IssuedAt int64 `json:"iat"`
Expiry int64 `json:"exp"`
}
func IsGatewayRequest(ctx context.Context) (bool, *metadata.MD) {
// Check the gRPC request has metadata
md, exists := metadata.FromIncomingContext(ctx)
if !exists {
return false, nil
}
if len(md.Get("from-gateway")) != 0 {
return true, &md
}
return false, &md
}
func GetGatewayUser(md *metadata.MD) (*JWTClaims, error) {
// Check a token payload has been passed down
// Envoy validates JWT tokens and provides a "X-JWT-Payload" header (containing base64 JWT token claims)
authorization := md.Get("jwt-payload")
if len(authorization) != 1 {
return nil, errors.NewServiceError(errors.ErrCodeUnauthorised, "invalid jwt")
}
// User is authenticated
// Attempt to decode the jwt-payload
bytes, err := base64.StdEncoding.DecodeString(authorization[0])
if err != nil {
return nil, errors.WrapServiceError(errors.ErrCodeUnauthorised, "malformed jwt", err)
}
var claims JWTClaims
err = json.Unmarshal(bytes, &claims)
if err != nil {
return nil, errors.WrapServiceError(errors.ErrCodeUnauthorised, "malformed jwt", err)
}
return &claims, nil
}
func getTokenPayload(md *metadata.MD) (*JWTClaims, error) {
// Envoy validates JWT tokens and provides a header containing
// valid auth token claims in base64 format.
authorization := md.Get("jwt-payload")
if len(authorization) != 1 {
return nil, errors.NewServiceError(errors.ErrCodeUnauthorised, "auth token not provided")
}
// User is authenticated
// Attempt to decode the jwt-payload
bytes, err := base64.StdEncoding.DecodeString(authorization[0])
if err != nil {
return nil, errors.WrapServiceError(errors.ErrCodeUnauthorised, "malformed jwt", err)
}
var claims JWTClaims
err = json.Unmarshal(bytes, &claims)
if err != nil {
return nil, errors.WrapServiceError(errors.ErrCodeUnauthorised, "malformed jwt", err)
}
return &claims, nil
}

View File

@@ -0,0 +1,48 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package messaging
import (
"context"
"github.com/twmb/franz-go/pkg/kadm"
"github.com/twmb/franz-go/pkg/kgo"
"github.com/hexolan/stocklet/internal/pkg/config"
"github.com/hexolan/stocklet/internal/pkg/errors"
)
func NewKafkaConn(conf *config.KafkaConfig, opts ...kgo.Opt) (*kgo.Client, error) {
opts = append(opts, kgo.SeedBrokers(conf.Brokers...))
cl, err := kgo.NewClient(opts...)
if err != nil {
return nil, errors.WrapServiceError(errors.ErrCodeExtService, "failed to connect to Kafka", err)
}
return cl, nil
}
func EnsureKafkaTopics(cl *kgo.Client, topics ...string) error {
ctx := context.Background()
kadmCl := kadm.NewClient(cl)
_, err := kadmCl.CreateTopics(ctx, -1, -1, nil, topics...)
if err != nil {
return errors.WrapServiceError(errors.ErrCodeExtService, "failed to create Kafka topics", err)
}
return nil
}

View File

@@ -0,0 +1,93 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package messaging
import (
"google.golang.org/protobuf/proto"
"google.golang.org/protobuf/reflect/protoreflect"
)
type ConsumerController interface {
Start()
Stop()
}
// Topic Definitions
const (
// Order Topics
Order_State_Topic = "order.state"
Order_State_Created_Topic = Order_State_Topic + ".created"
Order_State_Pending_Topic = Order_State_Topic + ".pending"
Order_State_Rejected_Topic = Order_State_Topic + ".rejected"
Order_State_Approved_Topic = Order_State_Topic + ".approved"
// Payment Topics
Payment_Balance_Topic = "payment.balance"
Payment_Balance_Created_Topic = Payment_Balance_Topic + ".created"
Payment_Balance_Credited_Topic = Payment_Balance_Topic + ".credited"
Payment_Balance_Debited_Topic = Payment_Balance_Topic + ".debited"
Payment_Balance_Closed_Topic = Payment_Balance_Topic + ".closed"
Payment_Transaction_Topic = "payment.transaction"
Payment_Transaction_Created_Topic = Payment_Transaction_Topic + ".created"
Payment_Transaction_Reversed_Topic = Payment_Transaction_Topic + ".reversed"
Payment_Processing_Topic = "payment.processing"
// Product Topics
Product_State_Topic = "product.state"
Product_State_Created_Topic = Product_State_Topic + ".created"
Product_State_Deleted_Topic = Product_State_Topic + ".deleted"
Product_Attribute_Topic = "product.attr"
Product_Attribute_Price_Topic = Product_Attribute_Topic + ".price"
Product_PriceQuotation_Topic = "product.pricequotation"
// Shipping Topics
Shipping_Shipment_Topic = "shipping.shipment"
Shipping_Shipment_Allocation_Topic = Shipping_Shipment_Topic + ".allocation"
Shipping_Shipment_Dispatched_Topic = Shipping_Shipment_Topic + ".dispatched"
// User Topics
User_State_Topic = "user.state"
User_State_Created_Topic = User_State_Topic + ".created"
User_State_Deleted_Topic = User_State_Topic + ".deleted"
User_Attribute_Topic = "user.attr"
User_Attribute_Email_Topic = User_Attribute_Topic + ".email"
// Warehouse Topics
Warehouse_Stock_Topic = "warehouse.stock"
Warehouse_Stock_Created_Topic = Warehouse_Stock_Topic + ".created"
Warehouse_Stock_Added_Topic = Warehouse_Stock_Topic + ".added"
Warehouse_Stock_Removed_Topic = Warehouse_Stock_Topic + ".removed"
Warehouse_Reservation_Topic = "warehouse.reservation"
Warehouse_Reservation_Failed_Topic = Warehouse_Reservation_Topic + ".failed"
Warehouse_Reservation_Reserved_Topic = Warehouse_Reservation_Topic + ".reserved"
Warehouse_Reservation_Returned_Topic = Warehouse_Reservation_Topic + ".returned"
Warehouse_Reservation_Consumed_Topic = Warehouse_Reservation_Topic + ".consumed"
)
func MarshalEvent(event protoreflect.ProtoMessage, topic string) ([]byte, string, error) {
wireEvent, err := proto.Marshal(event)
if err != nil {
return []byte{}, "", err
}
return wireEvent, topic, nil
}

View File

@@ -0,0 +1,24 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package metrics
import (
"github.com/rs/zerolog"
)
func ConfigureLogger() {
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
}

View File

@@ -0,0 +1,82 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
package metrics
import (
"context"
"github.com/rs/zerolog/log"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc"
"go.opentelemetry.io/otel/propagation"
sdkresource "go.opentelemetry.io/otel/sdk/resource"
sdktrace "go.opentelemetry.io/otel/sdk/trace"
semconv "go.opentelemetry.io/otel/semconv/v1.21.0"
"github.com/hexolan/stocklet/internal/pkg/config"
)
// Initiate the OpenTelemetry tracer provider
func InitTracerProvider(cfg *config.OtelConfig, svcName string) *sdktrace.TracerProvider {
// Create resource and trace exporter (to otel-collector)
resource := initTracerResource(svcName)
exporter := initTracerExporter(cfg.CollectorGrpc)
// Create the trace provider
tp := sdktrace.NewTracerProvider(
sdktrace.WithBatcher(exporter),
sdktrace.WithResource(resource),
)
otel.SetTracerProvider(tp)
otel.SetTextMapPropagator(propagation.TraceContext{})
return tp
}
// Establishes a connection to otel-collector over gRPC
func initTracerExporter(collectorEndpoint string) sdktrace.SpanExporter {
ctx := context.Background()
exporter, err := otlptracegrpc.New(
ctx,
otlptracegrpc.WithEndpoint(collectorEndpoint),
otlptracegrpc.WithInsecure(),
)
if err != nil {
log.Panic().Err(err).Msg("otel: failed to start otlp gRPC exporter")
}
return exporter
}
// Prepare a tracer resource to use with the tracing provider
func initTracerResource(svcName string) *sdkresource.Resource {
ctx := context.Background()
resource, err := sdkresource.New(
ctx,
sdkresource.WithAttributes(
semconv.ServiceName(svcName),
),
)
if err != nil {
log.Panic().Err(err).Msg("otel: failed to create tracer resource")
}
return resource
}

View File

@@ -0,0 +1,579 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/auth/v1/service.proto
package auth_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/googleapis/api/visibility"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type GetJwksRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *GetJwksRequest) Reset() {
*x = GetJwksRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetJwksRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetJwksRequest) ProtoMessage() {}
func (x *GetJwksRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetJwksRequest.ProtoReflect.Descriptor instead.
func (*GetJwksRequest) Descriptor() ([]byte, []int) {
return file_stocklet_auth_v1_service_proto_rawDescGZIP(), []int{0}
}
type GetJwksResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Keys []*PublicEcJWK `protobuf:"bytes,1,rep,name=keys,proto3" json:"keys,omitempty"`
}
func (x *GetJwksResponse) Reset() {
*x = GetJwksResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetJwksResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetJwksResponse) ProtoMessage() {}
func (x *GetJwksResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetJwksResponse.ProtoReflect.Descriptor instead.
func (*GetJwksResponse) Descriptor() ([]byte, []int) {
return file_stocklet_auth_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *GetJwksResponse) GetKeys() []*PublicEcJWK {
if x != nil {
return x.Keys
}
return nil
}
type LoginPasswordRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
}
func (x *LoginPasswordRequest) Reset() {
*x = LoginPasswordRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LoginPasswordRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginPasswordRequest) ProtoMessage() {}
func (x *LoginPasswordRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LoginPasswordRequest.ProtoReflect.Descriptor instead.
func (*LoginPasswordRequest) Descriptor() ([]byte, []int) {
return file_stocklet_auth_v1_service_proto_rawDescGZIP(), []int{2}
}
func (x *LoginPasswordRequest) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *LoginPasswordRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type LoginPasswordResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"`
Data *AuthToken `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
}
func (x *LoginPasswordResponse) Reset() {
*x = LoginPasswordResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *LoginPasswordResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*LoginPasswordResponse) ProtoMessage() {}
func (x *LoginPasswordResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use LoginPasswordResponse.ProtoReflect.Descriptor instead.
func (*LoginPasswordResponse) Descriptor() ([]byte, []int) {
return file_stocklet_auth_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *LoginPasswordResponse) GetDetail() string {
if x != nil {
return x.Detail
}
return ""
}
func (x *LoginPasswordResponse) GetData() *AuthToken {
if x != nil {
return x.Data
}
return nil
}
type SetPasswordRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
UserId string `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"`
}
func (x *SetPasswordRequest) Reset() {
*x = SetPasswordRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SetPasswordRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetPasswordRequest) ProtoMessage() {}
func (x *SetPasswordRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SetPasswordRequest.ProtoReflect.Descriptor instead.
func (*SetPasswordRequest) Descriptor() ([]byte, []int) {
return file_stocklet_auth_v1_service_proto_rawDescGZIP(), []int{4}
}
func (x *SetPasswordRequest) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *SetPasswordRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type SetPasswordResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Detail string `protobuf:"bytes,1,opt,name=detail,proto3" json:"detail,omitempty"`
}
func (x *SetPasswordResponse) Reset() {
*x = SetPasswordResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *SetPasswordResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SetPasswordResponse) ProtoMessage() {}
func (x *SetPasswordResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_auth_v1_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use SetPasswordResponse.ProtoReflect.Descriptor instead.
func (*SetPasswordResponse) Descriptor() ([]byte, []int) {
return file_stocklet_auth_v1_service_proto_rawDescGZIP(), []int{5}
}
func (x *SetPasswordResponse) GetDetail() string {
if x != nil {
return x.Detail
}
return ""
}
var File_stocklet_auth_v1_service_proto protoreflect.FileDescriptor
var file_stocklet_auth_v1_service_proto_rawDesc = []byte{
0x0a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f,
0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x10, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e,
0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f,
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,
0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62,
0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f,
0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70,
0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73,
0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x10, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x4a,
0x77, 0x6b, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x44, 0x0a, 0x0f, 0x47, 0x65,
0x74, 0x4a, 0x77, 0x6b, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x31, 0x0a,
0x04, 0x6b, 0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1d, 0x2e, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x50,
0x75, 0x62, 0x6c, 0x69, 0x63, 0x45, 0x63, 0x4a, 0x57, 0x4b, 0x52, 0x04, 0x6b, 0x65, 0x79, 0x73,
0x22, 0x65, 0x0a, 0x14, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72,
0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72,
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xe0, 0x41, 0x02, 0xba, 0x48,
0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a,
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42,
0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x40, 0x52, 0x08, 0x70,
0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x60, 0x0a, 0x15, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x12, 0x2f, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f,
0x6b, 0x65, 0x6e, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x63, 0x0a, 0x12, 0x53, 0x65, 0x74,
0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
0x23, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,
0x42, 0x0a, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x06, 0x75, 0x73,
0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, 0x04,
0x10, 0x01, 0x18, 0x40, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x2d,
0x0a, 0x13, 0x53, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x64, 0x65, 0x74, 0x61, 0x69, 0x6c, 0x32, 0xd0, 0x04,
0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a,
0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76,
0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x65, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x4a, 0x77,
0x6b, 0x73, 0x12, 0x20, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75,
0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x77, 0x6b, 0x73, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4a, 0x77, 0x6b, 0x73, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0f, 0x12,
0x0d, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6a, 0x77, 0x6b, 0x73, 0x12, 0x7b,
0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12,
0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e,
0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e,
0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31,
0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x78, 0x0a, 0x0b, 0x53,
0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68,
0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x16, 0x3a,
0x01, 0x2a, 0x22, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x70, 0x61, 0x73,
0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x69, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73,
0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74,
0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,
0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10,
0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c,
0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68,
0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f,
0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x3b, 0x61, 0x75,
0x74, 0x68, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_auth_v1_service_proto_rawDescOnce sync.Once
file_stocklet_auth_v1_service_proto_rawDescData = file_stocklet_auth_v1_service_proto_rawDesc
)
func file_stocklet_auth_v1_service_proto_rawDescGZIP() []byte {
file_stocklet_auth_v1_service_proto_rawDescOnce.Do(func() {
file_stocklet_auth_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_auth_v1_service_proto_rawDescData)
})
return file_stocklet_auth_v1_service_proto_rawDescData
}
var file_stocklet_auth_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_stocklet_auth_v1_service_proto_goTypes = []interface{}{
(*GetJwksRequest)(nil), // 0: stocklet.auth.v1.GetJwksRequest
(*GetJwksResponse)(nil), // 1: stocklet.auth.v1.GetJwksResponse
(*LoginPasswordRequest)(nil), // 2: stocklet.auth.v1.LoginPasswordRequest
(*LoginPasswordResponse)(nil), // 3: stocklet.auth.v1.LoginPasswordResponse
(*SetPasswordRequest)(nil), // 4: stocklet.auth.v1.SetPasswordRequest
(*SetPasswordResponse)(nil), // 5: stocklet.auth.v1.SetPasswordResponse
(*PublicEcJWK)(nil), // 6: stocklet.auth.v1.PublicEcJWK
(*AuthToken)(nil), // 7: stocklet.auth.v1.AuthToken
(*v1.ServiceInfoRequest)(nil), // 8: stocklet.common.v1.ServiceInfoRequest
(*v11.UserDeletedEvent)(nil), // 9: stocklet.events.v1.UserDeletedEvent
(*v1.ServiceInfoResponse)(nil), // 10: stocklet.common.v1.ServiceInfoResponse
(*emptypb.Empty)(nil), // 11: google.protobuf.Empty
}
var file_stocklet_auth_v1_service_proto_depIdxs = []int32{
6, // 0: stocklet.auth.v1.GetJwksResponse.keys:type_name -> stocklet.auth.v1.PublicEcJWK
7, // 1: stocklet.auth.v1.LoginPasswordResponse.data:type_name -> stocklet.auth.v1.AuthToken
8, // 2: stocklet.auth.v1.AuthService.ServiceInfo:input_type -> stocklet.common.v1.ServiceInfoRequest
0, // 3: stocklet.auth.v1.AuthService.GetJwks:input_type -> stocklet.auth.v1.GetJwksRequest
2, // 4: stocklet.auth.v1.AuthService.LoginPassword:input_type -> stocklet.auth.v1.LoginPasswordRequest
4, // 5: stocklet.auth.v1.AuthService.SetPassword:input_type -> stocklet.auth.v1.SetPasswordRequest
9, // 6: stocklet.auth.v1.AuthService.ProcessUserDeletedEvent:input_type -> stocklet.events.v1.UserDeletedEvent
10, // 7: stocklet.auth.v1.AuthService.ServiceInfo:output_type -> stocklet.common.v1.ServiceInfoResponse
1, // 8: stocklet.auth.v1.AuthService.GetJwks:output_type -> stocklet.auth.v1.GetJwksResponse
3, // 9: stocklet.auth.v1.AuthService.LoginPassword:output_type -> stocklet.auth.v1.LoginPasswordResponse
5, // 10: stocklet.auth.v1.AuthService.SetPassword:output_type -> stocklet.auth.v1.SetPasswordResponse
11, // 11: stocklet.auth.v1.AuthService.ProcessUserDeletedEvent:output_type -> google.protobuf.Empty
7, // [7:12] is the sub-list for method output_type
2, // [2:7] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_auth_v1_service_proto_init() }
func file_stocklet_auth_v1_service_proto_init() {
if File_stocklet_auth_v1_service_proto != nil {
return
}
file_stocklet_auth_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_stocklet_auth_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetJwksRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_auth_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetJwksResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_auth_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LoginPasswordRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_auth_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*LoginPasswordResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_auth_v1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetPasswordRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_auth_v1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SetPasswordResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_auth_v1_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_stocklet_auth_v1_service_proto_goTypes,
DependencyIndexes: file_stocklet_auth_v1_service_proto_depIdxs,
MessageInfos: file_stocklet_auth_v1_service_proto_msgTypes,
}.Build()
File_stocklet_auth_v1_service_proto = out.File
file_stocklet_auth_v1_service_proto_rawDesc = nil
file_stocklet_auth_v1_service_proto_goTypes = nil
file_stocklet_auth_v1_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,395 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: stocklet/auth/v1/service.proto
/*
Package auth_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package auth_v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_AuthService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := server.ServiceInfo(ctx, &protoReq)
return msg, metadata, err
}
func request_AuthService_GetJwks_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetJwksRequest
var metadata runtime.ServerMetadata
msg, err := client.GetJwks(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_GetJwks_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetJwksRequest
var metadata runtime.ServerMetadata
msg, err := server.GetJwks(ctx, &protoReq)
return msg, metadata, err
}
func request_AuthService_LoginPassword_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq LoginPasswordRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.LoginPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_LoginPassword_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq LoginPasswordRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.LoginPassword(ctx, &protoReq)
return msg, metadata, err
}
func request_AuthService_SetPassword_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq SetPasswordRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.SetPassword(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_AuthService_SetPassword_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq SetPasswordRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.SetPassword(ctx, &protoReq)
return msg, metadata, err
}
// RegisterAuthServiceHandlerServer registers the http handlers for service AuthService to "mux".
// UnaryRPC :call AuthServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthServiceHandlerFromEndpoint instead.
func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error {
mux.Handle("GET", pattern_AuthService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/auth/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_ServiceInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_AuthService_GetJwks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/GetJwks", runtime.WithHTTPPathPattern("/v1/auth/jwks"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_GetJwks_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_GetJwks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_AuthService_LoginPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/LoginPassword", runtime.WithHTTPPathPattern("/v1/auth/login"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_LoginPassword_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_LoginPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_AuthService_SetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/SetPassword", runtime.WithHTTPPathPattern("/v1/auth/password"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_AuthService_SetPassword_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_SetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterAuthServiceHandlerFromEndpoint is same as RegisterAuthServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterAuthServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterAuthServiceHandler(ctx, mux, conn)
}
// RegisterAuthServiceHandler registers the http handlers for service AuthService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterAuthServiceHandlerClient(ctx, mux, NewAuthServiceClient(conn))
}
// RegisterAuthServiceHandlerClient registers the http handlers for service AuthService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "AuthServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "AuthServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "AuthServiceClient" to call the correct interceptors.
func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error {
mux.Handle("GET", pattern_AuthService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/auth/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_ServiceInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_AuthService_GetJwks_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/GetJwks", runtime.WithHTTPPathPattern("/v1/auth/jwks"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_GetJwks_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_GetJwks_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_AuthService_LoginPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/LoginPassword", runtime.WithHTTPPathPattern("/v1/auth/login"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_LoginPassword_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_LoginPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_AuthService_SetPassword_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.auth.v1.AuthService/SetPassword", runtime.WithHTTPPathPattern("/v1/auth/password"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_AuthService_SetPassword_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_AuthService_SetPassword_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_AuthService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "service"}, ""))
pattern_AuthService_GetJwks_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "jwks"}, ""))
pattern_AuthService_LoginPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "login"}, ""))
pattern_AuthService_SetPassword_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "password"}, ""))
)
var (
forward_AuthService_ServiceInfo_0 = runtime.ForwardResponseMessage
forward_AuthService_GetJwks_0 = runtime.ForwardResponseMessage
forward_AuthService_LoginPassword_0 = runtime.ForwardResponseMessage
forward_AuthService_SetPassword_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,291 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: stocklet/auth/v1/service.proto
package auth_v1
import (
context "context"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
AuthService_ServiceInfo_FullMethodName = "/stocklet.auth.v1.AuthService/ServiceInfo"
AuthService_GetJwks_FullMethodName = "/stocklet.auth.v1.AuthService/GetJwks"
AuthService_LoginPassword_FullMethodName = "/stocklet.auth.v1.AuthService/LoginPassword"
AuthService_SetPassword_FullMethodName = "/stocklet.auth.v1.AuthService/SetPassword"
AuthService_ProcessUserDeletedEvent_FullMethodName = "/stocklet.auth.v1.AuthService/ProcessUserDeletedEvent"
)
// AuthServiceClient is the client API for AuthService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AuthServiceClient interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
GetJwks(ctx context.Context, in *GetJwksRequest, opts ...grpc.CallOption) (*GetJwksResponse, error)
LoginPassword(ctx context.Context, in *LoginPasswordRequest, opts ...grpc.CallOption) (*LoginPasswordResponse, error)
SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*SetPasswordResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessUserDeletedEvent(ctx context.Context, in *v11.UserDeletedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type authServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {
return &authServiceClient{cc}
}
func (c *authServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
out := new(v1.ServiceInfoResponse)
err := c.cc.Invoke(ctx, AuthService_ServiceInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) GetJwks(ctx context.Context, in *GetJwksRequest, opts ...grpc.CallOption) (*GetJwksResponse, error) {
out := new(GetJwksResponse)
err := c.cc.Invoke(ctx, AuthService_GetJwks_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) LoginPassword(ctx context.Context, in *LoginPasswordRequest, opts ...grpc.CallOption) (*LoginPasswordResponse, error) {
out := new(LoginPasswordResponse)
err := c.cc.Invoke(ctx, AuthService_LoginPassword_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) SetPassword(ctx context.Context, in *SetPasswordRequest, opts ...grpc.CallOption) (*SetPasswordResponse, error) {
out := new(SetPasswordResponse)
err := c.cc.Invoke(ctx, AuthService_SetPassword_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *authServiceClient) ProcessUserDeletedEvent(ctx context.Context, in *v11.UserDeletedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, AuthService_ProcessUserDeletedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// AuthServiceServer is the server API for AuthService service.
// All implementations must embed UnimplementedAuthServiceServer
// for forward compatibility
type AuthServiceServer interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
GetJwks(context.Context, *GetJwksRequest) (*GetJwksResponse, error)
LoginPassword(context.Context, *LoginPasswordRequest) (*LoginPasswordResponse, error)
SetPassword(context.Context, *SetPasswordRequest) (*SetPasswordResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error)
mustEmbedUnimplementedAuthServiceServer()
}
// UnimplementedAuthServiceServer must be embedded to have forward compatible implementations.
type UnimplementedAuthServiceServer struct {
}
func (UnimplementedAuthServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
}
func (UnimplementedAuthServiceServer) GetJwks(context.Context, *GetJwksRequest) (*GetJwksResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetJwks not implemented")
}
func (UnimplementedAuthServiceServer) LoginPassword(context.Context, *LoginPasswordRequest) (*LoginPasswordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method LoginPassword not implemented")
}
func (UnimplementedAuthServiceServer) SetPassword(context.Context, *SetPasswordRequest) (*SetPasswordResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method SetPassword not implemented")
}
func (UnimplementedAuthServiceServer) ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessUserDeletedEvent not implemented")
}
func (UnimplementedAuthServiceServer) mustEmbedUnimplementedAuthServiceServer() {}
// UnsafeAuthServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AuthServiceServer will
// result in compilation errors.
type UnsafeAuthServiceServer interface {
mustEmbedUnimplementedAuthServiceServer()
}
func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {
s.RegisterService(&AuthService_ServiceDesc, srv)
}
func _AuthService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.ServiceInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).ServiceInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_ServiceInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_GetJwks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetJwksRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).GetJwks(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_GetJwks_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).GetJwks(ctx, req.(*GetJwksRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_LoginPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(LoginPasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).LoginPassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_LoginPassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).LoginPassword(ctx, req.(*LoginPasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_SetPassword_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SetPasswordRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).SetPassword(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_SetPassword_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).SetPassword(ctx, req.(*SetPasswordRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AuthService_ProcessUserDeletedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.UserDeletedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AuthServiceServer).ProcessUserDeletedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AuthService_ProcessUserDeletedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AuthServiceServer).ProcessUserDeletedEvent(ctx, req.(*v11.UserDeletedEvent))
}
return interceptor(ctx, in, info, handler)
}
// AuthService_ServiceDesc is the grpc.ServiceDesc for AuthService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AuthService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stocklet.auth.v1.AuthService",
HandlerType: (*AuthServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ServiceInfo",
Handler: _AuthService_ServiceInfo_Handler,
},
{
MethodName: "GetJwks",
Handler: _AuthService_GetJwks_Handler,
},
{
MethodName: "LoginPassword",
Handler: _AuthService_LoginPassword_Handler,
},
{
MethodName: "SetPassword",
Handler: _AuthService_SetPassword_Handler,
},
{
MethodName: "ProcessUserDeletedEvent",
Handler: _AuthService_ProcessUserDeletedEvent_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stocklet/auth/v1/service.proto",
}

View File

@@ -0,0 +1,289 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/auth/v1/types.proto
package auth_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type PublicEcJWK struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Kty string `protobuf:"bytes,1,opt,name=kty,proto3" json:"kty,omitempty"`
Use string `protobuf:"bytes,2,opt,name=use,proto3" json:"use,omitempty"`
Alg string `protobuf:"bytes,3,opt,name=alg,proto3" json:"alg,omitempty"`
Crv string `protobuf:"bytes,4,opt,name=crv,proto3" json:"crv,omitempty"`
X string `protobuf:"bytes,5,opt,name=x,proto3" json:"x,omitempty"`
Y string `protobuf:"bytes,6,opt,name=y,proto3" json:"y,omitempty"`
}
func (x *PublicEcJWK) Reset() {
*x = PublicEcJWK{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_auth_v1_types_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PublicEcJWK) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PublicEcJWK) ProtoMessage() {}
func (x *PublicEcJWK) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_auth_v1_types_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PublicEcJWK.ProtoReflect.Descriptor instead.
func (*PublicEcJWK) Descriptor() ([]byte, []int) {
return file_stocklet_auth_v1_types_proto_rawDescGZIP(), []int{0}
}
func (x *PublicEcJWK) GetKty() string {
if x != nil {
return x.Kty
}
return ""
}
func (x *PublicEcJWK) GetUse() string {
if x != nil {
return x.Use
}
return ""
}
func (x *PublicEcJWK) GetAlg() string {
if x != nil {
return x.Alg
}
return ""
}
func (x *PublicEcJWK) GetCrv() string {
if x != nil {
return x.Crv
}
return ""
}
func (x *PublicEcJWK) GetX() string {
if x != nil {
return x.X
}
return ""
}
func (x *PublicEcJWK) GetY() string {
if x != nil {
return x.Y
}
return ""
}
type AuthToken struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TokenType string `protobuf:"bytes,1,opt,name=token_type,json=tokenType,proto3" json:"token_type,omitempty"`
AccessToken string `protobuf:"bytes,2,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"`
ExpiresIn int64 `protobuf:"varint,3,opt,name=expires_in,json=expiresIn,proto3" json:"expires_in,omitempty"`
}
func (x *AuthToken) Reset() {
*x = AuthToken{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_auth_v1_types_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *AuthToken) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*AuthToken) ProtoMessage() {}
func (x *AuthToken) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_auth_v1_types_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use AuthToken.ProtoReflect.Descriptor instead.
func (*AuthToken) Descriptor() ([]byte, []int) {
return file_stocklet_auth_v1_types_proto_rawDescGZIP(), []int{1}
}
func (x *AuthToken) GetTokenType() string {
if x != nil {
return x.TokenType
}
return ""
}
func (x *AuthToken) GetAccessToken() string {
if x != nil {
return x.AccessToken
}
return ""
}
func (x *AuthToken) GetExpiresIn() int64 {
if x != nil {
return x.ExpiresIn
}
return 0
}
var File_stocklet_auth_v1_types_proto protoreflect.FileDescriptor
var file_stocklet_auth_v1_types_proto_rawDesc = []byte{
0x0a, 0x1c, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f,
0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x61, 0x75, 0x74, 0x68, 0x2e, 0x76, 0x31,
0x22, 0x71, 0x0a, 0x0b, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x45, 0x63, 0x4a, 0x57, 0x4b, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x74, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x74,
0x79, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x73, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03,
0x75, 0x73, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x61, 0x6c, 0x67, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x03, 0x61, 0x6c, 0x67, 0x12, 0x10, 0x0a, 0x03, 0x63, 0x72, 0x76, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x03, 0x63, 0x72, 0x76, 0x12, 0x0c, 0x0a, 0x01, 0x78, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x52, 0x01, 0x78, 0x12, 0x0c, 0x0a, 0x01, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09,
0x52, 0x01, 0x79, 0x22, 0x6c, 0x0a, 0x09, 0x41, 0x75, 0x74, 0x68, 0x54, 0x6f, 0x6b, 0x65, 0x6e,
0x12, 0x1d, 0x0a, 0x0a, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x54, 0x79, 0x70, 0x65, 0x12,
0x21, 0x0a, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x54, 0x6f, 0x6b,
0x65, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x5f, 0x69, 0x6e,
0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x65, 0x78, 0x70, 0x69, 0x72, 0x65, 0x73, 0x49,
0x6e, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x76, 0x31, 0x3b, 0x61,
0x75, 0x74, 0x68, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_auth_v1_types_proto_rawDescOnce sync.Once
file_stocklet_auth_v1_types_proto_rawDescData = file_stocklet_auth_v1_types_proto_rawDesc
)
func file_stocklet_auth_v1_types_proto_rawDescGZIP() []byte {
file_stocklet_auth_v1_types_proto_rawDescOnce.Do(func() {
file_stocklet_auth_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_auth_v1_types_proto_rawDescData)
})
return file_stocklet_auth_v1_types_proto_rawDescData
}
var file_stocklet_auth_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_stocklet_auth_v1_types_proto_goTypes = []interface{}{
(*PublicEcJWK)(nil), // 0: stocklet.auth.v1.PublicEcJWK
(*AuthToken)(nil), // 1: stocklet.auth.v1.AuthToken
}
var file_stocklet_auth_v1_types_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_stocklet_auth_v1_types_proto_init() }
func file_stocklet_auth_v1_types_proto_init() {
if File_stocklet_auth_v1_types_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_auth_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PublicEcJWK); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_auth_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*AuthToken); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_auth_v1_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_auth_v1_types_proto_goTypes,
DependencyIndexes: file_stocklet_auth_v1_types_proto_depIdxs,
MessageInfos: file_stocklet_auth_v1_types_proto_msgTypes,
}.Build()
File_stocklet_auth_v1_types_proto = out.File
file_stocklet_auth_v1_types_proto_rawDesc = nil
file_stocklet_auth_v1_types_proto_goTypes = nil
file_stocklet_auth_v1_types_proto_depIdxs = nil
}

View File

@@ -0,0 +1,235 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/common/v1/requests.proto
package common_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ServiceInfoRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ServiceInfoRequest) Reset() {
*x = ServiceInfoRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_common_v1_requests_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ServiceInfoRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServiceInfoRequest) ProtoMessage() {}
func (x *ServiceInfoRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_common_v1_requests_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServiceInfoRequest.ProtoReflect.Descriptor instead.
func (*ServiceInfoRequest) Descriptor() ([]byte, []int) {
return file_stocklet_common_v1_requests_proto_rawDescGZIP(), []int{0}
}
type ServiceInfoResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
SourceLicense string `protobuf:"bytes,3,opt,name=source_license,json=sourceLicense,proto3" json:"source_license,omitempty"`
}
func (x *ServiceInfoResponse) Reset() {
*x = ServiceInfoResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_common_v1_requests_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ServiceInfoResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ServiceInfoResponse) ProtoMessage() {}
func (x *ServiceInfoResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_common_v1_requests_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ServiceInfoResponse.ProtoReflect.Descriptor instead.
func (*ServiceInfoResponse) Descriptor() ([]byte, []int) {
return file_stocklet_common_v1_requests_proto_rawDescGZIP(), []int{1}
}
func (x *ServiceInfoResponse) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ServiceInfoResponse) GetSource() string {
if x != nil {
return x.Source
}
return ""
}
func (x *ServiceInfoResponse) GetSourceLicense() string {
if x != nil {
return x.SourceLicense
}
return ""
}
var File_stocklet_common_v1_requests_proto protoreflect.FileDescriptor
var file_stocklet_common_v1_requests_proto_rawDesc = []byte{
0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x22, 0x14, 0x0a, 0x12, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x68, 0x0a,
0x13, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72,
0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x12, 0x25, 0x0a, 0x0e, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x5f, 0x6c, 0x69, 0x63, 0x65, 0x6e,
0x73, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
0x4c, 0x69, 0x63, 0x65, 0x6e, 0x73, 0x65, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x63, 0x6f, 0x6d,
0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x3b, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x76, 0x31,
0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_common_v1_requests_proto_rawDescOnce sync.Once
file_stocklet_common_v1_requests_proto_rawDescData = file_stocklet_common_v1_requests_proto_rawDesc
)
func file_stocklet_common_v1_requests_proto_rawDescGZIP() []byte {
file_stocklet_common_v1_requests_proto_rawDescOnce.Do(func() {
file_stocklet_common_v1_requests_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_common_v1_requests_proto_rawDescData)
})
return file_stocklet_common_v1_requests_proto_rawDescData
}
var file_stocklet_common_v1_requests_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_stocklet_common_v1_requests_proto_goTypes = []interface{}{
(*ServiceInfoRequest)(nil), // 0: stocklet.common.v1.ServiceInfoRequest
(*ServiceInfoResponse)(nil), // 1: stocklet.common.v1.ServiceInfoResponse
}
var file_stocklet_common_v1_requests_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_stocklet_common_v1_requests_proto_init() }
func file_stocklet_common_v1_requests_proto_init() {
if File_stocklet_common_v1_requests_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_common_v1_requests_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ServiceInfoRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_common_v1_requests_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ServiceInfoResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_common_v1_requests_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_common_v1_requests_proto_goTypes,
DependencyIndexes: file_stocklet_common_v1_requests_proto_depIdxs,
MessageInfos: file_stocklet_common_v1_requests_proto_msgTypes,
}.Build()
File_stocklet_common_v1_requests_proto = out.File
file_stocklet_common_v1_requests_proto_rawDesc = nil
file_stocklet_common_v1_requests_proto_goTypes = nil
file_stocklet_common_v1_requests_proto_depIdxs = nil
}

View File

@@ -0,0 +1,521 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/events/v1/order.proto
package events_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
// Order Status = processing
type OrderCreatedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
CustomerId string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
ItemQuantities map[string]int32 `protobuf:"bytes,4,rep,name=item_quantities,json=itemQuantities,proto3" json:"item_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
}
func (x *OrderCreatedEvent) Reset() {
*x = OrderCreatedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_order_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderCreatedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderCreatedEvent) ProtoMessage() {}
func (x *OrderCreatedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_order_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OrderCreatedEvent.ProtoReflect.Descriptor instead.
func (*OrderCreatedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_order_proto_rawDescGZIP(), []int{0}
}
func (x *OrderCreatedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *OrderCreatedEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *OrderCreatedEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *OrderCreatedEvent) GetItemQuantities() map[string]int32 {
if x != nil {
return x.ItemQuantities
}
return nil
}
// Order Status = pending
type OrderPendingEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
CustomerId string `protobuf:"bytes,3,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
ItemQuantities map[string]int32 `protobuf:"bytes,4,rep,name=item_quantities,json=itemQuantities,proto3" json:"item_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
ItemsPrice float32 `protobuf:"fixed32,5,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"`
TotalPrice float32 `protobuf:"fixed32,6,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"`
}
func (x *OrderPendingEvent) Reset() {
*x = OrderPendingEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_order_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderPendingEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderPendingEvent) ProtoMessage() {}
func (x *OrderPendingEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_order_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OrderPendingEvent.ProtoReflect.Descriptor instead.
func (*OrderPendingEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_order_proto_rawDescGZIP(), []int{1}
}
func (x *OrderPendingEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *OrderPendingEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *OrderPendingEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *OrderPendingEvent) GetItemQuantities() map[string]int32 {
if x != nil {
return x.ItemQuantities
}
return nil
}
func (x *OrderPendingEvent) GetItemsPrice() float32 {
if x != nil {
return x.ItemsPrice
}
return 0
}
func (x *OrderPendingEvent) GetTotalPrice() float32 {
if x != nil {
return x.TotalPrice
}
return 0
}
// Order Status = rejected
type OrderRejectedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
TransactionId *string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3,oneof" json:"transaction_id,omitempty"`
ShippingId *string `protobuf:"bytes,4,opt,name=shipping_id,json=shippingId,proto3,oneof" json:"shipping_id,omitempty"`
}
func (x *OrderRejectedEvent) Reset() {
*x = OrderRejectedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_order_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderRejectedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderRejectedEvent) ProtoMessage() {}
func (x *OrderRejectedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_order_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OrderRejectedEvent.ProtoReflect.Descriptor instead.
func (*OrderRejectedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_order_proto_rawDescGZIP(), []int{2}
}
func (x *OrderRejectedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *OrderRejectedEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *OrderRejectedEvent) GetTransactionId() string {
if x != nil && x.TransactionId != nil {
return *x.TransactionId
}
return ""
}
func (x *OrderRejectedEvent) GetShippingId() string {
if x != nil && x.ShippingId != nil {
return *x.ShippingId
}
return ""
}
// Order Status = approved
type OrderApprovedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
TransactionId string `protobuf:"bytes,3,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
ShippingId string `protobuf:"bytes,4,opt,name=shipping_id,json=shippingId,proto3" json:"shipping_id,omitempty"`
}
func (x *OrderApprovedEvent) Reset() {
*x = OrderApprovedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_order_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *OrderApprovedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*OrderApprovedEvent) ProtoMessage() {}
func (x *OrderApprovedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_order_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use OrderApprovedEvent.ProtoReflect.Descriptor instead.
func (*OrderApprovedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_order_proto_rawDescGZIP(), []int{3}
}
func (x *OrderApprovedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *OrderApprovedEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *OrderApprovedEvent) GetTransactionId() string {
if x != nil {
return x.TransactionId
}
return ""
}
func (x *OrderApprovedEvent) GetShippingId() string {
if x != nil {
return x.ShippingId
}
return ""
}
var File_stocklet_events_v1_order_proto protoreflect.FileDescriptor
var file_stocklet_events_v1_order_proto_rawDesc = []byte{
0x0a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x22, 0x92, 0x02, 0x0a, 0x11, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x72,
0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65,
0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65,
0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49,
0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
0x49, 0x64, 0x12, 0x62, 0x0a, 0x0f, 0x69, 0x74, 0x65, 0x6d, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74,
0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31,
0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65,
0x6e, 0x74, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65,
0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e,
0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x41, 0x0a, 0x13, 0x49, 0x74, 0x65, 0x6d, 0x51, 0x75,
0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a,
0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12,
0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05,
0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xd4, 0x02, 0x0a, 0x11, 0x4f, 0x72,
0x64, 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12,
0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73,
0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x62, 0x0a, 0x0f, 0x69, 0x74, 0x65, 0x6d, 0x5f,
0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x39, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69,
0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x49, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e,
0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x0e, 0x69, 0x74, 0x65,
0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x69,
0x74, 0x65, 0x6d, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02,
0x52, 0x0a, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b,
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28,
0x02, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x1a, 0x41, 0x0a,
0x13, 0x49, 0x74, 0x65, 0x6d, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x22, 0xc0, 0x01, 0x0a, 0x12, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x6a, 0x65, 0x63, 0x74,
0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73,
0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x2a,
0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64,
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61,
0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x73, 0x68,
0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48,
0x01, 0x52, 0x0a, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x88, 0x01, 0x01,
0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x5f, 0x69, 0x64, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67,
0x5f, 0x69, 0x64, 0x22, 0x93, 0x01, 0x0a, 0x12, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x41, 0x70, 0x70,
0x72, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65,
0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65,
0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49,
0x64, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70,
0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73,
0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61,
0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f,
0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_events_v1_order_proto_rawDescOnce sync.Once
file_stocklet_events_v1_order_proto_rawDescData = file_stocklet_events_v1_order_proto_rawDesc
)
func file_stocklet_events_v1_order_proto_rawDescGZIP() []byte {
file_stocklet_events_v1_order_proto_rawDescOnce.Do(func() {
file_stocklet_events_v1_order_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_order_proto_rawDescData)
})
return file_stocklet_events_v1_order_proto_rawDescData
}
var file_stocklet_events_v1_order_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_stocklet_events_v1_order_proto_goTypes = []interface{}{
(*OrderCreatedEvent)(nil), // 0: stocklet.events.v1.OrderCreatedEvent
(*OrderPendingEvent)(nil), // 1: stocklet.events.v1.OrderPendingEvent
(*OrderRejectedEvent)(nil), // 2: stocklet.events.v1.OrderRejectedEvent
(*OrderApprovedEvent)(nil), // 3: stocklet.events.v1.OrderApprovedEvent
nil, // 4: stocklet.events.v1.OrderCreatedEvent.ItemQuantitiesEntry
nil, // 5: stocklet.events.v1.OrderPendingEvent.ItemQuantitiesEntry
}
var file_stocklet_events_v1_order_proto_depIdxs = []int32{
4, // 0: stocklet.events.v1.OrderCreatedEvent.item_quantities:type_name -> stocklet.events.v1.OrderCreatedEvent.ItemQuantitiesEntry
5, // 1: stocklet.events.v1.OrderPendingEvent.item_quantities:type_name -> stocklet.events.v1.OrderPendingEvent.ItemQuantitiesEntry
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_events_v1_order_proto_init() }
func file_stocklet_events_v1_order_proto_init() {
if File_stocklet_events_v1_order_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_events_v1_order_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OrderCreatedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_order_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OrderPendingEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_order_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OrderRejectedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_order_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*OrderApprovedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_events_v1_order_proto_msgTypes[2].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_events_v1_order_proto_rawDesc,
NumEnums: 0,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_events_v1_order_proto_goTypes,
DependencyIndexes: file_stocklet_events_v1_order_proto_depIdxs,
MessageInfos: file_stocklet_events_v1_order_proto_msgTypes,
}.Build()
File_stocklet_events_v1_order_proto = out.File
file_stocklet_events_v1_order_proto_rawDesc = nil
file_stocklet_events_v1_order_proto_goTypes = nil
file_stocklet_events_v1_order_proto_depIdxs = nil
}

View File

@@ -0,0 +1,833 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/events/v1/payment.proto
package events_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type PaymentProcessedEvent_Type int32
const (
PaymentProcessedEvent_TYPE_UNSPECIFIED PaymentProcessedEvent_Type = 0
PaymentProcessedEvent_TYPE_FAILED PaymentProcessedEvent_Type = 1
PaymentProcessedEvent_TYPE_SUCCESS PaymentProcessedEvent_Type = 2
)
// Enum value maps for PaymentProcessedEvent_Type.
var (
PaymentProcessedEvent_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "TYPE_FAILED",
2: "TYPE_SUCCESS",
}
PaymentProcessedEvent_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"TYPE_FAILED": 1,
"TYPE_SUCCESS": 2,
}
)
func (x PaymentProcessedEvent_Type) Enum() *PaymentProcessedEvent_Type {
p := new(PaymentProcessedEvent_Type)
*p = x
return p
}
func (x PaymentProcessedEvent_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (PaymentProcessedEvent_Type) Descriptor() protoreflect.EnumDescriptor {
return file_stocklet_events_v1_payment_proto_enumTypes[0].Descriptor()
}
func (PaymentProcessedEvent_Type) Type() protoreflect.EnumType {
return &file_stocklet_events_v1_payment_proto_enumTypes[0]
}
func (x PaymentProcessedEvent_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use PaymentProcessedEvent_Type.Descriptor instead.
func (PaymentProcessedEvent_Type) EnumDescriptor() ([]byte, []int) {
return file_stocklet_events_v1_payment_proto_rawDescGZIP(), []int{6, 0}
}
type BalanceCreatedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
Balance float32 `protobuf:"fixed32,3,opt,name=balance,proto3" json:"balance,omitempty"`
}
func (x *BalanceCreatedEvent) Reset() {
*x = BalanceCreatedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BalanceCreatedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BalanceCreatedEvent) ProtoMessage() {}
func (x *BalanceCreatedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BalanceCreatedEvent.ProtoReflect.Descriptor instead.
func (*BalanceCreatedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_payment_proto_rawDescGZIP(), []int{0}
}
func (x *BalanceCreatedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *BalanceCreatedEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *BalanceCreatedEvent) GetBalance() float32 {
if x != nil {
return x.Balance
}
return 0
}
type BalanceCreditedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"`
NewBalance float32 `protobuf:"fixed32,4,opt,name=new_balance,json=newBalance,proto3" json:"new_balance,omitempty"`
}
func (x *BalanceCreditedEvent) Reset() {
*x = BalanceCreditedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BalanceCreditedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BalanceCreditedEvent) ProtoMessage() {}
func (x *BalanceCreditedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BalanceCreditedEvent.ProtoReflect.Descriptor instead.
func (*BalanceCreditedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_payment_proto_rawDescGZIP(), []int{1}
}
func (x *BalanceCreditedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *BalanceCreditedEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *BalanceCreditedEvent) GetAmount() float32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *BalanceCreditedEvent) GetNewBalance() float32 {
if x != nil {
return x.NewBalance
}
return 0
}
type BalanceDebitedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"`
NewBalance float32 `protobuf:"fixed32,4,opt,name=new_balance,json=newBalance,proto3" json:"new_balance,omitempty"`
}
func (x *BalanceDebitedEvent) Reset() {
*x = BalanceDebitedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BalanceDebitedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BalanceDebitedEvent) ProtoMessage() {}
func (x *BalanceDebitedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BalanceDebitedEvent.ProtoReflect.Descriptor instead.
func (*BalanceDebitedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_payment_proto_rawDescGZIP(), []int{2}
}
func (x *BalanceDebitedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *BalanceDebitedEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *BalanceDebitedEvent) GetAmount() float32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *BalanceDebitedEvent) GetNewBalance() float32 {
if x != nil {
return x.NewBalance
}
return 0
}
type BalanceClosedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
Balance float32 `protobuf:"fixed32,3,opt,name=balance,proto3" json:"balance,omitempty"`
}
func (x *BalanceClosedEvent) Reset() {
*x = BalanceClosedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *BalanceClosedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*BalanceClosedEvent) ProtoMessage() {}
func (x *BalanceClosedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use BalanceClosedEvent.ProtoReflect.Descriptor instead.
func (*BalanceClosedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_payment_proto_rawDescGZIP(), []int{3}
}
func (x *BalanceClosedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *BalanceClosedEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *BalanceClosedEvent) GetBalance() float32 {
if x != nil {
return x.Balance
}
return 0
}
type TransactionLoggedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
TransactionId string `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"`
OrderId string `protobuf:"bytes,4,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
CustomerId string `protobuf:"bytes,5,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
}
func (x *TransactionLoggedEvent) Reset() {
*x = TransactionLoggedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TransactionLoggedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TransactionLoggedEvent) ProtoMessage() {}
func (x *TransactionLoggedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TransactionLoggedEvent.ProtoReflect.Descriptor instead.
func (*TransactionLoggedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_payment_proto_rawDescGZIP(), []int{4}
}
func (x *TransactionLoggedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *TransactionLoggedEvent) GetTransactionId() string {
if x != nil {
return x.TransactionId
}
return ""
}
func (x *TransactionLoggedEvent) GetAmount() float32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *TransactionLoggedEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *TransactionLoggedEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
type TransactionReversedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
TransactionId string `protobuf:"bytes,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
Amount float32 `protobuf:"fixed32,3,opt,name=amount,proto3" json:"amount,omitempty"`
OrderId string `protobuf:"bytes,4,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
CustomerId string `protobuf:"bytes,5,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
}
func (x *TransactionReversedEvent) Reset() {
*x = TransactionReversedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *TransactionReversedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*TransactionReversedEvent) ProtoMessage() {}
func (x *TransactionReversedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use TransactionReversedEvent.ProtoReflect.Descriptor instead.
func (*TransactionReversedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_payment_proto_rawDescGZIP(), []int{5}
}
func (x *TransactionReversedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *TransactionReversedEvent) GetTransactionId() string {
if x != nil {
return x.TransactionId
}
return ""
}
func (x *TransactionReversedEvent) GetAmount() float32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *TransactionReversedEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *TransactionReversedEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
type PaymentProcessedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
Type PaymentProcessedEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.PaymentProcessedEvent_Type" json:"type,omitempty"`
OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
Amount float32 `protobuf:"fixed32,5,opt,name=amount,proto3" json:"amount,omitempty"`
TransactionId *string `protobuf:"bytes,6,opt,name=transaction_id,json=transactionId,proto3,oneof" json:"transaction_id,omitempty"`
}
func (x *PaymentProcessedEvent) Reset() {
*x = PaymentProcessedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PaymentProcessedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PaymentProcessedEvent) ProtoMessage() {}
func (x *PaymentProcessedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_payment_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PaymentProcessedEvent.ProtoReflect.Descriptor instead.
func (*PaymentProcessedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_payment_proto_rawDescGZIP(), []int{6}
}
func (x *PaymentProcessedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *PaymentProcessedEvent) GetType() PaymentProcessedEvent_Type {
if x != nil {
return x.Type
}
return PaymentProcessedEvent_TYPE_UNSPECIFIED
}
func (x *PaymentProcessedEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *PaymentProcessedEvent) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *PaymentProcessedEvent) GetAmount() float32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *PaymentProcessedEvent) GetTransactionId() string {
if x != nil && x.TransactionId != nil {
return *x.TransactionId
}
return ""
}
var File_stocklet_events_v1_payment_proto protoreflect.FileDescriptor
var file_stocklet_events_v1_payment_proto_rawDesc = []byte{
0x0a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65,
0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x6c, 0x0a, 0x13, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63,
0x65, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73,
0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61,
0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x62, 0x61, 0x6c,
0x61, 0x6e, 0x63, 0x65, 0x22, 0x8c, 0x01, 0x0a, 0x14, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65,
0x43, 0x72, 0x65, 0x64, 0x69, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73,
0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61,
0x6e, 0x63, 0x65, 0x22, 0x8b, 0x01, 0x0a, 0x13, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x44,
0x65, 0x62, 0x69, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72,
0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72,
0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f,
0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75,
0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
0x12, 0x1f, 0x0a, 0x0b, 0x6e, 0x65, 0x77, 0x5f, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18,
0x04, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x6e, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63,
0x65, 0x22, 0x6b, 0x0a, 0x12, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x43, 0x6c, 0x6f, 0x73,
0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73,
0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
0x65, 0x72, 0x49, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18,
0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x22, 0xaf,
0x01, 0x0a, 0x16, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x4c, 0x6f,
0x67, 0x67, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76,
0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76,
0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63,
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0d, 0x74,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06,
0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64,
0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12,
0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x05,
0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64,
0x22, 0xb1, 0x01, 0x0a, 0x18, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x25, 0x0a, 0x0e, 0x74, 0x72, 0x61,
0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0d, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64,
0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02,
0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f,
0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
0x65, 0x72, 0x49, 0x64, 0x22, 0xcb, 0x02, 0x0a, 0x15, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a,
0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x04, 0x74, 0x79,
0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61,
0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19,
0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09,
0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73,
0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d,
0x6f, 0x75, 0x6e, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x74, 0x72,
0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x22, 0x3f,
0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55,
0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b,
0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x10, 0x0a,
0x0c, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x55, 0x43, 0x43, 0x45, 0x53, 0x53, 0x10, 0x02, 0x42,
0x11, 0x0a, 0x0f, 0x5f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
0x69, 0x64, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76,
0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_stocklet_events_v1_payment_proto_rawDescOnce sync.Once
file_stocklet_events_v1_payment_proto_rawDescData = file_stocklet_events_v1_payment_proto_rawDesc
)
func file_stocklet_events_v1_payment_proto_rawDescGZIP() []byte {
file_stocklet_events_v1_payment_proto_rawDescOnce.Do(func() {
file_stocklet_events_v1_payment_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_payment_proto_rawDescData)
})
return file_stocklet_events_v1_payment_proto_rawDescData
}
var file_stocklet_events_v1_payment_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_stocklet_events_v1_payment_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_stocklet_events_v1_payment_proto_goTypes = []interface{}{
(PaymentProcessedEvent_Type)(0), // 0: stocklet.events.v1.PaymentProcessedEvent.Type
(*BalanceCreatedEvent)(nil), // 1: stocklet.events.v1.BalanceCreatedEvent
(*BalanceCreditedEvent)(nil), // 2: stocklet.events.v1.BalanceCreditedEvent
(*BalanceDebitedEvent)(nil), // 3: stocklet.events.v1.BalanceDebitedEvent
(*BalanceClosedEvent)(nil), // 4: stocklet.events.v1.BalanceClosedEvent
(*TransactionLoggedEvent)(nil), // 5: stocklet.events.v1.TransactionLoggedEvent
(*TransactionReversedEvent)(nil), // 6: stocklet.events.v1.TransactionReversedEvent
(*PaymentProcessedEvent)(nil), // 7: stocklet.events.v1.PaymentProcessedEvent
}
var file_stocklet_events_v1_payment_proto_depIdxs = []int32{
0, // 0: stocklet.events.v1.PaymentProcessedEvent.type:type_name -> stocklet.events.v1.PaymentProcessedEvent.Type
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
1, // [1:1] is the sub-list for extension extendee
0, // [0:1] is the sub-list for field type_name
}
func init() { file_stocklet_events_v1_payment_proto_init() }
func file_stocklet_events_v1_payment_proto_init() {
if File_stocklet_events_v1_payment_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_events_v1_payment_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BalanceCreatedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_payment_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BalanceCreditedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_payment_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BalanceDebitedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_payment_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*BalanceClosedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_payment_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TransactionLoggedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_payment_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*TransactionReversedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_payment_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PaymentProcessedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_events_v1_payment_proto_msgTypes[6].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_events_v1_payment_proto_rawDesc,
NumEnums: 1,
NumMessages: 7,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_events_v1_payment_proto_goTypes,
DependencyIndexes: file_stocklet_events_v1_payment_proto_depIdxs,
EnumInfos: file_stocklet_events_v1_payment_proto_enumTypes,
MessageInfos: file_stocklet_events_v1_payment_proto_msgTypes,
}.Build()
File_stocklet_events_v1_payment_proto = out.File
file_stocklet_events_v1_payment_proto_rawDesc = nil
file_stocklet_events_v1_payment_proto_goTypes = nil
file_stocklet_events_v1_payment_proto_depIdxs = nil
}

View File

@@ -0,0 +1,555 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/events/v1/product.proto
package events_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ProductPriceQuoteEvent_Type int32
const (
ProductPriceQuoteEvent_TYPE_UNSPECIFIED ProductPriceQuoteEvent_Type = 0
ProductPriceQuoteEvent_TYPE_UNAVALIABLE ProductPriceQuoteEvent_Type = 1
ProductPriceQuoteEvent_TYPE_AVALIABLE ProductPriceQuoteEvent_Type = 2
)
// Enum value maps for ProductPriceQuoteEvent_Type.
var (
ProductPriceQuoteEvent_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "TYPE_UNAVALIABLE",
2: "TYPE_AVALIABLE",
}
ProductPriceQuoteEvent_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"TYPE_UNAVALIABLE": 1,
"TYPE_AVALIABLE": 2,
}
)
func (x ProductPriceQuoteEvent_Type) Enum() *ProductPriceQuoteEvent_Type {
p := new(ProductPriceQuoteEvent_Type)
*p = x
return p
}
func (x ProductPriceQuoteEvent_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ProductPriceQuoteEvent_Type) Descriptor() protoreflect.EnumDescriptor {
return file_stocklet_events_v1_product_proto_enumTypes[0].Descriptor()
}
func (ProductPriceQuoteEvent_Type) Type() protoreflect.EnumType {
return &file_stocklet_events_v1_product_proto_enumTypes[0]
}
func (x ProductPriceQuoteEvent_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ProductPriceQuoteEvent_Type.Descriptor instead.
func (ProductPriceQuoteEvent_Type) EnumDescriptor() ([]byte, []int) {
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{3, 0}
}
type ProductCreatedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,4,opt,name=description,proto3" json:"description,omitempty"`
Price float32 `protobuf:"fixed32,5,opt,name=price,proto3" json:"price,omitempty"`
}
func (x *ProductCreatedEvent) Reset() {
*x = ProductCreatedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_product_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProductCreatedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProductCreatedEvent) ProtoMessage() {}
func (x *ProductCreatedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_product_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProductCreatedEvent.ProtoReflect.Descriptor instead.
func (*ProductCreatedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{0}
}
func (x *ProductCreatedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *ProductCreatedEvent) GetProductId() string {
if x != nil {
return x.ProductId
}
return ""
}
func (x *ProductCreatedEvent) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *ProductCreatedEvent) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *ProductCreatedEvent) GetPrice() float32 {
if x != nil {
return x.Price
}
return 0
}
type ProductPriceUpdatedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
Price float32 `protobuf:"fixed32,3,opt,name=price,proto3" json:"price,omitempty"`
}
func (x *ProductPriceUpdatedEvent) Reset() {
*x = ProductPriceUpdatedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_product_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProductPriceUpdatedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProductPriceUpdatedEvent) ProtoMessage() {}
func (x *ProductPriceUpdatedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_product_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProductPriceUpdatedEvent.ProtoReflect.Descriptor instead.
func (*ProductPriceUpdatedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{1}
}
func (x *ProductPriceUpdatedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *ProductPriceUpdatedEvent) GetProductId() string {
if x != nil {
return x.ProductId
}
return ""
}
func (x *ProductPriceUpdatedEvent) GetPrice() float32 {
if x != nil {
return x.Price
}
return 0
}
type ProductDeletedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
}
func (x *ProductDeletedEvent) Reset() {
*x = ProductDeletedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_product_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProductDeletedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProductDeletedEvent) ProtoMessage() {}
func (x *ProductDeletedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_product_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProductDeletedEvent.ProtoReflect.Descriptor instead.
func (*ProductDeletedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{2}
}
func (x *ProductDeletedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *ProductDeletedEvent) GetProductId() string {
if x != nil {
return x.ProductId
}
return ""
}
type ProductPriceQuoteEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
Type ProductPriceQuoteEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.ProductPriceQuoteEvent_Type" json:"type,omitempty"`
OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
// Product ID: Quantity
ProductQuantities map[string]int32 `protobuf:"bytes,4,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
// Product ID: Unit Price
ProductPrices map[string]float32 `protobuf:"bytes,5,rep,name=product_prices,json=productPrices,proto3" json:"product_prices,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"fixed32,2,opt,name=value,proto3"`
TotalPrice float32 `protobuf:"fixed32,6,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"`
}
func (x *ProductPriceQuoteEvent) Reset() {
*x = ProductPriceQuoteEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_product_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ProductPriceQuoteEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ProductPriceQuoteEvent) ProtoMessage() {}
func (x *ProductPriceQuoteEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_product_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ProductPriceQuoteEvent.ProtoReflect.Descriptor instead.
func (*ProductPriceQuoteEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_product_proto_rawDescGZIP(), []int{3}
}
func (x *ProductPriceQuoteEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *ProductPriceQuoteEvent) GetType() ProductPriceQuoteEvent_Type {
if x != nil {
return x.Type
}
return ProductPriceQuoteEvent_TYPE_UNSPECIFIED
}
func (x *ProductPriceQuoteEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *ProductPriceQuoteEvent) GetProductQuantities() map[string]int32 {
if x != nil {
return x.ProductQuantities
}
return nil
}
func (x *ProductPriceQuoteEvent) GetProductPrices() map[string]float32 {
if x != nil {
return x.ProductPrices
}
return nil
}
func (x *ProductPriceQuoteEvent) GetTotalPrice() float32 {
if x != nil {
return x.TotalPrice
}
return 0
}
var File_stocklet_events_v1_product_proto protoreflect.FileDescriptor
var file_stocklet_events_v1_product_proto_rawDesc = []byte{
0x0a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65,
0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x9c, 0x01, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a,
0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05,
0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a,
0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01,
0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12,
0x14, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05,
0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x6b, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x50, 0x72, 0x69, 0x63, 0x65, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e,
0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20,
0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a,
0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28,
0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05,
0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x05, 0x70, 0x72, 0x69,
0x63, 0x65, 0x22, 0x50, 0x0a, 0x13, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x44, 0x65, 0x6c,
0x65, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76,
0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76,
0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x49, 0x64, 0x22, 0xdd, 0x04, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12,
0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28,
0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x04, 0x74,
0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2f, 0x2e, 0x73, 0x74, 0x6f, 0x63,
0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65,
0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65,
0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x70, 0x0a, 0x12, 0x70,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65,
0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x41, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74,
0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x64,
0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x64, 0x0a,
0x0e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x73, 0x18,
0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3d, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76, 0x65, 0x6e,
0x74, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x52, 0x0d, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69,
0x63, 0x65, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69,
0x63, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50,
0x72, 0x69, 0x63, 0x65, 0x1a, 0x44, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51,
0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x1a, 0x40, 0x0a, 0x12, 0x50, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79,
0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b,
0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28,
0x02, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x46, 0x0a, 0x04,
0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53,
0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59,
0x50, 0x45, 0x5f, 0x55, 0x4e, 0x41, 0x56, 0x41, 0x4c, 0x49, 0x41, 0x42, 0x4c, 0x45, 0x10, 0x01,
0x12, 0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x56, 0x41, 0x4c, 0x49, 0x41, 0x42,
0x4c, 0x45, 0x10, 0x02, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_events_v1_product_proto_rawDescOnce sync.Once
file_stocklet_events_v1_product_proto_rawDescData = file_stocklet_events_v1_product_proto_rawDesc
)
func file_stocklet_events_v1_product_proto_rawDescGZIP() []byte {
file_stocklet_events_v1_product_proto_rawDescOnce.Do(func() {
file_stocklet_events_v1_product_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_product_proto_rawDescData)
})
return file_stocklet_events_v1_product_proto_rawDescData
}
var file_stocklet_events_v1_product_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_stocklet_events_v1_product_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_stocklet_events_v1_product_proto_goTypes = []interface{}{
(ProductPriceQuoteEvent_Type)(0), // 0: stocklet.events.v1.ProductPriceQuoteEvent.Type
(*ProductCreatedEvent)(nil), // 1: stocklet.events.v1.ProductCreatedEvent
(*ProductPriceUpdatedEvent)(nil), // 2: stocklet.events.v1.ProductPriceUpdatedEvent
(*ProductDeletedEvent)(nil), // 3: stocklet.events.v1.ProductDeletedEvent
(*ProductPriceQuoteEvent)(nil), // 4: stocklet.events.v1.ProductPriceQuoteEvent
nil, // 5: stocklet.events.v1.ProductPriceQuoteEvent.ProductQuantitiesEntry
nil, // 6: stocklet.events.v1.ProductPriceQuoteEvent.ProductPricesEntry
}
var file_stocklet_events_v1_product_proto_depIdxs = []int32{
0, // 0: stocklet.events.v1.ProductPriceQuoteEvent.type:type_name -> stocklet.events.v1.ProductPriceQuoteEvent.Type
5, // 1: stocklet.events.v1.ProductPriceQuoteEvent.product_quantities:type_name -> stocklet.events.v1.ProductPriceQuoteEvent.ProductQuantitiesEntry
6, // 2: stocklet.events.v1.ProductPriceQuoteEvent.product_prices:type_name -> stocklet.events.v1.ProductPriceQuoteEvent.ProductPricesEntry
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_stocklet_events_v1_product_proto_init() }
func file_stocklet_events_v1_product_proto_init() {
if File_stocklet_events_v1_product_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_events_v1_product_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProductCreatedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_product_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProductPriceUpdatedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_product_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProductDeletedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_product_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ProductPriceQuoteEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_events_v1_product_proto_rawDesc,
NumEnums: 1,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_events_v1_product_proto_goTypes,
DependencyIndexes: file_stocklet_events_v1_product_proto_depIdxs,
EnumInfos: file_stocklet_events_v1_product_proto_enumTypes,
MessageInfos: file_stocklet_events_v1_product_proto_msgTypes,
}.Build()
File_stocklet_events_v1_product_proto = out.File
file_stocklet_events_v1_product_proto_rawDesc = nil
file_stocklet_events_v1_product_proto_goTypes = nil
file_stocklet_events_v1_product_proto_depIdxs = nil
}

View File

@@ -0,0 +1,482 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/events/v1/shipping.proto
package events_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ShipmentAllocationEvent_Type int32
const (
ShipmentAllocationEvent_TYPE_UNSPECIFIED ShipmentAllocationEvent_Type = 0
ShipmentAllocationEvent_TYPE_FAILED ShipmentAllocationEvent_Type = 1
ShipmentAllocationEvent_TYPE_ALLOCATED ShipmentAllocationEvent_Type = 2
ShipmentAllocationEvent_TYPE_ALLOCATION_RELEASED ShipmentAllocationEvent_Type = 3
)
// Enum value maps for ShipmentAllocationEvent_Type.
var (
ShipmentAllocationEvent_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "TYPE_FAILED",
2: "TYPE_ALLOCATED",
3: "TYPE_ALLOCATION_RELEASED",
}
ShipmentAllocationEvent_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"TYPE_FAILED": 1,
"TYPE_ALLOCATED": 2,
"TYPE_ALLOCATION_RELEASED": 3,
}
)
func (x ShipmentAllocationEvent_Type) Enum() *ShipmentAllocationEvent_Type {
p := new(ShipmentAllocationEvent_Type)
*p = x
return p
}
func (x ShipmentAllocationEvent_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (ShipmentAllocationEvent_Type) Descriptor() protoreflect.EnumDescriptor {
return file_stocklet_events_v1_shipping_proto_enumTypes[0].Descriptor()
}
func (ShipmentAllocationEvent_Type) Type() protoreflect.EnumType {
return &file_stocklet_events_v1_shipping_proto_enumTypes[0]
}
func (x ShipmentAllocationEvent_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use ShipmentAllocationEvent_Type.Descriptor instead.
func (ShipmentAllocationEvent_Type) EnumDescriptor() ([]byte, []int) {
return file_stocklet_events_v1_shipping_proto_rawDescGZIP(), []int{0, 0}
}
type ShipmentAllocationEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
Type ShipmentAllocationEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.ShipmentAllocationEvent_Type" json:"type,omitempty"`
OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
OrderMetadata *ShipmentAllocationEvent_OrderMetadata `protobuf:"bytes,4,opt,name=order_metadata,json=orderMetadata,proto3" json:"order_metadata,omitempty"`
ShipmentId string `protobuf:"bytes,5,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"` // provided with type enum value 2+
ProductQuantities map[string]int32 `protobuf:"bytes,6,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
}
func (x *ShipmentAllocationEvent) Reset() {
*x = ShipmentAllocationEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_shipping_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ShipmentAllocationEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ShipmentAllocationEvent) ProtoMessage() {}
func (x *ShipmentAllocationEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_shipping_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ShipmentAllocationEvent.ProtoReflect.Descriptor instead.
func (*ShipmentAllocationEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_shipping_proto_rawDescGZIP(), []int{0}
}
func (x *ShipmentAllocationEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *ShipmentAllocationEvent) GetType() ShipmentAllocationEvent_Type {
if x != nil {
return x.Type
}
return ShipmentAllocationEvent_TYPE_UNSPECIFIED
}
func (x *ShipmentAllocationEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *ShipmentAllocationEvent) GetOrderMetadata() *ShipmentAllocationEvent_OrderMetadata {
if x != nil {
return x.OrderMetadata
}
return nil
}
func (x *ShipmentAllocationEvent) GetShipmentId() string {
if x != nil {
return x.ShipmentId
}
return ""
}
func (x *ShipmentAllocationEvent) GetProductQuantities() map[string]int32 {
if x != nil {
return x.ProductQuantities
}
return nil
}
type ShipmentDispatchedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
ShipmentId string `protobuf:"bytes,2,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"`
OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
ProductQuantities map[string]int32 `protobuf:"bytes,4,rep,name=product_quantities,json=productQuantities,proto3" json:"product_quantities,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
}
func (x *ShipmentDispatchedEvent) Reset() {
*x = ShipmentDispatchedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_shipping_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ShipmentDispatchedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ShipmentDispatchedEvent) ProtoMessage() {}
func (x *ShipmentDispatchedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_shipping_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ShipmentDispatchedEvent.ProtoReflect.Descriptor instead.
func (*ShipmentDispatchedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_shipping_proto_rawDescGZIP(), []int{1}
}
func (x *ShipmentDispatchedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *ShipmentDispatchedEvent) GetShipmentId() string {
if x != nil {
return x.ShipmentId
}
return ""
}
func (x *ShipmentDispatchedEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *ShipmentDispatchedEvent) GetProductQuantities() map[string]int32 {
if x != nil {
return x.ProductQuantities
}
return nil
}
type ShipmentAllocationEvent_OrderMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
ItemsPrice float32 `protobuf:"fixed32,2,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"`
TotalPrice float32 `protobuf:"fixed32,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"`
}
func (x *ShipmentAllocationEvent_OrderMetadata) Reset() {
*x = ShipmentAllocationEvent_OrderMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_shipping_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ShipmentAllocationEvent_OrderMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ShipmentAllocationEvent_OrderMetadata) ProtoMessage() {}
func (x *ShipmentAllocationEvent_OrderMetadata) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_shipping_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ShipmentAllocationEvent_OrderMetadata.ProtoReflect.Descriptor instead.
func (*ShipmentAllocationEvent_OrderMetadata) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_shipping_proto_rawDescGZIP(), []int{0, 0}
}
func (x *ShipmentAllocationEvent_OrderMetadata) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *ShipmentAllocationEvent_OrderMetadata) GetItemsPrice() float32 {
if x != nil {
return x.ItemsPrice
}
return 0
}
func (x *ShipmentAllocationEvent_OrderMetadata) GetTotalPrice() float32 {
if x != nil {
return x.TotalPrice
}
return 0
}
var File_stocklet_events_v1_shipping_proto protoreflect.FileDescriptor
var file_stocklet_events_v1_shipping_proto_rawDesc = []byte{
0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0xa7, 0x05, 0x0a, 0x17, 0x53, 0x68, 0x69, 0x70,
0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18,
0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12,
0x44, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x30, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52,
0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69,
0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64,
0x12, 0x60, 0x0a, 0x0e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x39, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68,
0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64,
0x61, 0x74, 0x61, 0x52, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61,
0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69,
0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e,
0x74, 0x49, 0x64, 0x12, 0x71, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x71,
0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32,
0x42, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c,
0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x50, 0x72, 0x6f,
0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e,
0x74, 0x72, 0x79, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e,
0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x72, 0x0a, 0x0d, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f,
0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75,
0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a, 0x0b, 0x69, 0x74, 0x65, 0x6d,
0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a, 0x69,
0x74, 0x65, 0x6d, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f, 0x0a, 0x0b, 0x74, 0x6f, 0x74,
0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x0a,
0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x1a, 0x44, 0x0a, 0x16, 0x50, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45,
0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01,
0x22, 0x5f, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45,
0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f,
0x0a, 0x0b, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x46, 0x41, 0x49, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12,
0x12, 0x0a, 0x0e, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x4c, 0x4c, 0x4f, 0x43, 0x41, 0x54, 0x45,
0x44, 0x10, 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x41, 0x4c, 0x4c, 0x4f,
0x43, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x52, 0x45, 0x4c, 0x45, 0x41, 0x53, 0x45, 0x44, 0x10,
0x03, 0x22, 0xaa, 0x02, 0x0a, 0x17, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44, 0x69,
0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x68, 0x69,
0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a,
0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x71, 0x0a, 0x12, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x5f, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28,
0x0b, 0x32, 0x42, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65,
0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x44,
0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x50,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73,
0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x11, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x51, 0x75,
0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x44, 0x0a, 0x16, 0x50, 0x72, 0x6f, 0x64,
0x75, 0x63, 0x74, 0x51, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x69, 0x65, 0x73, 0x45, 0x6e, 0x74,
0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x47,
0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78,
0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e,
0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x67, 0x65, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_events_v1_shipping_proto_rawDescOnce sync.Once
file_stocklet_events_v1_shipping_proto_rawDescData = file_stocklet_events_v1_shipping_proto_rawDesc
)
func file_stocklet_events_v1_shipping_proto_rawDescGZIP() []byte {
file_stocklet_events_v1_shipping_proto_rawDescOnce.Do(func() {
file_stocklet_events_v1_shipping_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_shipping_proto_rawDescData)
})
return file_stocklet_events_v1_shipping_proto_rawDescData
}
var file_stocklet_events_v1_shipping_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_stocklet_events_v1_shipping_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_stocklet_events_v1_shipping_proto_goTypes = []interface{}{
(ShipmentAllocationEvent_Type)(0), // 0: stocklet.events.v1.ShipmentAllocationEvent.Type
(*ShipmentAllocationEvent)(nil), // 1: stocklet.events.v1.ShipmentAllocationEvent
(*ShipmentDispatchedEvent)(nil), // 2: stocklet.events.v1.ShipmentDispatchedEvent
(*ShipmentAllocationEvent_OrderMetadata)(nil), // 3: stocklet.events.v1.ShipmentAllocationEvent.OrderMetadata
nil, // 4: stocklet.events.v1.ShipmentAllocationEvent.ProductQuantitiesEntry
nil, // 5: stocklet.events.v1.ShipmentDispatchedEvent.ProductQuantitiesEntry
}
var file_stocklet_events_v1_shipping_proto_depIdxs = []int32{
0, // 0: stocklet.events.v1.ShipmentAllocationEvent.type:type_name -> stocklet.events.v1.ShipmentAllocationEvent.Type
3, // 1: stocklet.events.v1.ShipmentAllocationEvent.order_metadata:type_name -> stocklet.events.v1.ShipmentAllocationEvent.OrderMetadata
4, // 2: stocklet.events.v1.ShipmentAllocationEvent.product_quantities:type_name -> stocklet.events.v1.ShipmentAllocationEvent.ProductQuantitiesEntry
5, // 3: stocklet.events.v1.ShipmentDispatchedEvent.product_quantities:type_name -> stocklet.events.v1.ShipmentDispatchedEvent.ProductQuantitiesEntry
4, // [4:4] is the sub-list for method output_type
4, // [4:4] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
4, // [4:4] is the sub-list for extension extendee
0, // [0:4] is the sub-list for field type_name
}
func init() { file_stocklet_events_v1_shipping_proto_init() }
func file_stocklet_events_v1_shipping_proto_init() {
if File_stocklet_events_v1_shipping_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_events_v1_shipping_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ShipmentAllocationEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_shipping_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ShipmentDispatchedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_shipping_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ShipmentAllocationEvent_OrderMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_events_v1_shipping_proto_rawDesc,
NumEnums: 1,
NumMessages: 5,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_events_v1_shipping_proto_goTypes,
DependencyIndexes: file_stocklet_events_v1_shipping_proto_depIdxs,
EnumInfos: file_stocklet_events_v1_shipping_proto_enumTypes,
MessageInfos: file_stocklet_events_v1_shipping_proto_msgTypes,
}.Build()
File_stocklet_events_v1_shipping_proto = out.File
file_stocklet_events_v1_shipping_proto_rawDesc = nil
file_stocklet_events_v1_shipping_proto_goTypes = nil
file_stocklet_events_v1_shipping_proto_depIdxs = nil
}

View File

@@ -0,0 +1,366 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/events/v1/user.proto
package events_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type UserCreatedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
FirstName string `protobuf:"bytes,4,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
LastName string `protobuf:"bytes,5,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
}
func (x *UserCreatedEvent) Reset() {
*x = UserCreatedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_user_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserCreatedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserCreatedEvent) ProtoMessage() {}
func (x *UserCreatedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_user_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserCreatedEvent.ProtoReflect.Descriptor instead.
func (*UserCreatedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_user_proto_rawDescGZIP(), []int{0}
}
func (x *UserCreatedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *UserCreatedEvent) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *UserCreatedEvent) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *UserCreatedEvent) GetFirstName() string {
if x != nil {
return x.FirstName
}
return ""
}
func (x *UserCreatedEvent) GetLastName() string {
if x != nil {
return x.LastName
}
return ""
}
type UserEmailUpdatedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
}
func (x *UserEmailUpdatedEvent) Reset() {
*x = UserEmailUpdatedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_user_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserEmailUpdatedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserEmailUpdatedEvent) ProtoMessage() {}
func (x *UserEmailUpdatedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_user_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserEmailUpdatedEvent.ProtoReflect.Descriptor instead.
func (*UserEmailUpdatedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_user_proto_rawDescGZIP(), []int{1}
}
func (x *UserEmailUpdatedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *UserEmailUpdatedEvent) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *UserEmailUpdatedEvent) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
type UserDeletedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
UserId string `protobuf:"bytes,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
}
func (x *UserDeletedEvent) Reset() {
*x = UserDeletedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_user_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *UserDeletedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UserDeletedEvent) ProtoMessage() {}
func (x *UserDeletedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_user_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UserDeletedEvent.ProtoReflect.Descriptor instead.
func (*UserDeletedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_user_proto_rawDescGZIP(), []int{2}
}
func (x *UserDeletedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *UserDeletedEvent) GetUserId() string {
if x != nil {
return x.UserId
}
return ""
}
func (x *UserDeletedEvent) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
var File_stocklet_events_v1_user_proto protoreflect.FileDescriptor
var file_stocklet_events_v1_user_proto_rawDesc = []byte{
0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
0x2e, 0x76, 0x31, 0x22, 0x99, 0x01, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61,
0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69,
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69,
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a,
0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d,
0x61, 0x69, 0x6c, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61,
0x6d, 0x65, 0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x22,
0x62, 0x0a, 0x15, 0x55, 0x73, 0x65, 0x72, 0x45, 0x6d, 0x61, 0x69, 0x6c, 0x55, 0x70, 0x64, 0x61,
0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69,
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69,
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a,
0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d,
0x61, 0x69, 0x6c, 0x22, 0x5d, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74,
0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73,
0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73,
0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x14, 0x0a, 0x05,
0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61,
0x69, 0x6c, 0x42, 0x47, 0x5a, 0x45, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76,
0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_stocklet_events_v1_user_proto_rawDescOnce sync.Once
file_stocklet_events_v1_user_proto_rawDescData = file_stocklet_events_v1_user_proto_rawDesc
)
func file_stocklet_events_v1_user_proto_rawDescGZIP() []byte {
file_stocklet_events_v1_user_proto_rawDescOnce.Do(func() {
file_stocklet_events_v1_user_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_user_proto_rawDescData)
})
return file_stocklet_events_v1_user_proto_rawDescData
}
var file_stocklet_events_v1_user_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_stocklet_events_v1_user_proto_goTypes = []interface{}{
(*UserCreatedEvent)(nil), // 0: stocklet.events.v1.UserCreatedEvent
(*UserEmailUpdatedEvent)(nil), // 1: stocklet.events.v1.UserEmailUpdatedEvent
(*UserDeletedEvent)(nil), // 2: stocklet.events.v1.UserDeletedEvent
}
var file_stocklet_events_v1_user_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_stocklet_events_v1_user_proto_init() }
func file_stocklet_events_v1_user_proto_init() {
if File_stocklet_events_v1_user_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_events_v1_user_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserCreatedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_user_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserEmailUpdatedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_user_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UserDeletedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_events_v1_user_proto_rawDesc,
NumEnums: 0,
NumMessages: 3,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_events_v1_user_proto_goTypes,
DependencyIndexes: file_stocklet_events_v1_user_proto_depIdxs,
MessageInfos: file_stocklet_events_v1_user_proto_msgTypes,
}.Build()
File_stocklet_events_v1_user_proto = out.File
file_stocklet_events_v1_user_proto_rawDesc = nil
file_stocklet_events_v1_user_proto_goTypes = nil
file_stocklet_events_v1_user_proto_depIdxs = nil
}

View File

@@ -0,0 +1,671 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/events/v1/warehouse.proto
package events_v1
import (
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type StockReservationEvent_Type int32
const (
StockReservationEvent_TYPE_UNSPECIFIED StockReservationEvent_Type = 0
StockReservationEvent_TYPE_INSUFFICIENT_STOCK StockReservationEvent_Type = 1
StockReservationEvent_TYPE_STOCK_RESERVED StockReservationEvent_Type = 2
StockReservationEvent_TYPE_STOCK_RETURNED StockReservationEvent_Type = 3
StockReservationEvent_TYPE_STOCK_CONSUMED StockReservationEvent_Type = 4
)
// Enum value maps for StockReservationEvent_Type.
var (
StockReservationEvent_Type_name = map[int32]string{
0: "TYPE_UNSPECIFIED",
1: "TYPE_INSUFFICIENT_STOCK",
2: "TYPE_STOCK_RESERVED",
3: "TYPE_STOCK_RETURNED",
4: "TYPE_STOCK_CONSUMED",
}
StockReservationEvent_Type_value = map[string]int32{
"TYPE_UNSPECIFIED": 0,
"TYPE_INSUFFICIENT_STOCK": 1,
"TYPE_STOCK_RESERVED": 2,
"TYPE_STOCK_RETURNED": 3,
"TYPE_STOCK_CONSUMED": 4,
}
)
func (x StockReservationEvent_Type) Enum() *StockReservationEvent_Type {
p := new(StockReservationEvent_Type)
*p = x
return p
}
func (x StockReservationEvent_Type) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (StockReservationEvent_Type) Descriptor() protoreflect.EnumDescriptor {
return file_stocklet_events_v1_warehouse_proto_enumTypes[0].Descriptor()
}
func (StockReservationEvent_Type) Type() protoreflect.EnumType {
return &file_stocklet_events_v1_warehouse_proto_enumTypes[0]
}
func (x StockReservationEvent_Type) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use StockReservationEvent_Type.Descriptor instead.
func (StockReservationEvent_Type) EnumDescriptor() ([]byte, []int) {
return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{3, 0}
}
type StockCreatedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
}
func (x *StockCreatedEvent) Reset() {
*x = StockCreatedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StockCreatedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StockCreatedEvent) ProtoMessage() {}
func (x *StockCreatedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StockCreatedEvent.ProtoReflect.Descriptor instead.
func (*StockCreatedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{0}
}
func (x *StockCreatedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *StockCreatedEvent) GetProductId() string {
if x != nil {
return x.ProductId
}
return ""
}
func (x *StockCreatedEvent) GetQuantity() int32 {
if x != nil {
return x.Quantity
}
return 0
}
type StockAddedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
// If the stock is returned as a result of a stock reservation outcome,
// then the reservation id will be included for reference.
ReservationId *string `protobuf:"bytes,4,opt,name=reservation_id,json=reservationId,proto3,oneof" json:"reservation_id,omitempty"`
}
func (x *StockAddedEvent) Reset() {
*x = StockAddedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StockAddedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StockAddedEvent) ProtoMessage() {}
func (x *StockAddedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StockAddedEvent.ProtoReflect.Descriptor instead.
func (*StockAddedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{1}
}
func (x *StockAddedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *StockAddedEvent) GetProductId() string {
if x != nil {
return x.ProductId
}
return ""
}
func (x *StockAddedEvent) GetAmount() int32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *StockAddedEvent) GetReservationId() string {
if x != nil && x.ReservationId != nil {
return *x.ReservationId
}
return ""
}
type StockRemovedEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
Amount int32 `protobuf:"varint,3,opt,name=amount,proto3" json:"amount,omitempty"`
// If the stock is removed as a result of a stock reservation being closed,
// then the reservation id will be included for reference.
ReservationId *string `protobuf:"bytes,4,opt,name=reservation_id,json=reservationId,proto3,oneof" json:"reservation_id,omitempty"`
}
func (x *StockRemovedEvent) Reset() {
*x = StockRemovedEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StockRemovedEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StockRemovedEvent) ProtoMessage() {}
func (x *StockRemovedEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StockRemovedEvent.ProtoReflect.Descriptor instead.
func (*StockRemovedEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{2}
}
func (x *StockRemovedEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *StockRemovedEvent) GetProductId() string {
if x != nil {
return x.ProductId
}
return ""
}
func (x *StockRemovedEvent) GetAmount() int32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *StockRemovedEvent) GetReservationId() string {
if x != nil && x.ReservationId != nil {
return *x.ReservationId
}
return ""
}
type StockReservationEvent struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Revision int32 `protobuf:"varint,1,opt,name=revision,proto3" json:"revision,omitempty"`
Type StockReservationEvent_Type `protobuf:"varint,2,opt,name=type,proto3,enum=stocklet.events.v1.StockReservationEvent_Type" json:"type,omitempty"`
OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
OrderMetadata *StockReservationEvent_OrderMetadata `protobuf:"bytes,4,opt,name=order_metadata,json=orderMetadata,proto3" json:"order_metadata,omitempty"`
ReservationId string `protobuf:"bytes,5,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"` // provided with type enum value 2+
ReservationStock map[string]int32 `protobuf:"bytes,6,rep,name=reservation_stock,json=reservationStock,proto3" json:"reservation_stock,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"` // Product ID: Quantity (provided with type enum value 2+)
InsufficientStock []string `protobuf:"bytes,7,rep,name=insufficient_stock,json=insufficientStock,proto3" json:"insufficient_stock,omitempty"` // Product IDs (only provided with TYPE_INSUFFICIENT_STOCK)
}
func (x *StockReservationEvent) Reset() {
*x = StockReservationEvent{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StockReservationEvent) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StockReservationEvent) ProtoMessage() {}
func (x *StockReservationEvent) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StockReservationEvent.ProtoReflect.Descriptor instead.
func (*StockReservationEvent) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{3}
}
func (x *StockReservationEvent) GetRevision() int32 {
if x != nil {
return x.Revision
}
return 0
}
func (x *StockReservationEvent) GetType() StockReservationEvent_Type {
if x != nil {
return x.Type
}
return StockReservationEvent_TYPE_UNSPECIFIED
}
func (x *StockReservationEvent) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *StockReservationEvent) GetOrderMetadata() *StockReservationEvent_OrderMetadata {
if x != nil {
return x.OrderMetadata
}
return nil
}
func (x *StockReservationEvent) GetReservationId() string {
if x != nil {
return x.ReservationId
}
return ""
}
func (x *StockReservationEvent) GetReservationStock() map[string]int32 {
if x != nil {
return x.ReservationStock
}
return nil
}
func (x *StockReservationEvent) GetInsufficientStock() []string {
if x != nil {
return x.InsufficientStock
}
return nil
}
type StockReservationEvent_OrderMetadata struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
ItemsPrice float32 `protobuf:"fixed32,2,opt,name=items_price,json=itemsPrice,proto3" json:"items_price,omitempty"`
TotalPrice float32 `protobuf:"fixed32,3,opt,name=total_price,json=totalPrice,proto3" json:"total_price,omitempty"`
}
func (x *StockReservationEvent_OrderMetadata) Reset() {
*x = StockReservationEvent_OrderMetadata{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *StockReservationEvent_OrderMetadata) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*StockReservationEvent_OrderMetadata) ProtoMessage() {}
func (x *StockReservationEvent_OrderMetadata) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_events_v1_warehouse_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use StockReservationEvent_OrderMetadata.ProtoReflect.Descriptor instead.
func (*StockReservationEvent_OrderMetadata) Descriptor() ([]byte, []int) {
return file_stocklet_events_v1_warehouse_proto_rawDescGZIP(), []int{3, 0}
}
func (x *StockReservationEvent_OrderMetadata) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *StockReservationEvent_OrderMetadata) GetItemsPrice() float32 {
if x != nil {
return x.ItemsPrice
}
return 0
}
func (x *StockReservationEvent_OrderMetadata) GetTotalPrice() float32 {
if x != nil {
return x.TotalPrice
}
return 0
}
var File_stocklet_events_v1_warehouse_proto protoreflect.FileDescriptor
var file_stocklet_events_v1_warehouse_proto_rawDesc = []byte{
0x0a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x12, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x22, 0x6a, 0x0a, 0x11, 0x53, 0x74, 0x6f, 0x63,
0x6b, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52,
0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f,
0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e,
0x74, 0x69, 0x74, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x71, 0x75, 0x61, 0x6e,
0x74, 0x69, 0x74, 0x79, 0x22, 0xa3, 0x01, 0x0a, 0x0f, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x41, 0x64,
0x64, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69,
0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69,
0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20,
0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x72,
0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20,
0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f, 0x72, 0x65, 0x73, 0x65,
0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x22, 0xa5, 0x01, 0x0a, 0x11, 0x53,
0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x6d, 0x6f, 0x76, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74,
0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x08, 0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a,
0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x61,
0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x61, 0x6d, 0x6f,
0x75, 0x6e, 0x74, 0x12, 0x2a, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x0d, 0x72,
0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x42,
0x11, 0x0a, 0x0f, 0x5f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f,
0x69, 0x64, 0x22, 0xf6, 0x05, 0x0a, 0x15, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65,
0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08,
0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08,
0x72, 0x65, 0x76, 0x69, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x42, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x2e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63,
0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e,
0x74, 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a, 0x08,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12, 0x5e, 0x0a, 0x0e, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x5f, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x37, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x52, 0x0d, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x4d,
0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x25, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72,
0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52,
0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x6c,
0x0a, 0x11, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x3f, 0x2e, 0x73, 0x74, 0x6f, 0x63,
0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53,
0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x53, 0x74, 0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x10, 0x72, 0x65, 0x73, 0x65,
0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x2d, 0x0a, 0x12,
0x69, 0x6e, 0x73, 0x75, 0x66, 0x66, 0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x5f, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, 0x11, 0x69, 0x6e, 0x73, 0x75, 0x66, 0x66,
0x69, 0x63, 0x69, 0x65, 0x6e, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x1a, 0x72, 0x0a, 0x0d, 0x4f,
0x72, 0x64, 0x65, 0x72, 0x4d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74, 0x61, 0x12, 0x1f, 0x0a, 0x0b,
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28,
0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x1f, 0x0a,
0x0b, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x02, 0x20, 0x01,
0x28, 0x02, 0x52, 0x0a, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1f,
0x0a, 0x0b, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x03, 0x20,
0x01, 0x28, 0x02, 0x52, 0x0a, 0x74, 0x6f, 0x74, 0x61, 0x6c, 0x50, 0x72, 0x69, 0x63, 0x65, 0x1a,
0x43, 0x0a, 0x15, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74,
0x6f, 0x63, 0x6b, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61,
0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65,
0x3a, 0x02, 0x38, 0x01, 0x22, 0x84, 0x01, 0x0a, 0x04, 0x54, 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a,
0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,
0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x49, 0x4e, 0x53, 0x55,
0x46, 0x46, 0x49, 0x43, 0x49, 0x45, 0x4e, 0x54, 0x5f, 0x53, 0x54, 0x4f, 0x43, 0x4b, 0x10, 0x01,
0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x43, 0x4b, 0x5f, 0x52,
0x45, 0x53, 0x45, 0x52, 0x56, 0x45, 0x44, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50,
0x45, 0x5f, 0x53, 0x54, 0x4f, 0x43, 0x4b, 0x5f, 0x52, 0x45, 0x54, 0x55, 0x52, 0x4e, 0x45, 0x44,
0x10, 0x03, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x53, 0x54, 0x4f, 0x43, 0x4b,
0x5f, 0x43, 0x4f, 0x4e, 0x53, 0x55, 0x4d, 0x45, 0x44, 0x10, 0x04, 0x42, 0x47, 0x5a, 0x45, 0x67,
0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61,
0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72,
0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e,
0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x3b, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_events_v1_warehouse_proto_rawDescOnce sync.Once
file_stocklet_events_v1_warehouse_proto_rawDescData = file_stocklet_events_v1_warehouse_proto_rawDesc
)
func file_stocklet_events_v1_warehouse_proto_rawDescGZIP() []byte {
file_stocklet_events_v1_warehouse_proto_rawDescOnce.Do(func() {
file_stocklet_events_v1_warehouse_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_events_v1_warehouse_proto_rawDescData)
})
return file_stocklet_events_v1_warehouse_proto_rawDescData
}
var file_stocklet_events_v1_warehouse_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_stocklet_events_v1_warehouse_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_stocklet_events_v1_warehouse_proto_goTypes = []interface{}{
(StockReservationEvent_Type)(0), // 0: stocklet.events.v1.StockReservationEvent.Type
(*StockCreatedEvent)(nil), // 1: stocklet.events.v1.StockCreatedEvent
(*StockAddedEvent)(nil), // 2: stocklet.events.v1.StockAddedEvent
(*StockRemovedEvent)(nil), // 3: stocklet.events.v1.StockRemovedEvent
(*StockReservationEvent)(nil), // 4: stocklet.events.v1.StockReservationEvent
(*StockReservationEvent_OrderMetadata)(nil), // 5: stocklet.events.v1.StockReservationEvent.OrderMetadata
nil, // 6: stocklet.events.v1.StockReservationEvent.ReservationStockEntry
}
var file_stocklet_events_v1_warehouse_proto_depIdxs = []int32{
0, // 0: stocklet.events.v1.StockReservationEvent.type:type_name -> stocklet.events.v1.StockReservationEvent.Type
5, // 1: stocklet.events.v1.StockReservationEvent.order_metadata:type_name -> stocklet.events.v1.StockReservationEvent.OrderMetadata
6, // 2: stocklet.events.v1.StockReservationEvent.reservation_stock:type_name -> stocklet.events.v1.StockReservationEvent.ReservationStockEntry
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
3, // [3:3] is the sub-list for extension type_name
3, // [3:3] is the sub-list for extension extendee
0, // [0:3] is the sub-list for field type_name
}
func init() { file_stocklet_events_v1_warehouse_proto_init() }
func file_stocklet_events_v1_warehouse_proto_init() {
if File_stocklet_events_v1_warehouse_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_events_v1_warehouse_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StockCreatedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_warehouse_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StockAddedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_warehouse_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StockRemovedEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_warehouse_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StockReservationEvent); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_events_v1_warehouse_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*StockReservationEvent_OrderMetadata); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_events_v1_warehouse_proto_msgTypes[1].OneofWrappers = []interface{}{}
file_stocklet_events_v1_warehouse_proto_msgTypes[2].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_events_v1_warehouse_proto_rawDesc,
NumEnums: 1,
NumMessages: 6,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_events_v1_warehouse_proto_goTypes,
DependencyIndexes: file_stocklet_events_v1_warehouse_proto_depIdxs,
EnumInfos: file_stocklet_events_v1_warehouse_proto_enumTypes,
MessageInfos: file_stocklet_events_v1_warehouse_proto_msgTypes,
}.Build()
File_stocklet_events_v1_warehouse_proto = out.File
file_stocklet_events_v1_warehouse_proto_rawDesc = nil
file_stocklet_events_v1_warehouse_proto_goTypes = nil
file_stocklet_events_v1_warehouse_proto_depIdxs = nil
}

View File

@@ -0,0 +1,753 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/order/v1/service.proto
package order_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/googleapis/api/visibility"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ViewOrderRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
OrderId string `protobuf:"bytes,1,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
}
func (x *ViewOrderRequest) Reset() {
*x = ViewOrderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewOrderRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewOrderRequest) ProtoMessage() {}
func (x *ViewOrderRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewOrderRequest.ProtoReflect.Descriptor instead.
func (*ViewOrderRequest) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{0}
}
func (x *ViewOrderRequest) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
type ViewOrderResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *ViewOrderResponse) Reset() {
*x = ViewOrderResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewOrderResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewOrderResponse) ProtoMessage() {}
func (x *ViewOrderResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewOrderResponse.ProtoReflect.Descriptor instead.
func (*ViewOrderResponse) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *ViewOrderResponse) GetOrder() *Order {
if x != nil {
return x.Order
}
return nil
}
type ViewOrdersRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
}
func (x *ViewOrdersRequest) Reset() {
*x = ViewOrdersRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewOrdersRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewOrdersRequest) ProtoMessage() {}
func (x *ViewOrdersRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewOrdersRequest.ProtoReflect.Descriptor instead.
func (*ViewOrdersRequest) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{2}
}
func (x *ViewOrdersRequest) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
type ViewOrdersResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Orders []*Order `protobuf:"bytes,1,rep,name=orders,proto3" json:"orders,omitempty"`
}
func (x *ViewOrdersResponse) Reset() {
*x = ViewOrdersResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewOrdersResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewOrdersResponse) ProtoMessage() {}
func (x *ViewOrdersResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewOrdersResponse.ProtoReflect.Descriptor instead.
func (*ViewOrdersResponse) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *ViewOrdersResponse) GetOrders() []*Order {
if x != nil {
return x.Orders
}
return nil
}
type GetOrderItemsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *GetOrderItemsRequest) Reset() {
*x = GetOrderItemsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetOrderItemsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetOrderItemsRequest) ProtoMessage() {}
func (x *GetOrderItemsRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetOrderItemsRequest.ProtoReflect.Descriptor instead.
func (*GetOrderItemsRequest) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{4}
}
func (x *GetOrderItemsRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type GetOrderItemsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Items map[string]int32 `protobuf:"bytes,1,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
}
func (x *GetOrderItemsResponse) Reset() {
*x = GetOrderItemsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *GetOrderItemsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetOrderItemsResponse) ProtoMessage() {}
func (x *GetOrderItemsResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetOrderItemsResponse.ProtoReflect.Descriptor instead.
func (*GetOrderItemsResponse) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{5}
}
func (x *GetOrderItemsResponse) GetItems() map[string]int32 {
if x != nil {
return x.Items
}
return nil
}
type PlaceOrderRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Cart map[string]int32 `protobuf:"bytes,1,rep,name=cart,proto3" json:"cart,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
CustomerId string `protobuf:"bytes,2,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
}
func (x *PlaceOrderRequest) Reset() {
*x = PlaceOrderRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PlaceOrderRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PlaceOrderRequest) ProtoMessage() {}
func (x *PlaceOrderRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[6]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PlaceOrderRequest.ProtoReflect.Descriptor instead.
func (*PlaceOrderRequest) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{6}
}
func (x *PlaceOrderRequest) GetCart() map[string]int32 {
if x != nil {
return x.Cart
}
return nil
}
func (x *PlaceOrderRequest) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
type PlaceOrderResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Order *Order `protobuf:"bytes,1,opt,name=order,proto3" json:"order,omitempty"`
}
func (x *PlaceOrderResponse) Reset() {
*x = PlaceOrderResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_service_proto_msgTypes[7]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *PlaceOrderResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*PlaceOrderResponse) ProtoMessage() {}
func (x *PlaceOrderResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_service_proto_msgTypes[7]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use PlaceOrderResponse.ProtoReflect.Descriptor instead.
func (*PlaceOrderResponse) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_service_proto_rawDescGZIP(), []int{7}
}
func (x *PlaceOrderResponse) GetOrder() *Order {
if x != nil {
return x.Order
}
return nil
}
var File_stocklet_order_v1_service_proto protoreflect.FileDescriptor
var file_stocklet_order_v1_service_proto_rawDesc = []byte{
0x0a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x11, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61,
0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e,
0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69,
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f,
0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d,
0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31,
0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f,
0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x36, 0x0a, 0x10, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72,
0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x22, 0x0a, 0x08, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48,
0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x22, 0x43,
0x0a, 0x11, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x22, 0x3d, 0x0a, 0x11, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74,
0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba,
0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
0x49, 0x64, 0x22, 0x46, 0x0a, 0x12, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x30, 0x0a, 0x06, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64,
0x65, 0x72, 0x52, 0x06, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x22, 0x2f, 0x0a, 0x14, 0x47, 0x65,
0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0xaa, 0x01, 0x0a, 0x15,
0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x57, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x18, 0x01,
0x20, 0x03, 0x28, 0x0b, 0x32, 0x33, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x2e, 0x49,
0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48, 0x09, 0x9a, 0x01,
0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73, 0x1a, 0x38,
0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10, 0x0a, 0x03,
0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79, 0x12, 0x14,
0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x76,
0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0xbf, 0x01, 0x0a, 0x11, 0x50, 0x6c, 0x61,
0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x50,
0x0a, 0x04, 0x63, 0x61, 0x72, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2e, 0x2e, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31,
0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x2e, 0x43, 0x61, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48,
0x09, 0x9a, 0x01, 0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x04, 0x63, 0x61, 0x72, 0x74,
0x12, 0x1f, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49,
0x64, 0x1a, 0x37, 0x0a, 0x09, 0x43, 0x61, 0x72, 0x74, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x10,
0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65, 0x79,
0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52,
0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x22, 0x44, 0x0a, 0x12, 0x50, 0x6c,
0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x12, 0x2e, 0x0a, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
0x18, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x05, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x32, 0xcd, 0x07, 0x0a, 0x0c, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x12, 0x79, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66,
0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x12, 0x11, 0x2f, 0x76, 0x31, 0x2f, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x09,
0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x23, 0x2e, 0x73, 0x74, 0x6f, 0x63,
0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69,
0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x24,
0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e,
0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x23, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1d, 0x12, 0x1b, 0x2f, 0x76,
0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x2f, 0x7b,
0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0x71, 0x0a, 0x0a, 0x56, 0x69, 0x65,
0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77,
0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x25, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76,
0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x16, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x10, 0x12, 0x0e, 0x2f, 0x76,
0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x78, 0x0a, 0x0a,
0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50,
0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65,
0x72, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x6c, 0x61, 0x63, 0x65, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a,
0x04, 0x63, 0x61, 0x72, 0x74, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x2f, 0x70, 0x6c, 0x61, 0x63, 0x65, 0x12, 0x75, 0x0a, 0x1d, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73,
0x73, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f,
0x74, 0x65, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2a, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f,
0x64, 0x75, 0x63, 0x74, 0x50, 0x72, 0x69, 0x63, 0x65, 0x51, 0x75, 0x6f, 0x74, 0x65, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4,
0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a,
0x1c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73,
0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79,
0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e,
0x41, 0x4c, 0x12, 0x77, 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x68, 0x69,
0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65,
0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e,
0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02,
0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a, 0x1c, 0x50,
0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f,
0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31,
0x2e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65,
0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10,
0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c,
0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68,
0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f,
0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_order_v1_service_proto_rawDescOnce sync.Once
file_stocklet_order_v1_service_proto_rawDescData = file_stocklet_order_v1_service_proto_rawDesc
)
func file_stocklet_order_v1_service_proto_rawDescGZIP() []byte {
file_stocklet_order_v1_service_proto_rawDescOnce.Do(func() {
file_stocklet_order_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_order_v1_service_proto_rawDescData)
})
return file_stocklet_order_v1_service_proto_rawDescData
}
var file_stocklet_order_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
var file_stocklet_order_v1_service_proto_goTypes = []interface{}{
(*ViewOrderRequest)(nil), // 0: stocklet.order.v1.ViewOrderRequest
(*ViewOrderResponse)(nil), // 1: stocklet.order.v1.ViewOrderResponse
(*ViewOrdersRequest)(nil), // 2: stocklet.order.v1.ViewOrdersRequest
(*ViewOrdersResponse)(nil), // 3: stocklet.order.v1.ViewOrdersResponse
(*GetOrderItemsRequest)(nil), // 4: stocklet.order.v1.GetOrderItemsRequest
(*GetOrderItemsResponse)(nil), // 5: stocklet.order.v1.GetOrderItemsResponse
(*PlaceOrderRequest)(nil), // 6: stocklet.order.v1.PlaceOrderRequest
(*PlaceOrderResponse)(nil), // 7: stocklet.order.v1.PlaceOrderResponse
nil, // 8: stocklet.order.v1.GetOrderItemsResponse.ItemsEntry
nil, // 9: stocklet.order.v1.PlaceOrderRequest.CartEntry
(*Order)(nil), // 10: stocklet.order.v1.Order
(*v1.ServiceInfoRequest)(nil), // 11: stocklet.common.v1.ServiceInfoRequest
(*v11.ProductPriceQuoteEvent)(nil), // 12: stocklet.events.v1.ProductPriceQuoteEvent
(*v11.StockReservationEvent)(nil), // 13: stocklet.events.v1.StockReservationEvent
(*v11.ShipmentAllocationEvent)(nil), // 14: stocklet.events.v1.ShipmentAllocationEvent
(*v11.PaymentProcessedEvent)(nil), // 15: stocklet.events.v1.PaymentProcessedEvent
(*v1.ServiceInfoResponse)(nil), // 16: stocklet.common.v1.ServiceInfoResponse
(*emptypb.Empty)(nil), // 17: google.protobuf.Empty
}
var file_stocklet_order_v1_service_proto_depIdxs = []int32{
10, // 0: stocklet.order.v1.ViewOrderResponse.order:type_name -> stocklet.order.v1.Order
10, // 1: stocklet.order.v1.ViewOrdersResponse.orders:type_name -> stocklet.order.v1.Order
8, // 2: stocklet.order.v1.GetOrderItemsResponse.items:type_name -> stocklet.order.v1.GetOrderItemsResponse.ItemsEntry
9, // 3: stocklet.order.v1.PlaceOrderRequest.cart:type_name -> stocklet.order.v1.PlaceOrderRequest.CartEntry
10, // 4: stocklet.order.v1.PlaceOrderResponse.order:type_name -> stocklet.order.v1.Order
11, // 5: stocklet.order.v1.OrderService.ServiceInfo:input_type -> stocklet.common.v1.ServiceInfoRequest
0, // 6: stocklet.order.v1.OrderService.ViewOrder:input_type -> stocklet.order.v1.ViewOrderRequest
2, // 7: stocklet.order.v1.OrderService.ViewOrders:input_type -> stocklet.order.v1.ViewOrdersRequest
6, // 8: stocklet.order.v1.OrderService.PlaceOrder:input_type -> stocklet.order.v1.PlaceOrderRequest
12, // 9: stocklet.order.v1.OrderService.ProcessProductPriceQuoteEvent:input_type -> stocklet.events.v1.ProductPriceQuoteEvent
13, // 10: stocklet.order.v1.OrderService.ProcessStockReservationEvent:input_type -> stocklet.events.v1.StockReservationEvent
14, // 11: stocklet.order.v1.OrderService.ProcessShipmentAllocationEvent:input_type -> stocklet.events.v1.ShipmentAllocationEvent
15, // 12: stocklet.order.v1.OrderService.ProcessPaymentProcessedEvent:input_type -> stocklet.events.v1.PaymentProcessedEvent
16, // 13: stocklet.order.v1.OrderService.ServiceInfo:output_type -> stocklet.common.v1.ServiceInfoResponse
1, // 14: stocklet.order.v1.OrderService.ViewOrder:output_type -> stocklet.order.v1.ViewOrderResponse
3, // 15: stocklet.order.v1.OrderService.ViewOrders:output_type -> stocklet.order.v1.ViewOrdersResponse
7, // 16: stocklet.order.v1.OrderService.PlaceOrder:output_type -> stocklet.order.v1.PlaceOrderResponse
17, // 17: stocklet.order.v1.OrderService.ProcessProductPriceQuoteEvent:output_type -> google.protobuf.Empty
17, // 18: stocklet.order.v1.OrderService.ProcessStockReservationEvent:output_type -> google.protobuf.Empty
17, // 19: stocklet.order.v1.OrderService.ProcessShipmentAllocationEvent:output_type -> google.protobuf.Empty
17, // 20: stocklet.order.v1.OrderService.ProcessPaymentProcessedEvent:output_type -> google.protobuf.Empty
13, // [13:21] is the sub-list for method output_type
5, // [5:13] is the sub-list for method input_type
5, // [5:5] is the sub-list for extension type_name
5, // [5:5] is the sub-list for extension extendee
0, // [0:5] is the sub-list for field type_name
}
func init() { file_stocklet_order_v1_service_proto_init() }
func file_stocklet_order_v1_service_proto_init() {
if File_stocklet_order_v1_service_proto != nil {
return
}
file_stocklet_order_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_stocklet_order_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewOrderRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewOrderResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewOrdersRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewOrdersResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetOrderItemsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetOrderItemsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlaceOrderRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_order_v1_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*PlaceOrderResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_order_v1_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 10,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_stocklet_order_v1_service_proto_goTypes,
DependencyIndexes: file_stocklet_order_v1_service_proto_depIdxs,
MessageInfos: file_stocklet_order_v1_service_proto_msgTypes,
}.Build()
File_stocklet_order_v1_service_proto = out.File
file_stocklet_order_v1_service_proto_rawDesc = nil
file_stocklet_order_v1_service_proto_goTypes = nil
file_stocklet_order_v1_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,449 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: stocklet/order/v1/service.proto
/*
Package order_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package order_v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_OrderService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_OrderService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := server.ServiceInfo(ctx, &protoReq)
return msg, metadata, err
}
func request_OrderService_ViewOrder_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewOrderRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["order_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "order_id")
}
protoReq.OrderId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "order_id", err)
}
msg, err := client.ViewOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_OrderService_ViewOrder_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewOrderRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["order_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "order_id")
}
protoReq.OrderId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "order_id", err)
}
msg, err := server.ViewOrder(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_OrderService_ViewOrders_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_OrderService_ViewOrders_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewOrdersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_ViewOrders_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ViewOrders(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_OrderService_ViewOrders_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewOrdersRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_ViewOrders_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ViewOrders(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_OrderService_PlaceOrder_0 = &utilities.DoubleArray{Encoding: map[string]int{"cart": 0}, Base: []int{1, 2, 0, 0}, Check: []int{0, 1, 2, 2}}
)
func request_OrderService_PlaceOrder_0(ctx context.Context, marshaler runtime.Marshaler, client OrderServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq PlaceOrderRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cart); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_PlaceOrder_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.PlaceOrder(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_OrderService_PlaceOrder_0(ctx context.Context, marshaler runtime.Marshaler, server OrderServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq PlaceOrderRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.Cart); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_OrderService_PlaceOrder_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.PlaceOrder(ctx, &protoReq)
return msg, metadata, err
}
// RegisterOrderServiceHandlerServer registers the http handlers for service OrderService to "mux".
// UnaryRPC :call OrderServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterOrderServiceHandlerFromEndpoint instead.
func RegisterOrderServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server OrderServiceServer) error {
mux.Handle("GET", pattern_OrderService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/order/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_OrderService_ServiceInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_OrderService_ViewOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrder", runtime.WithHTTPPathPattern("/v1/order/orders/{order_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_OrderService_ViewOrder_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ViewOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_OrderService_ViewOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrders", runtime.WithHTTPPathPattern("/v1/order/list"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_OrderService_ViewOrders_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ViewOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_OrderService_PlaceOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.order.v1.OrderService/PlaceOrder", runtime.WithHTTPPathPattern("/v1/order/place"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_OrderService_PlaceOrder_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_PlaceOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterOrderServiceHandlerFromEndpoint is same as RegisterOrderServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterOrderServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterOrderServiceHandler(ctx, mux, conn)
}
// RegisterOrderServiceHandler registers the http handlers for service OrderService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterOrderServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterOrderServiceHandlerClient(ctx, mux, NewOrderServiceClient(conn))
}
// RegisterOrderServiceHandlerClient registers the http handlers for service OrderService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "OrderServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "OrderServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "OrderServiceClient" to call the correct interceptors.
func RegisterOrderServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client OrderServiceClient) error {
mux.Handle("GET", pattern_OrderService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/order/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_OrderService_ServiceInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_OrderService_ViewOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrder", runtime.WithHTTPPathPattern("/v1/order/orders/{order_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_OrderService_ViewOrder_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ViewOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_OrderService_ViewOrders_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/ViewOrders", runtime.WithHTTPPathPattern("/v1/order/list"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_OrderService_ViewOrders_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_ViewOrders_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_OrderService_PlaceOrder_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.order.v1.OrderService/PlaceOrder", runtime.WithHTTPPathPattern("/v1/order/place"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_OrderService_PlaceOrder_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_OrderService_PlaceOrder_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_OrderService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "service"}, ""))
pattern_OrderService_ViewOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "order", "orders", "order_id"}, ""))
pattern_OrderService_ViewOrders_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "list"}, ""))
pattern_OrderService_PlaceOrder_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "order", "place"}, ""))
)
var (
forward_OrderService_ServiceInfo_0 = runtime.ForwardResponseMessage
forward_OrderService_ViewOrder_0 = runtime.ForwardResponseMessage
forward_OrderService_ViewOrders_0 = runtime.ForwardResponseMessage
forward_OrderService_PlaceOrder_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,436 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: stocklet/order/v1/service.proto
package order_v1
import (
context "context"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
OrderService_ServiceInfo_FullMethodName = "/stocklet.order.v1.OrderService/ServiceInfo"
OrderService_ViewOrder_FullMethodName = "/stocklet.order.v1.OrderService/ViewOrder"
OrderService_ViewOrders_FullMethodName = "/stocklet.order.v1.OrderService/ViewOrders"
OrderService_PlaceOrder_FullMethodName = "/stocklet.order.v1.OrderService/PlaceOrder"
OrderService_ProcessProductPriceQuoteEvent_FullMethodName = "/stocklet.order.v1.OrderService/ProcessProductPriceQuoteEvent"
OrderService_ProcessStockReservationEvent_FullMethodName = "/stocklet.order.v1.OrderService/ProcessStockReservationEvent"
OrderService_ProcessShipmentAllocationEvent_FullMethodName = "/stocklet.order.v1.OrderService/ProcessShipmentAllocationEvent"
OrderService_ProcessPaymentProcessedEvent_FullMethodName = "/stocklet.order.v1.OrderService/ProcessPaymentProcessedEvent"
)
// OrderServiceClient is the client API for OrderService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type OrderServiceClient interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
ViewOrder(ctx context.Context, in *ViewOrderRequest, opts ...grpc.CallOption) (*ViewOrderResponse, error)
// Get a list of a customer's orders.
// If accessed through the gateway - shows the current user's orders.
ViewOrders(ctx context.Context, in *ViewOrdersRequest, opts ...grpc.CallOption) (*ViewOrdersResponse, error)
PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessProductPriceQuoteEvent(ctx context.Context, in *v11.ProductPriceQuoteEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessStockReservationEvent(ctx context.Context, in *v11.StockReservationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type orderServiceClient struct {
cc grpc.ClientConnInterface
}
func NewOrderServiceClient(cc grpc.ClientConnInterface) OrderServiceClient {
return &orderServiceClient{cc}
}
func (c *orderServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
out := new(v1.ServiceInfoResponse)
err := c.cc.Invoke(ctx, OrderService_ServiceInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ViewOrder(ctx context.Context, in *ViewOrderRequest, opts ...grpc.CallOption) (*ViewOrderResponse, error) {
out := new(ViewOrderResponse)
err := c.cc.Invoke(ctx, OrderService_ViewOrder_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ViewOrders(ctx context.Context, in *ViewOrdersRequest, opts ...grpc.CallOption) (*ViewOrdersResponse, error) {
out := new(ViewOrdersResponse)
err := c.cc.Invoke(ctx, OrderService_ViewOrders_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) PlaceOrder(ctx context.Context, in *PlaceOrderRequest, opts ...grpc.CallOption) (*PlaceOrderResponse, error) {
out := new(PlaceOrderResponse)
err := c.cc.Invoke(ctx, OrderService_PlaceOrder_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ProcessProductPriceQuoteEvent(ctx context.Context, in *v11.ProductPriceQuoteEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, OrderService_ProcessProductPriceQuoteEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ProcessStockReservationEvent(ctx context.Context, in *v11.StockReservationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, OrderService_ProcessStockReservationEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, OrderService_ProcessShipmentAllocationEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *orderServiceClient) ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, OrderService_ProcessPaymentProcessedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// OrderServiceServer is the server API for OrderService service.
// All implementations must embed UnimplementedOrderServiceServer
// for forward compatibility
type OrderServiceServer interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
ViewOrder(context.Context, *ViewOrderRequest) (*ViewOrderResponse, error)
// Get a list of a customer's orders.
// If accessed through the gateway - shows the current user's orders.
ViewOrders(context.Context, *ViewOrdersRequest) (*ViewOrdersResponse, error)
PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessProductPriceQuoteEvent(context.Context, *v11.ProductPriceQuoteEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessStockReservationEvent(context.Context, *v11.StockReservationEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error)
mustEmbedUnimplementedOrderServiceServer()
}
// UnimplementedOrderServiceServer must be embedded to have forward compatible implementations.
type UnimplementedOrderServiceServer struct {
}
func (UnimplementedOrderServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
}
func (UnimplementedOrderServiceServer) ViewOrder(context.Context, *ViewOrderRequest) (*ViewOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewOrder not implemented")
}
func (UnimplementedOrderServiceServer) ViewOrders(context.Context, *ViewOrdersRequest) (*ViewOrdersResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewOrders not implemented")
}
func (UnimplementedOrderServiceServer) PlaceOrder(context.Context, *PlaceOrderRequest) (*PlaceOrderResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method PlaceOrder not implemented")
}
func (UnimplementedOrderServiceServer) ProcessProductPriceQuoteEvent(context.Context, *v11.ProductPriceQuoteEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessProductPriceQuoteEvent not implemented")
}
func (UnimplementedOrderServiceServer) ProcessStockReservationEvent(context.Context, *v11.StockReservationEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessStockReservationEvent not implemented")
}
func (UnimplementedOrderServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented")
}
func (UnimplementedOrderServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented")
}
func (UnimplementedOrderServiceServer) mustEmbedUnimplementedOrderServiceServer() {}
// UnsafeOrderServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to OrderServiceServer will
// result in compilation errors.
type UnsafeOrderServiceServer interface {
mustEmbedUnimplementedOrderServiceServer()
}
func RegisterOrderServiceServer(s grpc.ServiceRegistrar, srv OrderServiceServer) {
s.RegisterService(&OrderService_ServiceDesc, srv)
}
func _OrderService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.ServiceInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ServiceInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ServiceInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ViewOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ViewOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ViewOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ViewOrder(ctx, req.(*ViewOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ViewOrders_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewOrdersRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ViewOrders(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ViewOrders_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ViewOrders(ctx, req.(*ViewOrdersRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_PlaceOrder_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PlaceOrderRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).PlaceOrder(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_PlaceOrder_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).PlaceOrder(ctx, req.(*PlaceOrderRequest))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ProcessProductPriceQuoteEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.ProductPriceQuoteEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ProcessProductPriceQuoteEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ProcessProductPriceQuoteEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ProcessProductPriceQuoteEvent(ctx, req.(*v11.ProductPriceQuoteEvent))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ProcessStockReservationEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.StockReservationEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ProcessStockReservationEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ProcessStockReservationEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ProcessStockReservationEvent(ctx, req.(*v11.StockReservationEvent))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ProcessShipmentAllocationEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.ShipmentAllocationEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ProcessShipmentAllocationEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ProcessShipmentAllocationEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ProcessShipmentAllocationEvent(ctx, req.(*v11.ShipmentAllocationEvent))
}
return interceptor(ctx, in, info, handler)
}
func _OrderService_ProcessPaymentProcessedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.PaymentProcessedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(OrderServiceServer).ProcessPaymentProcessedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: OrderService_ProcessPaymentProcessedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(OrderServiceServer).ProcessPaymentProcessedEvent(ctx, req.(*v11.PaymentProcessedEvent))
}
return interceptor(ctx, in, info, handler)
}
// OrderService_ServiceDesc is the grpc.ServiceDesc for OrderService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var OrderService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stocklet.order.v1.OrderService",
HandlerType: (*OrderServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ServiceInfo",
Handler: _OrderService_ServiceInfo_Handler,
},
{
MethodName: "ViewOrder",
Handler: _OrderService_ViewOrder_Handler,
},
{
MethodName: "ViewOrders",
Handler: _OrderService_ViewOrders_Handler,
},
{
MethodName: "PlaceOrder",
Handler: _OrderService_PlaceOrder_Handler,
},
{
MethodName: "ProcessProductPriceQuoteEvent",
Handler: _OrderService_ProcessProductPriceQuoteEvent_Handler,
},
{
MethodName: "ProcessStockReservationEvent",
Handler: _OrderService_ProcessStockReservationEvent_Handler,
},
{
MethodName: "ProcessShipmentAllocationEvent",
Handler: _OrderService_ProcessShipmentAllocationEvent_Handler,
},
{
MethodName: "ProcessPaymentProcessedEvent",
Handler: _OrderService_ProcessPaymentProcessedEvent_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stocklet/order/v1/service.proto",
}

View File

@@ -0,0 +1,327 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/order/v1/types.proto
package order_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type OrderStatus int32
const (
OrderStatus_ORDER_STATUS_UNSPECIFIED OrderStatus = 0
OrderStatus_ORDER_STATUS_PROCESSING OrderStatus = 1 // awaiting price quotes for products
OrderStatus_ORDER_STATUS_PENDING OrderStatus = 2 // awaiting stock allocation, shipping allotment and payment
OrderStatus_ORDER_STATUS_REJECTED OrderStatus = 3
OrderStatus_ORDER_STATUS_APPROVED OrderStatus = 4
OrderStatus_ORDER_STATUS_COMPLETED OrderStatus = 5
)
// Enum value maps for OrderStatus.
var (
OrderStatus_name = map[int32]string{
0: "ORDER_STATUS_UNSPECIFIED",
1: "ORDER_STATUS_PROCESSING",
2: "ORDER_STATUS_PENDING",
3: "ORDER_STATUS_REJECTED",
4: "ORDER_STATUS_APPROVED",
5: "ORDER_STATUS_COMPLETED",
}
OrderStatus_value = map[string]int32{
"ORDER_STATUS_UNSPECIFIED": 0,
"ORDER_STATUS_PROCESSING": 1,
"ORDER_STATUS_PENDING": 2,
"ORDER_STATUS_REJECTED": 3,
"ORDER_STATUS_APPROVED": 4,
"ORDER_STATUS_COMPLETED": 5,
}
)
func (x OrderStatus) Enum() *OrderStatus {
p := new(OrderStatus)
*p = x
return p
}
func (x OrderStatus) String() string {
return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}
func (OrderStatus) Descriptor() protoreflect.EnumDescriptor {
return file_stocklet_order_v1_types_proto_enumTypes[0].Descriptor()
}
func (OrderStatus) Type() protoreflect.EnumType {
return &file_stocklet_order_v1_types_proto_enumTypes[0]
}
func (x OrderStatus) Number() protoreflect.EnumNumber {
return protoreflect.EnumNumber(x)
}
// Deprecated: Use OrderStatus.Descriptor instead.
func (OrderStatus) EnumDescriptor() ([]byte, []int) {
return file_stocklet_order_v1_types_proto_rawDescGZIP(), []int{0}
}
type Order struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Status OrderStatus `protobuf:"varint,2,opt,name=status,proto3,enum=stocklet.order.v1.OrderStatus" json:"status,omitempty"`
// 'items' consists of a mapping of Product ID to Quantity.
Items map[string]int32 `protobuf:"bytes,3,rep,name=items,proto3" json:"items,omitempty" protobuf_key:"bytes,1,opt,name=key,proto3" protobuf_val:"varint,2,opt,name=value,proto3"`
CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
TransactionId *string `protobuf:"bytes,5,opt,name=transaction_id,json=transactionId,proto3,oneof" json:"transaction_id,omitempty"`
ShippingId *string `protobuf:"bytes,6,opt,name=shipping_id,json=shippingId,proto3,oneof" json:"shipping_id,omitempty"`
CreatedAt int64 `protobuf:"varint,7,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt *int64 `protobuf:"varint,8,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"`
}
func (x *Order) Reset() {
*x = Order{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_order_v1_types_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Order) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Order) ProtoMessage() {}
func (x *Order) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_order_v1_types_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Order.ProtoReflect.Descriptor instead.
func (*Order) Descriptor() ([]byte, []int) {
return file_stocklet_order_v1_types_proto_rawDescGZIP(), []int{0}
}
func (x *Order) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Order) GetStatus() OrderStatus {
if x != nil {
return x.Status
}
return OrderStatus_ORDER_STATUS_UNSPECIFIED
}
func (x *Order) GetItems() map[string]int32 {
if x != nil {
return x.Items
}
return nil
}
func (x *Order) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *Order) GetTransactionId() string {
if x != nil && x.TransactionId != nil {
return *x.TransactionId
}
return ""
}
func (x *Order) GetShippingId() string {
if x != nil && x.ShippingId != nil {
return *x.ShippingId
}
return ""
}
func (x *Order) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *Order) GetUpdatedAt() int64 {
if x != nil && x.UpdatedAt != nil {
return *x.UpdatedAt
}
return 0
}
var File_stocklet_order_v1_types_proto protoreflect.FileDescriptor
var file_stocklet_order_v1_types_proto_rawDesc = []byte{
0x0a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72,
0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12,
0x11, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e,
0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0xeb, 0x03, 0x0a, 0x05, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02,
0x69, 0x64, 0x12, 0x43, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01,
0x28, 0x0e, 0x32, 0x1e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x6f, 0x72,
0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74,
0x75, 0x73, 0x42, 0x0b, 0xba, 0x48, 0x08, 0x82, 0x01, 0x05, 0x10, 0x01, 0x22, 0x01, 0x00, 0x52,
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x47, 0x0a, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
0x18, 0x03, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2e, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72,
0x2e, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x42, 0x0c, 0xba, 0x48, 0x09,
0x9a, 0x01, 0x06, 0x2a, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52, 0x05, 0x69, 0x74, 0x65, 0x6d, 0x73,
0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a,
0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x33, 0x0a, 0x0e, 0x74, 0x72,
0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x05, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x00, 0x52, 0x0d, 0x74,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12,
0x2d, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x06,
0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x48, 0x01, 0x52,
0x0a, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x88, 0x01, 0x01, 0x12, 0x1d,
0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x07, 0x20, 0x01,
0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x22, 0x0a,
0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x08, 0x20, 0x01, 0x28,
0x03, 0x48, 0x02, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88, 0x01,
0x01, 0x1a, 0x38, 0x0a, 0x0a, 0x49, 0x74, 0x65, 0x6d, 0x73, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12,
0x10, 0x0a, 0x03, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x6b, 0x65,
0x79, 0x12, 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x3a, 0x02, 0x38, 0x01, 0x42, 0x11, 0x0a, 0x0f, 0x5f,
0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x42, 0x0e,
0x0a, 0x0c, 0x5f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x42, 0x0d,
0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x2a, 0xb4, 0x01,
0x0a, 0x0b, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1c, 0x0a,
0x18, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x55, 0x4e,
0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1b, 0x0a, 0x17, 0x4f,
0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x52, 0x4f, 0x43,
0x45, 0x53, 0x53, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x18, 0x0a, 0x14, 0x4f, 0x52, 0x44, 0x45,
0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47,
0x10, 0x02, 0x12, 0x19, 0x0a, 0x15, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54,
0x55, 0x53, 0x5f, 0x52, 0x45, 0x4a, 0x45, 0x43, 0x54, 0x45, 0x44, 0x10, 0x03, 0x12, 0x19, 0x0a,
0x15, 0x4f, 0x52, 0x44, 0x45, 0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x41, 0x50,
0x50, 0x52, 0x4f, 0x56, 0x45, 0x44, 0x10, 0x04, 0x12, 0x1a, 0x0a, 0x16, 0x4f, 0x52, 0x44, 0x45,
0x52, 0x5f, 0x53, 0x54, 0x41, 0x54, 0x55, 0x53, 0x5f, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54,
0x45, 0x44, 0x10, 0x05, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2f,
0x76, 0x31, 0x3b, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_stocklet_order_v1_types_proto_rawDescOnce sync.Once
file_stocklet_order_v1_types_proto_rawDescData = file_stocklet_order_v1_types_proto_rawDesc
)
func file_stocklet_order_v1_types_proto_rawDescGZIP() []byte {
file_stocklet_order_v1_types_proto_rawDescOnce.Do(func() {
file_stocklet_order_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_order_v1_types_proto_rawDescData)
})
return file_stocklet_order_v1_types_proto_rawDescData
}
var file_stocklet_order_v1_types_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_stocklet_order_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_stocklet_order_v1_types_proto_goTypes = []interface{}{
(OrderStatus)(0), // 0: stocklet.order.v1.OrderStatus
(*Order)(nil), // 1: stocklet.order.v1.Order
nil, // 2: stocklet.order.v1.Order.ItemsEntry
}
var file_stocklet_order_v1_types_proto_depIdxs = []int32{
0, // 0: stocklet.order.v1.Order.status:type_name -> stocklet.order.v1.OrderStatus
2, // 1: stocklet.order.v1.Order.items:type_name -> stocklet.order.v1.Order.ItemsEntry
2, // [2:2] is the sub-list for method output_type
2, // [2:2] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_order_v1_types_proto_init() }
func file_stocklet_order_v1_types_proto_init() {
if File_stocklet_order_v1_types_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_order_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Order); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_order_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_order_v1_types_proto_rawDesc,
NumEnums: 1,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_order_v1_types_proto_goTypes,
DependencyIndexes: file_stocklet_order_v1_types_proto_depIdxs,
EnumInfos: file_stocklet_order_v1_types_proto_enumTypes,
MessageInfos: file_stocklet_order_v1_types_proto_msgTypes,
}.Build()
File_stocklet_order_v1_types_proto = out.File
file_stocklet_order_v1_types_proto_rawDesc = nil
file_stocklet_order_v1_types_proto_goTypes = nil
file_stocklet_order_v1_types_proto_depIdxs = nil
}

View File

@@ -0,0 +1,454 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/payment/v1/service.proto
package payment_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/googleapis/api/visibility"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ViewTransactionRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
TransactionId string `protobuf:"bytes,1,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
}
func (x *ViewTransactionRequest) Reset() {
*x = ViewTransactionRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_payment_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewTransactionRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewTransactionRequest) ProtoMessage() {}
func (x *ViewTransactionRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_payment_v1_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewTransactionRequest.ProtoReflect.Descriptor instead.
func (*ViewTransactionRequest) Descriptor() ([]byte, []int) {
return file_stocklet_payment_v1_service_proto_rawDescGZIP(), []int{0}
}
func (x *ViewTransactionRequest) GetTransactionId() string {
if x != nil {
return x.TransactionId
}
return ""
}
type ViewTransactionResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Transaction *Transaction `protobuf:"bytes,1,opt,name=transaction,proto3" json:"transaction,omitempty"`
}
func (x *ViewTransactionResponse) Reset() {
*x = ViewTransactionResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_payment_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewTransactionResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewTransactionResponse) ProtoMessage() {}
func (x *ViewTransactionResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_payment_v1_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewTransactionResponse.ProtoReflect.Descriptor instead.
func (*ViewTransactionResponse) Descriptor() ([]byte, []int) {
return file_stocklet_payment_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *ViewTransactionResponse) GetTransaction() *Transaction {
if x != nil {
return x.Transaction
}
return nil
}
type ViewBalanceRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
}
func (x *ViewBalanceRequest) Reset() {
*x = ViewBalanceRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_payment_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewBalanceRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewBalanceRequest) ProtoMessage() {}
func (x *ViewBalanceRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_payment_v1_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewBalanceRequest.ProtoReflect.Descriptor instead.
func (*ViewBalanceRequest) Descriptor() ([]byte, []int) {
return file_stocklet_payment_v1_service_proto_rawDescGZIP(), []int{2}
}
func (x *ViewBalanceRequest) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
type ViewBalanceResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Balance *CustomerBalance `protobuf:"bytes,1,opt,name=balance,proto3" json:"balance,omitempty"`
}
func (x *ViewBalanceResponse) Reset() {
*x = ViewBalanceResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_payment_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewBalanceResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewBalanceResponse) ProtoMessage() {}
func (x *ViewBalanceResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_payment_v1_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewBalanceResponse.ProtoReflect.Descriptor instead.
func (*ViewBalanceResponse) Descriptor() ([]byte, []int) {
return file_stocklet_payment_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *ViewBalanceResponse) GetBalance() *CustomerBalance {
if x != nil {
return x.Balance
}
return nil
}
var File_stocklet_payment_v1_service_proto protoreflect.FileDescriptor
var file_stocklet_payment_v1_service_proto_rawDesc = []byte{
0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65,
0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x13, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x61,
0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76,
0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x1d, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76,
0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x61, 0x79,
0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0x48, 0x0a, 0x16, 0x56, 0x69, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73,
0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a,
0x0e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18,
0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0d,
0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x22, 0x5d, 0x0a,
0x17, 0x56, 0x69, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x42, 0x0a, 0x0b, 0x74, 0x72, 0x61, 0x6e,
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
0x2e, 0x76, 0x31, 0x2e, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52,
0x0b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x3e, 0x0a, 0x12,
0x56, 0x69, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01,
0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x22, 0x55, 0x0a, 0x13,
0x56, 0x69, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x01,
0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x75, 0x73, 0x74, 0x6f,
0x6d, 0x65, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61,
0x6e, 0x63, 0x65, 0x32, 0x8b, 0x06, 0x0a, 0x0e, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,
0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69,
0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e,
0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65,
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13,
0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x73, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x12, 0x9e, 0x01, 0x0a, 0x0f, 0x56, 0x69, 0x65, 0x77, 0x54, 0x72, 0x61, 0x6e,
0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69,
0x65, 0x77, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x2c, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x54,
0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x30, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2a, 0x12, 0x28, 0x2f, 0x76, 0x31, 0x2f,
0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x2f, 0x7b, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e,
0x5f, 0x69, 0x64, 0x7d, 0x12, 0x8b, 0x01, 0x0a, 0x0b, 0x56, 0x69, 0x65, 0x77, 0x42, 0x61, 0x6c,
0x61, 0x6e, 0x63, 0x65, 0x12, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x42,
0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x28, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x12,
0x21, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x62, 0x61, 0x6c,
0x61, 0x6e, 0x63, 0x65, 0x2f, 0x7b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69,
0x64, 0x7d, 0x12, 0x69, 0x0a, 0x17, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x55, 0x73, 0x65,
0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76,
0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4,
0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x69, 0x0a,
0x17, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x55, 0x73, 0x65, 0x72, 0x44, 0x65, 0x6c, 0x65,
0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x24, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,
0x65, 0x72, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16,
0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66,
0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08,
0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x77, 0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x63,
0x65, 0x73, 0x73, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69,
0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41,
0x4c, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f,
0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76,
0x31, 0x3b, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_payment_v1_service_proto_rawDescOnce sync.Once
file_stocklet_payment_v1_service_proto_rawDescData = file_stocklet_payment_v1_service_proto_rawDesc
)
func file_stocklet_payment_v1_service_proto_rawDescGZIP() []byte {
file_stocklet_payment_v1_service_proto_rawDescOnce.Do(func() {
file_stocklet_payment_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_payment_v1_service_proto_rawDescData)
})
return file_stocklet_payment_v1_service_proto_rawDescData
}
var file_stocklet_payment_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_stocklet_payment_v1_service_proto_goTypes = []interface{}{
(*ViewTransactionRequest)(nil), // 0: stocklet.payment.v1.ViewTransactionRequest
(*ViewTransactionResponse)(nil), // 1: stocklet.payment.v1.ViewTransactionResponse
(*ViewBalanceRequest)(nil), // 2: stocklet.payment.v1.ViewBalanceRequest
(*ViewBalanceResponse)(nil), // 3: stocklet.payment.v1.ViewBalanceResponse
(*Transaction)(nil), // 4: stocklet.payment.v1.Transaction
(*CustomerBalance)(nil), // 5: stocklet.payment.v1.CustomerBalance
(*v1.ServiceInfoRequest)(nil), // 6: stocklet.common.v1.ServiceInfoRequest
(*v11.UserCreatedEvent)(nil), // 7: stocklet.events.v1.UserCreatedEvent
(*v11.UserDeletedEvent)(nil), // 8: stocklet.events.v1.UserDeletedEvent
(*v11.ShipmentAllocationEvent)(nil), // 9: stocklet.events.v1.ShipmentAllocationEvent
(*v1.ServiceInfoResponse)(nil), // 10: stocklet.common.v1.ServiceInfoResponse
(*emptypb.Empty)(nil), // 11: google.protobuf.Empty
}
var file_stocklet_payment_v1_service_proto_depIdxs = []int32{
4, // 0: stocklet.payment.v1.ViewTransactionResponse.transaction:type_name -> stocklet.payment.v1.Transaction
5, // 1: stocklet.payment.v1.ViewBalanceResponse.balance:type_name -> stocklet.payment.v1.CustomerBalance
6, // 2: stocklet.payment.v1.PaymentService.ServiceInfo:input_type -> stocklet.common.v1.ServiceInfoRequest
0, // 3: stocklet.payment.v1.PaymentService.ViewTransaction:input_type -> stocklet.payment.v1.ViewTransactionRequest
2, // 4: stocklet.payment.v1.PaymentService.ViewBalance:input_type -> stocklet.payment.v1.ViewBalanceRequest
7, // 5: stocklet.payment.v1.PaymentService.ProcessUserCreatedEvent:input_type -> stocklet.events.v1.UserCreatedEvent
8, // 6: stocklet.payment.v1.PaymentService.ProcessUserDeletedEvent:input_type -> stocklet.events.v1.UserDeletedEvent
9, // 7: stocklet.payment.v1.PaymentService.ProcessShipmentAllocationEvent:input_type -> stocklet.events.v1.ShipmentAllocationEvent
10, // 8: stocklet.payment.v1.PaymentService.ServiceInfo:output_type -> stocklet.common.v1.ServiceInfoResponse
1, // 9: stocklet.payment.v1.PaymentService.ViewTransaction:output_type -> stocklet.payment.v1.ViewTransactionResponse
3, // 10: stocklet.payment.v1.PaymentService.ViewBalance:output_type -> stocklet.payment.v1.ViewBalanceResponse
11, // 11: stocklet.payment.v1.PaymentService.ProcessUserCreatedEvent:output_type -> google.protobuf.Empty
11, // 12: stocklet.payment.v1.PaymentService.ProcessUserDeletedEvent:output_type -> google.protobuf.Empty
11, // 13: stocklet.payment.v1.PaymentService.ProcessShipmentAllocationEvent:output_type -> google.protobuf.Empty
8, // [8:14] is the sub-list for method output_type
2, // [2:8] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_payment_v1_service_proto_init() }
func file_stocklet_payment_v1_service_proto_init() {
if File_stocklet_payment_v1_service_proto != nil {
return
}
file_stocklet_payment_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_stocklet_payment_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewTransactionRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_payment_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewTransactionResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_payment_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewBalanceRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_payment_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewBalanceResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_payment_v1_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_stocklet_payment_v1_service_proto_goTypes,
DependencyIndexes: file_stocklet_payment_v1_service_proto_depIdxs,
MessageInfos: file_stocklet_payment_v1_service_proto_msgTypes,
}.Build()
File_stocklet_payment_v1_service_proto = out.File
file_stocklet_payment_v1_service_proto_rawDesc = nil
file_stocklet_payment_v1_service_proto_goTypes = nil
file_stocklet_payment_v1_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,362 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: stocklet/payment/v1/service.proto
/*
Package payment_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package payment_v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_PaymentService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client PaymentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_PaymentService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server PaymentServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := server.ServiceInfo(ctx, &protoReq)
return msg, metadata, err
}
func request_PaymentService_ViewTransaction_0(ctx context.Context, marshaler runtime.Marshaler, client PaymentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewTransactionRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["transaction_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "transaction_id")
}
protoReq.TransactionId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "transaction_id", err)
}
msg, err := client.ViewTransaction(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_PaymentService_ViewTransaction_0(ctx context.Context, marshaler runtime.Marshaler, server PaymentServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewTransactionRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["transaction_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "transaction_id")
}
protoReq.TransactionId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "transaction_id", err)
}
msg, err := server.ViewTransaction(ctx, &protoReq)
return msg, metadata, err
}
func request_PaymentService_ViewBalance_0(ctx context.Context, marshaler runtime.Marshaler, client PaymentServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewBalanceRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["customer_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "customer_id")
}
protoReq.CustomerId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "customer_id", err)
}
msg, err := client.ViewBalance(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_PaymentService_ViewBalance_0(ctx context.Context, marshaler runtime.Marshaler, server PaymentServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewBalanceRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["customer_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "customer_id")
}
protoReq.CustomerId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "customer_id", err)
}
msg, err := server.ViewBalance(ctx, &protoReq)
return msg, metadata, err
}
// RegisterPaymentServiceHandlerServer registers the http handlers for service PaymentService to "mux".
// UnaryRPC :call PaymentServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterPaymentServiceHandlerFromEndpoint instead.
func RegisterPaymentServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server PaymentServiceServer) error {
mux.Handle("GET", pattern_PaymentService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/payment/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_PaymentService_ServiceInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_PaymentService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PaymentService_ViewTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewTransaction", runtime.WithHTTPPathPattern("/v1/payment/transaction/{transaction_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_PaymentService_ViewTransaction_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_PaymentService_ViewTransaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PaymentService_ViewBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewBalance", runtime.WithHTTPPathPattern("/v1/payment/balance/{customer_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_PaymentService_ViewBalance_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_PaymentService_ViewBalance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterPaymentServiceHandlerFromEndpoint is same as RegisterPaymentServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterPaymentServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterPaymentServiceHandler(ctx, mux, conn)
}
// RegisterPaymentServiceHandler registers the http handlers for service PaymentService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterPaymentServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterPaymentServiceHandlerClient(ctx, mux, NewPaymentServiceClient(conn))
}
// RegisterPaymentServiceHandlerClient registers the http handlers for service PaymentService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "PaymentServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "PaymentServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "PaymentServiceClient" to call the correct interceptors.
func RegisterPaymentServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client PaymentServiceClient) error {
mux.Handle("GET", pattern_PaymentService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/payment/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PaymentService_ServiceInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_PaymentService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PaymentService_ViewTransaction_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewTransaction", runtime.WithHTTPPathPattern("/v1/payment/transaction/{transaction_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PaymentService_ViewTransaction_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_PaymentService_ViewTransaction_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_PaymentService_ViewBalance_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.payment.v1.PaymentService/ViewBalance", runtime.WithHTTPPathPattern("/v1/payment/balance/{customer_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_PaymentService_ViewBalance_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_PaymentService_ViewBalance_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_PaymentService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "payment", "service"}, ""))
pattern_PaymentService_ViewTransaction_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payment", "transaction", "transaction_id"}, ""))
pattern_PaymentService_ViewBalance_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "payment", "balance", "customer_id"}, ""))
)
var (
forward_PaymentService_ServiceInfo_0 = runtime.ForwardResponseMessage
forward_PaymentService_ViewTransaction_0 = runtime.ForwardResponseMessage
forward_PaymentService_ViewBalance_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,348 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: stocklet/payment/v1/service.proto
package payment_v1
import (
context "context"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
PaymentService_ServiceInfo_FullMethodName = "/stocklet.payment.v1.PaymentService/ServiceInfo"
PaymentService_ViewTransaction_FullMethodName = "/stocklet.payment.v1.PaymentService/ViewTransaction"
PaymentService_ViewBalance_FullMethodName = "/stocklet.payment.v1.PaymentService/ViewBalance"
PaymentService_ProcessUserCreatedEvent_FullMethodName = "/stocklet.payment.v1.PaymentService/ProcessUserCreatedEvent"
PaymentService_ProcessUserDeletedEvent_FullMethodName = "/stocklet.payment.v1.PaymentService/ProcessUserDeletedEvent"
PaymentService_ProcessShipmentAllocationEvent_FullMethodName = "/stocklet.payment.v1.PaymentService/ProcessShipmentAllocationEvent"
)
// PaymentServiceClient is the client API for PaymentService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type PaymentServiceClient interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
ViewTransaction(ctx context.Context, in *ViewTransactionRequest, opts ...grpc.CallOption) (*ViewTransactionResponse, error)
ViewBalance(ctx context.Context, in *ViewBalanceRequest, opts ...grpc.CallOption) (*ViewBalanceResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessUserCreatedEvent(ctx context.Context, in *v11.UserCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessUserDeletedEvent(ctx context.Context, in *v11.UserDeletedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type paymentServiceClient struct {
cc grpc.ClientConnInterface
}
func NewPaymentServiceClient(cc grpc.ClientConnInterface) PaymentServiceClient {
return &paymentServiceClient{cc}
}
func (c *paymentServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
out := new(v1.ServiceInfoResponse)
err := c.cc.Invoke(ctx, PaymentService_ServiceInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentServiceClient) ViewTransaction(ctx context.Context, in *ViewTransactionRequest, opts ...grpc.CallOption) (*ViewTransactionResponse, error) {
out := new(ViewTransactionResponse)
err := c.cc.Invoke(ctx, PaymentService_ViewTransaction_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentServiceClient) ViewBalance(ctx context.Context, in *ViewBalanceRequest, opts ...grpc.CallOption) (*ViewBalanceResponse, error) {
out := new(ViewBalanceResponse)
err := c.cc.Invoke(ctx, PaymentService_ViewBalance_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentServiceClient) ProcessUserCreatedEvent(ctx context.Context, in *v11.UserCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, PaymentService_ProcessUserCreatedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentServiceClient) ProcessUserDeletedEvent(ctx context.Context, in *v11.UserDeletedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, PaymentService_ProcessUserDeletedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *paymentServiceClient) ProcessShipmentAllocationEvent(ctx context.Context, in *v11.ShipmentAllocationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, PaymentService_ProcessShipmentAllocationEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// PaymentServiceServer is the server API for PaymentService service.
// All implementations must embed UnimplementedPaymentServiceServer
// for forward compatibility
type PaymentServiceServer interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
ViewTransaction(context.Context, *ViewTransactionRequest) (*ViewTransactionResponse, error)
ViewBalance(context.Context, *ViewBalanceRequest) (*ViewBalanceResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessUserCreatedEvent(context.Context, *v11.UserCreatedEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error)
mustEmbedUnimplementedPaymentServiceServer()
}
// UnimplementedPaymentServiceServer must be embedded to have forward compatible implementations.
type UnimplementedPaymentServiceServer struct {
}
func (UnimplementedPaymentServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
}
func (UnimplementedPaymentServiceServer) ViewTransaction(context.Context, *ViewTransactionRequest) (*ViewTransactionResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewTransaction not implemented")
}
func (UnimplementedPaymentServiceServer) ViewBalance(context.Context, *ViewBalanceRequest) (*ViewBalanceResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewBalance not implemented")
}
func (UnimplementedPaymentServiceServer) ProcessUserCreatedEvent(context.Context, *v11.UserCreatedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessUserCreatedEvent not implemented")
}
func (UnimplementedPaymentServiceServer) ProcessUserDeletedEvent(context.Context, *v11.UserDeletedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessUserDeletedEvent not implemented")
}
func (UnimplementedPaymentServiceServer) ProcessShipmentAllocationEvent(context.Context, *v11.ShipmentAllocationEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessShipmentAllocationEvent not implemented")
}
func (UnimplementedPaymentServiceServer) mustEmbedUnimplementedPaymentServiceServer() {}
// UnsafePaymentServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PaymentServiceServer will
// result in compilation errors.
type UnsafePaymentServiceServer interface {
mustEmbedUnimplementedPaymentServiceServer()
}
func RegisterPaymentServiceServer(s grpc.ServiceRegistrar, srv PaymentServiceServer) {
s.RegisterService(&PaymentService_ServiceDesc, srv)
}
func _PaymentService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.ServiceInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PaymentServiceServer).ServiceInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PaymentService_ServiceInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PaymentServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PaymentService_ViewTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewTransactionRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PaymentServiceServer).ViewTransaction(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PaymentService_ViewTransaction_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PaymentServiceServer).ViewTransaction(ctx, req.(*ViewTransactionRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PaymentService_ViewBalance_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewBalanceRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PaymentServiceServer).ViewBalance(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PaymentService_ViewBalance_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PaymentServiceServer).ViewBalance(ctx, req.(*ViewBalanceRequest))
}
return interceptor(ctx, in, info, handler)
}
func _PaymentService_ProcessUserCreatedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.UserCreatedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PaymentServiceServer).ProcessUserCreatedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PaymentService_ProcessUserCreatedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PaymentServiceServer).ProcessUserCreatedEvent(ctx, req.(*v11.UserCreatedEvent))
}
return interceptor(ctx, in, info, handler)
}
func _PaymentService_ProcessUserDeletedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.UserDeletedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PaymentServiceServer).ProcessUserDeletedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PaymentService_ProcessUserDeletedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PaymentServiceServer).ProcessUserDeletedEvent(ctx, req.(*v11.UserDeletedEvent))
}
return interceptor(ctx, in, info, handler)
}
func _PaymentService_ProcessShipmentAllocationEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.ShipmentAllocationEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(PaymentServiceServer).ProcessShipmentAllocationEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PaymentService_ProcessShipmentAllocationEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PaymentServiceServer).ProcessShipmentAllocationEvent(ctx, req.(*v11.ShipmentAllocationEvent))
}
return interceptor(ctx, in, info, handler)
}
// PaymentService_ServiceDesc is the grpc.ServiceDesc for PaymentService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var PaymentService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stocklet.payment.v1.PaymentService",
HandlerType: (*PaymentServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ServiceInfo",
Handler: _PaymentService_ServiceInfo_Handler,
},
{
MethodName: "ViewTransaction",
Handler: _PaymentService_ViewTransaction_Handler,
},
{
MethodName: "ViewBalance",
Handler: _PaymentService_ViewBalance_Handler,
},
{
MethodName: "ProcessUserCreatedEvent",
Handler: _PaymentService_ProcessUserCreatedEvent_Handler,
},
{
MethodName: "ProcessUserDeletedEvent",
Handler: _PaymentService_ProcessUserDeletedEvent_Handler,
},
{
MethodName: "ProcessShipmentAllocationEvent",
Handler: _PaymentService_ProcessShipmentAllocationEvent_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stocklet/payment/v1/service.proto",
}

View File

@@ -0,0 +1,294 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/payment/v1/types.proto
package payment_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Transaction struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Amount float32 `protobuf:"fixed32,2,opt,name=amount,proto3" json:"amount,omitempty"`
OrderId string `protobuf:"bytes,3,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
CustomerId string `protobuf:"bytes,4,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
// Optional - If set, then the transaction has been refunded.
ReversedAt *int64 `protobuf:"varint,5,opt,name=reversed_at,json=reversedAt,proto3,oneof" json:"reversed_at,omitempty"`
ProcessedAt int64 `protobuf:"varint,6,opt,name=processed_at,json=processedAt,proto3" json:"processed_at,omitempty"`
}
func (x *Transaction) Reset() {
*x = Transaction{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_payment_v1_types_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Transaction) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Transaction) ProtoMessage() {}
func (x *Transaction) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_payment_v1_types_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Transaction.ProtoReflect.Descriptor instead.
func (*Transaction) Descriptor() ([]byte, []int) {
return file_stocklet_payment_v1_types_proto_rawDescGZIP(), []int{0}
}
func (x *Transaction) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Transaction) GetAmount() float32 {
if x != nil {
return x.Amount
}
return 0
}
func (x *Transaction) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *Transaction) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *Transaction) GetReversedAt() int64 {
if x != nil && x.ReversedAt != nil {
return *x.ReversedAt
}
return 0
}
func (x *Transaction) GetProcessedAt() int64 {
if x != nil {
return x.ProcessedAt
}
return 0
}
type CustomerBalance struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
CustomerId string `protobuf:"bytes,1,opt,name=customer_id,json=customerId,proto3" json:"customer_id,omitempty"`
Balance float32 `protobuf:"fixed32,2,opt,name=balance,proto3" json:"balance,omitempty"`
}
func (x *CustomerBalance) Reset() {
*x = CustomerBalance{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_payment_v1_types_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *CustomerBalance) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*CustomerBalance) ProtoMessage() {}
func (x *CustomerBalance) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_payment_v1_types_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use CustomerBalance.ProtoReflect.Descriptor instead.
func (*CustomerBalance) Descriptor() ([]byte, []int) {
return file_stocklet_payment_v1_types_proto_rawDescGZIP(), []int{1}
}
func (x *CustomerBalance) GetCustomerId() string {
if x != nil {
return x.CustomerId
}
return ""
}
func (x *CustomerBalance) GetBalance() float32 {
if x != nil {
return x.Balance
}
return 0
}
var File_stocklet_payment_v1_types_proto protoreflect.FileDescriptor
var file_stocklet_payment_v1_types_proto_rawDesc = []byte{
0x0a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65,
0x6e, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x13, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x61, 0x79, 0x6d,
0x65, 0x6e, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0xf1, 0x01, 0x0a, 0x0b, 0x54, 0x72, 0x61, 0x6e, 0x73, 0x61, 0x63, 0x74,
0x69, 0x6f, 0x6e, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x06,
0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x42, 0x0a, 0xba, 0x48,
0x07, 0x0a, 0x05, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x52, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
0x12, 0x22, 0x0a, 0x08, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64,
0x65, 0x72, 0x49, 0x64, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72,
0x5f, 0x69, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02,
0x10, 0x01, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x49, 0x64, 0x12, 0x24,
0x0a, 0x0b, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x0a, 0x72, 0x65, 0x76, 0x65, 0x72, 0x73, 0x65, 0x64, 0x41,
0x74, 0x88, 0x01, 0x01, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65,
0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x70, 0x72, 0x6f, 0x63,
0x65, 0x73, 0x73, 0x65, 0x64, 0x41, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x72, 0x65, 0x76, 0x65,
0x72, 0x73, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x22, 0x61, 0x0a, 0x0f, 0x43, 0x75, 0x73, 0x74, 0x6f,
0x6d, 0x65, 0x72, 0x42, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x28, 0x0a, 0x0b, 0x63, 0x75,
0x73, 0x74, 0x6f, 0x6d, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,
0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x63, 0x75, 0x73, 0x74, 0x6f, 0x6d,
0x65, 0x72, 0x49, 0x64, 0x12, 0x24, 0x0a, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x18,
0x02, 0x20, 0x01, 0x28, 0x02, 0x42, 0x0a, 0xba, 0x48, 0x07, 0x0a, 0x05, 0x2d, 0x00, 0x00, 0x00,
0x00, 0x52, 0x07, 0x62, 0x61, 0x6c, 0x61, 0x6e, 0x63, 0x65, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69,
0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e,
0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e,
0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f,
0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x61, 0x79, 0x6d, 0x65,
0x6e, 0x74, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_payment_v1_types_proto_rawDescOnce sync.Once
file_stocklet_payment_v1_types_proto_rawDescData = file_stocklet_payment_v1_types_proto_rawDesc
)
func file_stocklet_payment_v1_types_proto_rawDescGZIP() []byte {
file_stocklet_payment_v1_types_proto_rawDescOnce.Do(func() {
file_stocklet_payment_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_payment_v1_types_proto_rawDescData)
})
return file_stocklet_payment_v1_types_proto_rawDescData
}
var file_stocklet_payment_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_stocklet_payment_v1_types_proto_goTypes = []interface{}{
(*Transaction)(nil), // 0: stocklet.payment.v1.Transaction
(*CustomerBalance)(nil), // 1: stocklet.payment.v1.CustomerBalance
}
var file_stocklet_payment_v1_types_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_stocklet_payment_v1_types_proto_init() }
func file_stocklet_payment_v1_types_proto_init() {
if File_stocklet_payment_v1_types_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_payment_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Transaction); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_payment_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*CustomerBalance); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_payment_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_payment_v1_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_payment_v1_types_proto_goTypes,
DependencyIndexes: file_stocklet_payment_v1_types_proto_depIdxs,
MessageInfos: file_stocklet_payment_v1_types_proto_msgTypes,
}.Build()
File_stocklet_payment_v1_types_proto = out.File
file_stocklet_payment_v1_types_proto_rawDesc = nil
file_stocklet_payment_v1_types_proto_goTypes = nil
file_stocklet_payment_v1_types_proto_depIdxs = nil
}

View File

@@ -0,0 +1,413 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/product/v1/service.proto
package product_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/googleapis/api/visibility"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ViewProductRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *ViewProductRequest) Reset() {
*x = ViewProductRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_product_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewProductRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewProductRequest) ProtoMessage() {}
func (x *ViewProductRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_product_v1_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewProductRequest.ProtoReflect.Descriptor instead.
func (*ViewProductRequest) Descriptor() ([]byte, []int) {
return file_stocklet_product_v1_service_proto_rawDescGZIP(), []int{0}
}
func (x *ViewProductRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type ViewProductResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Product *Product `protobuf:"bytes,1,opt,name=product,proto3" json:"product,omitempty"`
}
func (x *ViewProductResponse) Reset() {
*x = ViewProductResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_product_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewProductResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewProductResponse) ProtoMessage() {}
func (x *ViewProductResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_product_v1_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewProductResponse.ProtoReflect.Descriptor instead.
func (*ViewProductResponse) Descriptor() ([]byte, []int) {
return file_stocklet_product_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *ViewProductResponse) GetProduct() *Product {
if x != nil {
return x.Product
}
return nil
}
type ViewProductsRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *ViewProductsRequest) Reset() {
*x = ViewProductsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_product_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewProductsRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewProductsRequest) ProtoMessage() {}
func (x *ViewProductsRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_product_v1_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewProductsRequest.ProtoReflect.Descriptor instead.
func (*ViewProductsRequest) Descriptor() ([]byte, []int) {
return file_stocklet_product_v1_service_proto_rawDescGZIP(), []int{2}
}
type ViewProductsResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Products []*Product `protobuf:"bytes,1,rep,name=products,proto3" json:"products,omitempty"`
}
func (x *ViewProductsResponse) Reset() {
*x = ViewProductsResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_product_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewProductsResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewProductsResponse) ProtoMessage() {}
func (x *ViewProductsResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_product_v1_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewProductsResponse.ProtoReflect.Descriptor instead.
func (*ViewProductsResponse) Descriptor() ([]byte, []int) {
return file_stocklet_product_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *ViewProductsResponse) GetProducts() []*Product {
if x != nil {
return x.Products
}
return nil
}
var File_stocklet_product_v1_service_proto protoreflect.FileDescriptor
var file_stocklet_product_v1_service_proto_rawDesc = []byte{
0x0a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x12, 0x13, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f,
0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f, 0x76,
0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x1a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x22, 0x2d, 0x0a, 0x12, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64,
0x22, 0x4d, 0x0a, 0x13, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x36, 0x0a, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x07, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x22,
0x15, 0x0a, 0x13, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x50, 0x0a, 0x14, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x38,
0x0a, 0x08, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
0x32, 0x1c, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64,
0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x08,
0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x32, 0xf5, 0x03, 0x0a, 0x0e, 0x50, 0x72, 0x6f,
0x64, 0x75, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0b, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x15, 0x12, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7a, 0x0a, 0x0b, 0x56, 0x69, 0x65, 0x77,
0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69,
0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x1a, 0x28, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64,
0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93,
0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2f,
0x7b, 0x69, 0x64, 0x7d, 0x12, 0x7d, 0x0a, 0x0c, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64,
0x75, 0x63, 0x74, 0x73, 0x12, 0x28, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50,
0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x29,
0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
0x74, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4, 0x93, 0x02,
0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2f, 0x6c,
0x69, 0x73, 0x74, 0x12, 0x6b, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x4f, 0x72,
0x64, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12,
0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74,
0x73, 0x2e, 0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10,
0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c,
0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68,
0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f,
0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2f, 0x76, 0x31,
0x3b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_stocklet_product_v1_service_proto_rawDescOnce sync.Once
file_stocklet_product_v1_service_proto_rawDescData = file_stocklet_product_v1_service_proto_rawDesc
)
func file_stocklet_product_v1_service_proto_rawDescGZIP() []byte {
file_stocklet_product_v1_service_proto_rawDescOnce.Do(func() {
file_stocklet_product_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_product_v1_service_proto_rawDescData)
})
return file_stocklet_product_v1_service_proto_rawDescData
}
var file_stocklet_product_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_stocklet_product_v1_service_proto_goTypes = []interface{}{
(*ViewProductRequest)(nil), // 0: stocklet.product.v1.ViewProductRequest
(*ViewProductResponse)(nil), // 1: stocklet.product.v1.ViewProductResponse
(*ViewProductsRequest)(nil), // 2: stocklet.product.v1.ViewProductsRequest
(*ViewProductsResponse)(nil), // 3: stocklet.product.v1.ViewProductsResponse
(*Product)(nil), // 4: stocklet.product.v1.Product
(*v1.ServiceInfoRequest)(nil), // 5: stocklet.common.v1.ServiceInfoRequest
(*v11.OrderCreatedEvent)(nil), // 6: stocklet.events.v1.OrderCreatedEvent
(*v1.ServiceInfoResponse)(nil), // 7: stocklet.common.v1.ServiceInfoResponse
(*emptypb.Empty)(nil), // 8: google.protobuf.Empty
}
var file_stocklet_product_v1_service_proto_depIdxs = []int32{
4, // 0: stocklet.product.v1.ViewProductResponse.product:type_name -> stocklet.product.v1.Product
4, // 1: stocklet.product.v1.ViewProductsResponse.products:type_name -> stocklet.product.v1.Product
5, // 2: stocklet.product.v1.ProductService.ServiceInfo:input_type -> stocklet.common.v1.ServiceInfoRequest
0, // 3: stocklet.product.v1.ProductService.ViewProduct:input_type -> stocklet.product.v1.ViewProductRequest
2, // 4: stocklet.product.v1.ProductService.ViewProducts:input_type -> stocklet.product.v1.ViewProductsRequest
6, // 5: stocklet.product.v1.ProductService.ProcessOrderCreatedEvent:input_type -> stocklet.events.v1.OrderCreatedEvent
7, // 6: stocklet.product.v1.ProductService.ServiceInfo:output_type -> stocklet.common.v1.ServiceInfoResponse
1, // 7: stocklet.product.v1.ProductService.ViewProduct:output_type -> stocklet.product.v1.ViewProductResponse
3, // 8: stocklet.product.v1.ProductService.ViewProducts:output_type -> stocklet.product.v1.ViewProductsResponse
8, // 9: stocklet.product.v1.ProductService.ProcessOrderCreatedEvent:output_type -> google.protobuf.Empty
6, // [6:10] is the sub-list for method output_type
2, // [2:6] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_product_v1_service_proto_init() }
func file_stocklet_product_v1_service_proto_init() {
if File_stocklet_product_v1_service_proto != nil {
return
}
file_stocklet_product_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_stocklet_product_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewProductRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_product_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewProductResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_product_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewProductsRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_product_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewProductsResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_product_v1_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_stocklet_product_v1_service_proto_goTypes,
DependencyIndexes: file_stocklet_product_v1_service_proto_depIdxs,
MessageInfos: file_stocklet_product_v1_service_proto_msgTypes,
}.Build()
File_stocklet_product_v1_service_proto = out.File
file_stocklet_product_v1_service_proto_rawDesc = nil
file_stocklet_product_v1_service_proto_goTypes = nil
file_stocklet_product_v1_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,328 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: stocklet/product/v1/service.proto
/*
Package product_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package product_v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_ProductService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ProductServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ProductService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ProductServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := server.ServiceInfo(ctx, &protoReq)
return msg, metadata, err
}
func request_ProductService_ViewProduct_0(ctx context.Context, marshaler runtime.Marshaler, client ProductServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewProductRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.ViewProduct(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ProductService_ViewProduct_0(ctx context.Context, marshaler runtime.Marshaler, server ProductServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewProductRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := server.ViewProduct(ctx, &protoReq)
return msg, metadata, err
}
func request_ProductService_ViewProducts_0(ctx context.Context, marshaler runtime.Marshaler, client ProductServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewProductsRequest
var metadata runtime.ServerMetadata
msg, err := client.ViewProducts(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ProductService_ViewProducts_0(ctx context.Context, marshaler runtime.Marshaler, server ProductServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewProductsRequest
var metadata runtime.ServerMetadata
msg, err := server.ViewProducts(ctx, &protoReq)
return msg, metadata, err
}
// RegisterProductServiceHandlerServer registers the http handlers for service ProductService to "mux".
// UnaryRPC :call ProductServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterProductServiceHandlerFromEndpoint instead.
func RegisterProductServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ProductServiceServer) error {
mux.Handle("GET", pattern_ProductService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/product/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ProductService_ServiceInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ProductService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ProductService_ViewProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProduct", runtime.WithHTTPPathPattern("/v1/product/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ProductService_ViewProduct_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ProductService_ViewProduct_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ProductService_ViewProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProducts", runtime.WithHTTPPathPattern("/v1/product/list"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ProductService_ViewProducts_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ProductService_ViewProducts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterProductServiceHandlerFromEndpoint is same as RegisterProductServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterProductServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterProductServiceHandler(ctx, mux, conn)
}
// RegisterProductServiceHandler registers the http handlers for service ProductService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterProductServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterProductServiceHandlerClient(ctx, mux, NewProductServiceClient(conn))
}
// RegisterProductServiceHandlerClient registers the http handlers for service ProductService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ProductServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ProductServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ProductServiceClient" to call the correct interceptors.
func RegisterProductServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ProductServiceClient) error {
mux.Handle("GET", pattern_ProductService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/product/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ProductService_ServiceInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ProductService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ProductService_ViewProduct_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProduct", runtime.WithHTTPPathPattern("/v1/product/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ProductService_ViewProduct_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ProductService_ViewProduct_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ProductService_ViewProducts_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.product.v1.ProductService/ViewProducts", runtime.WithHTTPPathPattern("/v1/product/list"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ProductService_ViewProducts_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ProductService_ViewProducts_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ProductService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "product", "service"}, ""))
pattern_ProductService_ViewProduct_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 1, 5, 2}, []string{"v1", "product", "id"}, ""))
pattern_ProductService_ViewProducts_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "product", "list"}, ""))
)
var (
forward_ProductService_ServiceInfo_0 = runtime.ForwardResponseMessage
forward_ProductService_ViewProduct_0 = runtime.ForwardResponseMessage
forward_ProductService_ViewProducts_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,254 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: stocklet/product/v1/service.proto
package product_v1
import (
context "context"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
ProductService_ServiceInfo_FullMethodName = "/stocklet.product.v1.ProductService/ServiceInfo"
ProductService_ViewProduct_FullMethodName = "/stocklet.product.v1.ProductService/ViewProduct"
ProductService_ViewProducts_FullMethodName = "/stocklet.product.v1.ProductService/ViewProducts"
ProductService_ProcessOrderCreatedEvent_FullMethodName = "/stocklet.product.v1.ProductService/ProcessOrderCreatedEvent"
)
// ProductServiceClient is the client API for ProductService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ProductServiceClient interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
ViewProduct(ctx context.Context, in *ViewProductRequest, opts ...grpc.CallOption) (*ViewProductResponse, error)
ViewProducts(ctx context.Context, in *ViewProductsRequest, opts ...grpc.CallOption) (*ViewProductsResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessOrderCreatedEvent(ctx context.Context, in *v11.OrderCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type productServiceClient struct {
cc grpc.ClientConnInterface
}
func NewProductServiceClient(cc grpc.ClientConnInterface) ProductServiceClient {
return &productServiceClient{cc}
}
func (c *productServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
out := new(v1.ServiceInfoResponse)
err := c.cc.Invoke(ctx, ProductService_ServiceInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productServiceClient) ViewProduct(ctx context.Context, in *ViewProductRequest, opts ...grpc.CallOption) (*ViewProductResponse, error) {
out := new(ViewProductResponse)
err := c.cc.Invoke(ctx, ProductService_ViewProduct_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productServiceClient) ViewProducts(ctx context.Context, in *ViewProductsRequest, opts ...grpc.CallOption) (*ViewProductsResponse, error) {
out := new(ViewProductsResponse)
err := c.cc.Invoke(ctx, ProductService_ViewProducts_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *productServiceClient) ProcessOrderCreatedEvent(ctx context.Context, in *v11.OrderCreatedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, ProductService_ProcessOrderCreatedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ProductServiceServer is the server API for ProductService service.
// All implementations must embed UnimplementedProductServiceServer
// for forward compatibility
type ProductServiceServer interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
ViewProduct(context.Context, *ViewProductRequest) (*ViewProductResponse, error)
ViewProducts(context.Context, *ViewProductsRequest) (*ViewProductsResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessOrderCreatedEvent(context.Context, *v11.OrderCreatedEvent) (*emptypb.Empty, error)
mustEmbedUnimplementedProductServiceServer()
}
// UnimplementedProductServiceServer must be embedded to have forward compatible implementations.
type UnimplementedProductServiceServer struct {
}
func (UnimplementedProductServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
}
func (UnimplementedProductServiceServer) ViewProduct(context.Context, *ViewProductRequest) (*ViewProductResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewProduct not implemented")
}
func (UnimplementedProductServiceServer) ViewProducts(context.Context, *ViewProductsRequest) (*ViewProductsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewProducts not implemented")
}
func (UnimplementedProductServiceServer) ProcessOrderCreatedEvent(context.Context, *v11.OrderCreatedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessOrderCreatedEvent not implemented")
}
func (UnimplementedProductServiceServer) mustEmbedUnimplementedProductServiceServer() {}
// UnsafeProductServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ProductServiceServer will
// result in compilation errors.
type UnsafeProductServiceServer interface {
mustEmbedUnimplementedProductServiceServer()
}
func RegisterProductServiceServer(s grpc.ServiceRegistrar, srv ProductServiceServer) {
s.RegisterService(&ProductService_ServiceDesc, srv)
}
func _ProductService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.ServiceInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServiceServer).ServiceInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ProductService_ServiceInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ProductService_ViewProduct_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewProductRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServiceServer).ViewProduct(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ProductService_ViewProduct_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServiceServer).ViewProduct(ctx, req.(*ViewProductRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ProductService_ViewProducts_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewProductsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServiceServer).ViewProducts(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ProductService_ViewProducts_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServiceServer).ViewProducts(ctx, req.(*ViewProductsRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ProductService_ProcessOrderCreatedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.OrderCreatedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ProductServiceServer).ProcessOrderCreatedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ProductService_ProcessOrderCreatedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ProductServiceServer).ProcessOrderCreatedEvent(ctx, req.(*v11.OrderCreatedEvent))
}
return interceptor(ctx, in, info, handler)
}
// ProductService_ServiceDesc is the grpc.ServiceDesc for ProductService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ProductService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stocklet.product.v1.ProductService",
HandlerType: (*ProductServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ServiceInfo",
Handler: _ProductService_ServiceInfo_Handler,
},
{
MethodName: "ViewProduct",
Handler: _ProductService_ViewProduct_Handler,
},
{
MethodName: "ViewProducts",
Handler: _ProductService_ViewProducts_Handler,
},
{
MethodName: "ProcessOrderCreatedEvent",
Handler: _ProductService_ProcessOrderCreatedEvent_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stocklet/product/v1/service.proto",
}

View File

@@ -0,0 +1,218 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/product/v1/types.proto
package product_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Product struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"`
Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
Price float32 `protobuf:"fixed32,4,opt,name=price,proto3" json:"price,omitempty"`
CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"`
}
func (x *Product) Reset() {
*x = Product{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_product_v1_types_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Product) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Product) ProtoMessage() {}
func (x *Product) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_product_v1_types_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Product.ProtoReflect.Descriptor instead.
func (*Product) Descriptor() ([]byte, []int) {
return file_stocklet_product_v1_types_proto_rawDescGZIP(), []int{0}
}
func (x *Product) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Product) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *Product) GetDescription() string {
if x != nil {
return x.Description
}
return ""
}
func (x *Product) GetPrice() float32 {
if x != nil {
return x.Price
}
return 0
}
func (x *Product) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *Product) GetUpdatedAt() int64 {
if x != nil && x.UpdatedAt != nil {
return *x.UpdatedAt
}
return 0
}
var File_stocklet_product_v1_types_proto protoreflect.FileDescriptor
var file_stocklet_product_v1_types_proto_rawDesc = []byte{
0x0a, 0x1f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x13, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x64,
0x75, 0x63, 0x74, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69,
0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x22, 0xde, 0x01, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x12,
0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04,
0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x1b, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52,
0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x29, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70,
0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72,
0x02, 0x10, 0x01, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x12, 0x20, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x02, 0x42,
0x0a, 0xba, 0x48, 0x07, 0x0a, 0x05, 0x2d, 0x00, 0x00, 0x00, 0x00, 0x52, 0x05, 0x70, 0x72, 0x69,
0x63, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74,
0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41,
0x74, 0x12, 0x22, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18,
0x06, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64,
0x41, 0x74, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,
0x64, 0x5f, 0x61, 0x74, 0x42, 0x49, 0x5a, 0x47, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63,
0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67,
0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63,
0x74, 0x2f, 0x76, 0x31, 0x3b, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x76, 0x31, 0x62,
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_product_v1_types_proto_rawDescOnce sync.Once
file_stocklet_product_v1_types_proto_rawDescData = file_stocklet_product_v1_types_proto_rawDesc
)
func file_stocklet_product_v1_types_proto_rawDescGZIP() []byte {
file_stocklet_product_v1_types_proto_rawDescOnce.Do(func() {
file_stocklet_product_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_product_v1_types_proto_rawDescData)
})
return file_stocklet_product_v1_types_proto_rawDescData
}
var file_stocklet_product_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_stocklet_product_v1_types_proto_goTypes = []interface{}{
(*Product)(nil), // 0: stocklet.product.v1.Product
}
var file_stocklet_product_v1_types_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_stocklet_product_v1_types_proto_init() }
func file_stocklet_product_v1_types_proto_init() {
if File_stocklet_product_v1_types_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_product_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Product); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_product_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_product_v1_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_product_v1_types_proto_goTypes,
DependencyIndexes: file_stocklet_product_v1_types_proto_depIdxs,
MessageInfos: file_stocklet_product_v1_types_proto_msgTypes,
}.Build()
File_stocklet_product_v1_types_proto = out.File
file_stocklet_product_v1_types_proto_rawDesc = nil
file_stocklet_product_v1_types_proto_goTypes = nil
file_stocklet_product_v1_types_proto_depIdxs = nil
}

View File

@@ -0,0 +1,447 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/shipping/v1/service.proto
package shipping_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/googleapis/api/visibility"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ViewShipmentRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"`
}
func (x *ViewShipmentRequest) Reset() {
*x = ViewShipmentRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_shipping_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewShipmentRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewShipmentRequest) ProtoMessage() {}
func (x *ViewShipmentRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_shipping_v1_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewShipmentRequest.ProtoReflect.Descriptor instead.
func (*ViewShipmentRequest) Descriptor() ([]byte, []int) {
return file_stocklet_shipping_v1_service_proto_rawDescGZIP(), []int{0}
}
func (x *ViewShipmentRequest) GetShipmentId() string {
if x != nil {
return x.ShipmentId
}
return ""
}
type ViewShipmentResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Shipment *Shipment `protobuf:"bytes,1,opt,name=shipment,proto3" json:"shipment,omitempty"`
}
func (x *ViewShipmentResponse) Reset() {
*x = ViewShipmentResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_shipping_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewShipmentResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewShipmentResponse) ProtoMessage() {}
func (x *ViewShipmentResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_shipping_v1_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewShipmentResponse.ProtoReflect.Descriptor instead.
func (*ViewShipmentResponse) Descriptor() ([]byte, []int) {
return file_stocklet_shipping_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *ViewShipmentResponse) GetShipment() *Shipment {
if x != nil {
return x.Shipment
}
return nil
}
type ViewShipmentManifestRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"`
}
func (x *ViewShipmentManifestRequest) Reset() {
*x = ViewShipmentManifestRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_shipping_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewShipmentManifestRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewShipmentManifestRequest) ProtoMessage() {}
func (x *ViewShipmentManifestRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_shipping_v1_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewShipmentManifestRequest.ProtoReflect.Descriptor instead.
func (*ViewShipmentManifestRequest) Descriptor() ([]byte, []int) {
return file_stocklet_shipping_v1_service_proto_rawDescGZIP(), []int{2}
}
func (x *ViewShipmentManifestRequest) GetShipmentId() string {
if x != nil {
return x.ShipmentId
}
return ""
}
type ViewShipmentManifestResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Manifest []*ShipmentItem `protobuf:"bytes,1,rep,name=manifest,proto3" json:"manifest,omitempty"`
}
func (x *ViewShipmentManifestResponse) Reset() {
*x = ViewShipmentManifestResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_shipping_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewShipmentManifestResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewShipmentManifestResponse) ProtoMessage() {}
func (x *ViewShipmentManifestResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_shipping_v1_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewShipmentManifestResponse.ProtoReflect.Descriptor instead.
func (*ViewShipmentManifestResponse) Descriptor() ([]byte, []int) {
return file_stocklet_shipping_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *ViewShipmentManifestResponse) GetManifest() []*ShipmentItem {
if x != nil {
return x.Manifest
}
return nil
}
var File_stocklet_shipping_v1_service_proto protoreflect.FileDescriptor
var file_stocklet_shipping_v1_service_proto_rawDesc = []byte{
0x0a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70,
0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x12, 0x14, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73,
0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f,
0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74,
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70,
0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e,
0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65, 0x76, 0x65,
0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x22, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75,
0x73, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x74,
0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3f, 0x0a, 0x13, 0x56, 0x69,
0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x28, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52,
0x0a, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x52, 0x0a, 0x14, 0x56,
0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x6e, 0x73, 0x65, 0x12, 0x3a, 0x0a, 0x08, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x18,
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69,
0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x08, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x22,
0x47, 0x0a, 0x1b, 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4d,
0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x28,
0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20,
0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x0a, 0x73, 0x68,
0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x22, 0x5e, 0x0a, 0x1c, 0x56, 0x69, 0x65, 0x77,
0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x3e, 0x0a, 0x08, 0x6d, 0x61, 0x6e, 0x69,
0x66, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76,
0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x08,
0x6d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x32, 0xc4, 0x05, 0x0a, 0x0f, 0x53, 0x68, 0x69,
0x70, 0x70, 0x69, 0x6e, 0x67, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7c, 0x0a, 0x0b,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31,
0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63,
0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1c, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x16, 0x12, 0x14, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69,
0x6e, 0x67, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x92, 0x01, 0x0a, 0x0c, 0x56,
0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e,
0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2a, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69,
0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
0x73, 0x65, 0x22, 0x2b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x25, 0x12, 0x23, 0x2f, 0x76, 0x31, 0x2f,
0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e,
0x74, 0x2f, 0x7b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12,
0xb3, 0x01, 0x0a, 0x14, 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74,
0x4d, 0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x31, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x2e,
0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4d, 0x61, 0x6e, 0x69,
0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x32, 0x2e, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e,
0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x4d,
0x61, 0x6e, 0x69, 0x66, 0x65, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x34, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x2e, 0x12, 0x2c, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69,
0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x2f, 0x7b,
0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x2f, 0x6d, 0x61, 0x6e,
0x69, 0x66, 0x65, 0x73, 0x74, 0x12, 0x73, 0x0a, 0x1c, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73,
0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x6f, 0x63, 0x6b,
0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74,
0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a,
0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a, 0x1c, 0x50, 0x72,
0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63,
0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e,
0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64,
0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa,
0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42,
0x4b, 0x5a, 0x49, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65,
0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69,
0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31,
0x3b, 0x73, 0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_shipping_v1_service_proto_rawDescOnce sync.Once
file_stocklet_shipping_v1_service_proto_rawDescData = file_stocklet_shipping_v1_service_proto_rawDesc
)
func file_stocklet_shipping_v1_service_proto_rawDescGZIP() []byte {
file_stocklet_shipping_v1_service_proto_rawDescOnce.Do(func() {
file_stocklet_shipping_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_shipping_v1_service_proto_rawDescData)
})
return file_stocklet_shipping_v1_service_proto_rawDescData
}
var file_stocklet_shipping_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_stocklet_shipping_v1_service_proto_goTypes = []interface{}{
(*ViewShipmentRequest)(nil), // 0: stocklet.shipping.v1.ViewShipmentRequest
(*ViewShipmentResponse)(nil), // 1: stocklet.shipping.v1.ViewShipmentResponse
(*ViewShipmentManifestRequest)(nil), // 2: stocklet.shipping.v1.ViewShipmentManifestRequest
(*ViewShipmentManifestResponse)(nil), // 3: stocklet.shipping.v1.ViewShipmentManifestResponse
(*Shipment)(nil), // 4: stocklet.shipping.v1.Shipment
(*ShipmentItem)(nil), // 5: stocklet.shipping.v1.ShipmentItem
(*v1.ServiceInfoRequest)(nil), // 6: stocklet.common.v1.ServiceInfoRequest
(*v11.StockReservationEvent)(nil), // 7: stocklet.events.v1.StockReservationEvent
(*v11.PaymentProcessedEvent)(nil), // 8: stocklet.events.v1.PaymentProcessedEvent
(*v1.ServiceInfoResponse)(nil), // 9: stocklet.common.v1.ServiceInfoResponse
(*emptypb.Empty)(nil), // 10: google.protobuf.Empty
}
var file_stocklet_shipping_v1_service_proto_depIdxs = []int32{
4, // 0: stocklet.shipping.v1.ViewShipmentResponse.shipment:type_name -> stocklet.shipping.v1.Shipment
5, // 1: stocklet.shipping.v1.ViewShipmentManifestResponse.manifest:type_name -> stocklet.shipping.v1.ShipmentItem
6, // 2: stocklet.shipping.v1.ShippingService.ServiceInfo:input_type -> stocklet.common.v1.ServiceInfoRequest
0, // 3: stocklet.shipping.v1.ShippingService.ViewShipment:input_type -> stocklet.shipping.v1.ViewShipmentRequest
2, // 4: stocklet.shipping.v1.ShippingService.ViewShipmentManifest:input_type -> stocklet.shipping.v1.ViewShipmentManifestRequest
7, // 5: stocklet.shipping.v1.ShippingService.ProcessStockReservationEvent:input_type -> stocklet.events.v1.StockReservationEvent
8, // 6: stocklet.shipping.v1.ShippingService.ProcessPaymentProcessedEvent:input_type -> stocklet.events.v1.PaymentProcessedEvent
9, // 7: stocklet.shipping.v1.ShippingService.ServiceInfo:output_type -> stocklet.common.v1.ServiceInfoResponse
1, // 8: stocklet.shipping.v1.ShippingService.ViewShipment:output_type -> stocklet.shipping.v1.ViewShipmentResponse
3, // 9: stocklet.shipping.v1.ShippingService.ViewShipmentManifest:output_type -> stocklet.shipping.v1.ViewShipmentManifestResponse
10, // 10: stocklet.shipping.v1.ShippingService.ProcessStockReservationEvent:output_type -> google.protobuf.Empty
10, // 11: stocklet.shipping.v1.ShippingService.ProcessPaymentProcessedEvent:output_type -> google.protobuf.Empty
7, // [7:12] is the sub-list for method output_type
2, // [2:7] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_shipping_v1_service_proto_init() }
func file_stocklet_shipping_v1_service_proto_init() {
if File_stocklet_shipping_v1_service_proto != nil {
return
}
file_stocklet_shipping_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_stocklet_shipping_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewShipmentRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_shipping_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewShipmentResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_shipping_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewShipmentManifestRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_shipping_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewShipmentManifestResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_shipping_v1_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_stocklet_shipping_v1_service_proto_goTypes,
DependencyIndexes: file_stocklet_shipping_v1_service_proto_depIdxs,
MessageInfos: file_stocklet_shipping_v1_service_proto_msgTypes,
}.Build()
File_stocklet_shipping_v1_service_proto = out.File
file_stocklet_shipping_v1_service_proto_rawDesc = nil
file_stocklet_shipping_v1_service_proto_goTypes = nil
file_stocklet_shipping_v1_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,362 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: stocklet/shipping/v1/service.proto
/*
Package shipping_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package shipping_v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_ShippingService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client ShippingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ShippingService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server ShippingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := server.ServiceInfo(ctx, &protoReq)
return msg, metadata, err
}
func request_ShippingService_ViewShipment_0(ctx context.Context, marshaler runtime.Marshaler, client ShippingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewShipmentRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["shipment_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shipment_id")
}
protoReq.ShipmentId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shipment_id", err)
}
msg, err := client.ViewShipment(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ShippingService_ViewShipment_0(ctx context.Context, marshaler runtime.Marshaler, server ShippingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewShipmentRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["shipment_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shipment_id")
}
protoReq.ShipmentId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shipment_id", err)
}
msg, err := server.ViewShipment(ctx, &protoReq)
return msg, metadata, err
}
func request_ShippingService_ViewShipmentManifest_0(ctx context.Context, marshaler runtime.Marshaler, client ShippingServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewShipmentManifestRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["shipment_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shipment_id")
}
protoReq.ShipmentId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shipment_id", err)
}
msg, err := client.ViewShipmentManifest(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ShippingService_ViewShipmentManifest_0(ctx context.Context, marshaler runtime.Marshaler, server ShippingServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewShipmentManifestRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["shipment_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "shipment_id")
}
protoReq.ShipmentId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "shipment_id", err)
}
msg, err := server.ViewShipmentManifest(ctx, &protoReq)
return msg, metadata, err
}
// RegisterShippingServiceHandlerServer registers the http handlers for service ShippingService to "mux".
// UnaryRPC :call ShippingServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterShippingServiceHandlerFromEndpoint instead.
func RegisterShippingServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ShippingServiceServer) error {
mux.Handle("GET", pattern_ShippingService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/shipping/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ShippingService_ServiceInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ShippingService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ShippingService_ViewShipment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipment", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ShippingService_ViewShipment_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ShippingService_ViewShipment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ShippingService_ViewShipmentManifest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipmentManifest", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}/manifest"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ShippingService_ViewShipmentManifest_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ShippingService_ViewShipmentManifest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterShippingServiceHandlerFromEndpoint is same as RegisterShippingServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterShippingServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterShippingServiceHandler(ctx, mux, conn)
}
// RegisterShippingServiceHandler registers the http handlers for service ShippingService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterShippingServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterShippingServiceHandlerClient(ctx, mux, NewShippingServiceClient(conn))
}
// RegisterShippingServiceHandlerClient registers the http handlers for service ShippingService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ShippingServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ShippingServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ShippingServiceClient" to call the correct interceptors.
func RegisterShippingServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ShippingServiceClient) error {
mux.Handle("GET", pattern_ShippingService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/shipping/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ShippingService_ServiceInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ShippingService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ShippingService_ViewShipment_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipment", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ShippingService_ViewShipment_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ShippingService_ViewShipment_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_ShippingService_ViewShipmentManifest_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.shipping.v1.ShippingService/ViewShipmentManifest", runtime.WithHTTPPathPattern("/v1/shipping/shipment/{shipment_id}/manifest"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ShippingService_ViewShipmentManifest_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ShippingService_ViewShipmentManifest_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ShippingService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "shipping", "service"}, ""))
pattern_ShippingService_ViewShipment_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "shipping", "shipment", "shipment_id"}, ""))
pattern_ShippingService_ViewShipmentManifest_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3, 2, 4}, []string{"v1", "shipping", "shipment", "shipment_id", "manifest"}, ""))
)
var (
forward_ShippingService_ServiceInfo_0 = runtime.ForwardResponseMessage
forward_ShippingService_ViewShipment_0 = runtime.ForwardResponseMessage
forward_ShippingService_ViewShipmentManifest_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,301 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: stocklet/shipping/v1/service.proto
package shipping_v1
import (
context "context"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
ShippingService_ServiceInfo_FullMethodName = "/stocklet.shipping.v1.ShippingService/ServiceInfo"
ShippingService_ViewShipment_FullMethodName = "/stocklet.shipping.v1.ShippingService/ViewShipment"
ShippingService_ViewShipmentManifest_FullMethodName = "/stocklet.shipping.v1.ShippingService/ViewShipmentManifest"
ShippingService_ProcessStockReservationEvent_FullMethodName = "/stocklet.shipping.v1.ShippingService/ProcessStockReservationEvent"
ShippingService_ProcessPaymentProcessedEvent_FullMethodName = "/stocklet.shipping.v1.ShippingService/ProcessPaymentProcessedEvent"
)
// ShippingServiceClient is the client API for ShippingService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ShippingServiceClient interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
ViewShipment(ctx context.Context, in *ViewShipmentRequest, opts ...grpc.CallOption) (*ViewShipmentResponse, error)
ViewShipmentManifest(ctx context.Context, in *ViewShipmentManifestRequest, opts ...grpc.CallOption) (*ViewShipmentManifestResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessStockReservationEvent(ctx context.Context, in *v11.StockReservationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type shippingServiceClient struct {
cc grpc.ClientConnInterface
}
func NewShippingServiceClient(cc grpc.ClientConnInterface) ShippingServiceClient {
return &shippingServiceClient{cc}
}
func (c *shippingServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
out := new(v1.ServiceInfoResponse)
err := c.cc.Invoke(ctx, ShippingService_ServiceInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *shippingServiceClient) ViewShipment(ctx context.Context, in *ViewShipmentRequest, opts ...grpc.CallOption) (*ViewShipmentResponse, error) {
out := new(ViewShipmentResponse)
err := c.cc.Invoke(ctx, ShippingService_ViewShipment_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *shippingServiceClient) ViewShipmentManifest(ctx context.Context, in *ViewShipmentManifestRequest, opts ...grpc.CallOption) (*ViewShipmentManifestResponse, error) {
out := new(ViewShipmentManifestResponse)
err := c.cc.Invoke(ctx, ShippingService_ViewShipmentManifest_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *shippingServiceClient) ProcessStockReservationEvent(ctx context.Context, in *v11.StockReservationEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, ShippingService_ProcessStockReservationEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *shippingServiceClient) ProcessPaymentProcessedEvent(ctx context.Context, in *v11.PaymentProcessedEvent, opts ...grpc.CallOption) (*emptypb.Empty, error) {
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, ShippingService_ProcessPaymentProcessedEvent_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ShippingServiceServer is the server API for ShippingService service.
// All implementations must embed UnimplementedShippingServiceServer
// for forward compatibility
type ShippingServiceServer interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
ViewShipment(context.Context, *ViewShipmentRequest) (*ViewShipmentResponse, error)
ViewShipmentManifest(context.Context, *ViewShipmentManifestRequest) (*ViewShipmentManifestResponse, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessStockReservationEvent(context.Context, *v11.StockReservationEvent) (*emptypb.Empty, error)
// A consumer will call this method to process events.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
// buf:lint:ignore RPC_REQUEST_STANDARD_NAME
// buf:lint:ignore RPC_RESPONSE_STANDARD_NAME
ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error)
mustEmbedUnimplementedShippingServiceServer()
}
// UnimplementedShippingServiceServer must be embedded to have forward compatible implementations.
type UnimplementedShippingServiceServer struct {
}
func (UnimplementedShippingServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
}
func (UnimplementedShippingServiceServer) ViewShipment(context.Context, *ViewShipmentRequest) (*ViewShipmentResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewShipment not implemented")
}
func (UnimplementedShippingServiceServer) ViewShipmentManifest(context.Context, *ViewShipmentManifestRequest) (*ViewShipmentManifestResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewShipmentManifest not implemented")
}
func (UnimplementedShippingServiceServer) ProcessStockReservationEvent(context.Context, *v11.StockReservationEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessStockReservationEvent not implemented")
}
func (UnimplementedShippingServiceServer) ProcessPaymentProcessedEvent(context.Context, *v11.PaymentProcessedEvent) (*emptypb.Empty, error) {
return nil, status.Errorf(codes.Unimplemented, "method ProcessPaymentProcessedEvent not implemented")
}
func (UnimplementedShippingServiceServer) mustEmbedUnimplementedShippingServiceServer() {}
// UnsafeShippingServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ShippingServiceServer will
// result in compilation errors.
type UnsafeShippingServiceServer interface {
mustEmbedUnimplementedShippingServiceServer()
}
func RegisterShippingServiceServer(s grpc.ServiceRegistrar, srv ShippingServiceServer) {
s.RegisterService(&ShippingService_ServiceDesc, srv)
}
func _ShippingService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.ServiceInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ShippingServiceServer).ServiceInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ShippingService_ServiceInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShippingServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ShippingService_ViewShipment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewShipmentRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ShippingServiceServer).ViewShipment(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ShippingService_ViewShipment_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShippingServiceServer).ViewShipment(ctx, req.(*ViewShipmentRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ShippingService_ViewShipmentManifest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewShipmentManifestRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ShippingServiceServer).ViewShipmentManifest(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ShippingService_ViewShipmentManifest_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShippingServiceServer).ViewShipmentManifest(ctx, req.(*ViewShipmentManifestRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ShippingService_ProcessStockReservationEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.StockReservationEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ShippingServiceServer).ProcessStockReservationEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ShippingService_ProcessStockReservationEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShippingServiceServer).ProcessStockReservationEvent(ctx, req.(*v11.StockReservationEvent))
}
return interceptor(ctx, in, info, handler)
}
func _ShippingService_ProcessPaymentProcessedEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v11.PaymentProcessedEvent)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ShippingServiceServer).ProcessPaymentProcessedEvent(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ShippingService_ProcessPaymentProcessedEvent_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ShippingServiceServer).ProcessPaymentProcessedEvent(ctx, req.(*v11.PaymentProcessedEvent))
}
return interceptor(ctx, in, info, handler)
}
// ShippingService_ServiceDesc is the grpc.ServiceDesc for ShippingService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ShippingService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stocklet.shipping.v1.ShippingService",
HandlerType: (*ShippingServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ServiceInfo",
Handler: _ShippingService_ServiceInfo_Handler,
},
{
MethodName: "ViewShipment",
Handler: _ShippingService_ViewShipment_Handler,
},
{
MethodName: "ViewShipmentManifest",
Handler: _ShippingService_ViewShipmentManifest_Handler,
},
{
MethodName: "ProcessStockReservationEvent",
Handler: _ShippingService_ProcessStockReservationEvent_Handler,
},
{
MethodName: "ProcessPaymentProcessedEvent",
Handler: _ShippingService_ProcessPaymentProcessedEvent_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stocklet/shipping/v1/service.proto",
}

View File

@@ -0,0 +1,292 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/shipping/v1/types.proto
package shipping_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type Shipment struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
OrderId string `protobuf:"bytes,2,opt,name=order_id,json=orderId,proto3" json:"order_id,omitempty"`
Dispatched bool `protobuf:"varint,3,opt,name=dispatched,proto3" json:"dispatched,omitempty"`
CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"`
}
func (x *Shipment) Reset() {
*x = Shipment{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_shipping_v1_types_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *Shipment) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*Shipment) ProtoMessage() {}
func (x *Shipment) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_shipping_v1_types_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use Shipment.ProtoReflect.Descriptor instead.
func (*Shipment) Descriptor() ([]byte, []int) {
return file_stocklet_shipping_v1_types_proto_rawDescGZIP(), []int{0}
}
func (x *Shipment) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *Shipment) GetOrderId() string {
if x != nil {
return x.OrderId
}
return ""
}
func (x *Shipment) GetDispatched() bool {
if x != nil {
return x.Dispatched
}
return false
}
func (x *Shipment) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *Shipment) GetUpdatedAt() int64 {
if x != nil && x.UpdatedAt != nil {
return *x.UpdatedAt
}
return 0
}
type ShipmentItem struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ShipmentId string `protobuf:"bytes,1,opt,name=shipment_id,json=shipmentId,proto3" json:"shipment_id,omitempty"`
ProductId string `protobuf:"bytes,2,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
Quantity int32 `protobuf:"varint,3,opt,name=quantity,proto3" json:"quantity,omitempty"`
}
func (x *ShipmentItem) Reset() {
*x = ShipmentItem{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_shipping_v1_types_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ShipmentItem) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ShipmentItem) ProtoMessage() {}
func (x *ShipmentItem) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_shipping_v1_types_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ShipmentItem.ProtoReflect.Descriptor instead.
func (*ShipmentItem) Descriptor() ([]byte, []int) {
return file_stocklet_shipping_v1_types_proto_rawDescGZIP(), []int{1}
}
func (x *ShipmentItem) GetShipmentId() string {
if x != nil {
return x.ShipmentId
}
return ""
}
func (x *ShipmentItem) GetProductId() string {
if x != nil {
return x.ProductId
}
return ""
}
func (x *ShipmentItem) GetQuantity() int32 {
if x != nil {
return x.Quantity
}
return 0
}
var File_stocklet_shipping_v1_types_proto protoreflect.FileDescriptor
var file_stocklet_shipping_v1_types_proto_rawDesc = []byte{
0x0a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x73, 0x68, 0x69, 0x70, 0x70,
0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x12, 0x14, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x73, 0x68, 0x69,
0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61,
0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xb9, 0x01, 0x0a, 0x08, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65,
0x6e, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12, 0x22, 0x0a, 0x08, 0x6f,
0x72, 0x64, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba,
0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x07, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x49, 0x64, 0x12,
0x1e, 0x0a, 0x0a, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x18, 0x03, 0x20,
0x01, 0x28, 0x08, 0x52, 0x0a, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x65, 0x64, 0x12,
0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05, 0x20,
0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12, 0x22,
0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20, 0x01,
0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x88,
0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61,
0x74, 0x22, 0x85, 0x01, 0x0a, 0x0c, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x74,
0x65, 0x6d, 0x12, 0x28, 0x0a, 0x0b, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x5f, 0x69,
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01,
0x52, 0x0a, 0x73, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x0a,
0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09,
0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x49, 0x64, 0x12, 0x23, 0x0a, 0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79,
0x18, 0x03, 0x20, 0x01, 0x28, 0x05, 0x42, 0x07, 0xba, 0x48, 0x04, 0x1a, 0x02, 0x20, 0x00, 0x52,
0x08, 0x71, 0x75, 0x61, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x42, 0x4b, 0x5a, 0x49, 0x67, 0x69, 0x74,
0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61,
0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x73,
0x68, 0x69, 0x70, 0x70, 0x69, 0x6e, 0x67, 0x2f, 0x76, 0x31, 0x3b, 0x73, 0x68, 0x69, 0x70, 0x70,
0x69, 0x6e, 0x67, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_shipping_v1_types_proto_rawDescOnce sync.Once
file_stocklet_shipping_v1_types_proto_rawDescData = file_stocklet_shipping_v1_types_proto_rawDesc
)
func file_stocklet_shipping_v1_types_proto_rawDescGZIP() []byte {
file_stocklet_shipping_v1_types_proto_rawDescOnce.Do(func() {
file_stocklet_shipping_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_shipping_v1_types_proto_rawDescData)
})
return file_stocklet_shipping_v1_types_proto_rawDescData
}
var file_stocklet_shipping_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
var file_stocklet_shipping_v1_types_proto_goTypes = []interface{}{
(*Shipment)(nil), // 0: stocklet.shipping.v1.Shipment
(*ShipmentItem)(nil), // 1: stocklet.shipping.v1.ShipmentItem
}
var file_stocklet_shipping_v1_types_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_stocklet_shipping_v1_types_proto_init() }
func file_stocklet_shipping_v1_types_proto_init() {
if File_stocklet_shipping_v1_types_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_shipping_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*Shipment); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_shipping_v1_types_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ShipmentItem); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_shipping_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_shipping_v1_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 2,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_shipping_v1_types_proto_goTypes,
DependencyIndexes: file_stocklet_shipping_v1_types_proto_depIdxs,
MessageInfos: file_stocklet_shipping_v1_types_proto_msgTypes,
}.Build()
File_stocklet_shipping_v1_types_proto = out.File
file_stocklet_shipping_v1_types_proto_rawDesc = nil
file_stocklet_shipping_v1_types_proto_goTypes = nil
file_stocklet_shipping_v1_types_proto_depIdxs = nil
}

View File

@@ -0,0 +1,96 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/stocklet.proto
// buf:lint:ignore PACKAGE_VERSION_SUFFIX
package protogen
import (
_ "github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
var File_stocklet_stocklet_proto protoreflect.FileDescriptor
var file_stocklet_stocklet_proto_rawDesc = []byte{
0x0a, 0x17, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x73, 0x74, 0x6f, 0x63, 0x6b,
0x6c, 0x65, 0x74, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x63, 0x2d, 0x67, 0x65, 0x6e, 0x2d,
0x6f, 0x70, 0x65, 0x6e, 0x61, 0x70, 0x69, 0x76, 0x32, 0x2f, 0x6f, 0x70, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x42, 0xd6, 0x01, 0x92, 0x41, 0x9f, 0x01, 0x12, 0x8e, 0x01, 0x0a, 0x08, 0x53,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x22, 0x38, 0x0a, 0x11, 0x47, 0x69, 0x74, 0x48, 0x75,
0x62, 0x20, 0x52, 0x65, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x6f, 0x72, 0x79, 0x12, 0x23, 0x68, 0x74,
0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2a, 0x41, 0x0a, 0x08, 0x41, 0x47, 0x50, 0x4c, 0x2d, 0x33, 0x2e, 0x30, 0x12, 0x35, 0x68,
0x74, 0x74, 0x70, 0x73, 0x3a, 0x2f, 0x2f, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f,
0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2f, 0x62, 0x6c, 0x6f, 0x62, 0x2f, 0x6d, 0x61, 0x69, 0x6e, 0x2f, 0x4c, 0x49, 0x43,
0x45, 0x4e, 0x53, 0x45, 0x32, 0x05, 0x30, 0x2e, 0x31, 0x2e, 0x30, 0x1a, 0x09, 0x6c, 0x6f, 0x63,
0x61, 0x6c, 0x68, 0x6f, 0x73, 0x74, 0x2a, 0x01, 0x01, 0x5a, 0x31, 0x67, 0x69, 0x74, 0x68, 0x75,
0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74,
0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f,
0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var file_stocklet_stocklet_proto_goTypes = []interface{}{}
var file_stocklet_stocklet_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_stocklet_stocklet_proto_init() }
func file_stocklet_stocklet_proto_init() {
if File_stocklet_stocklet_proto != nil {
return
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_stocklet_proto_rawDesc,
NumEnums: 0,
NumMessages: 0,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_stocklet_proto_goTypes,
DependencyIndexes: file_stocklet_stocklet_proto_depIdxs,
}.Build()
File_stocklet_stocklet_proto = out.File
file_stocklet_stocklet_proto_rawDesc = nil
file_stocklet_stocklet_proto_goTypes = nil
file_stocklet_stocklet_proto_depIdxs = nil
}

View File

@@ -0,0 +1,434 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/user/v1/service.proto
package user_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ViewUserRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
}
func (x *ViewUserRequest) Reset() {
*x = ViewUserRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_user_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewUserRequest) ProtoMessage() {}
func (x *ViewUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_user_v1_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewUserRequest.ProtoReflect.Descriptor instead.
func (*ViewUserRequest) Descriptor() ([]byte, []int) {
return file_stocklet_user_v1_service_proto_rawDescGZIP(), []int{0}
}
func (x *ViewUserRequest) GetId() string {
if x != nil {
return x.Id
}
return ""
}
type ViewUserResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *ViewUserResponse) Reset() {
*x = ViewUserResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_user_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewUserResponse) ProtoMessage() {}
func (x *ViewUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_user_v1_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewUserResponse.ProtoReflect.Descriptor instead.
func (*ViewUserResponse) Descriptor() ([]byte, []int) {
return file_stocklet_user_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *ViewUserResponse) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
type RegisterUserRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
FirstName string `protobuf:"bytes,1,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
LastName string `protobuf:"bytes,2,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`
Password string `protobuf:"bytes,4,opt,name=password,proto3" json:"password,omitempty"`
}
func (x *RegisterUserRequest) Reset() {
*x = RegisterUserRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_user_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RegisterUserRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegisterUserRequest) ProtoMessage() {}
func (x *RegisterUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_user_v1_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RegisterUserRequest.ProtoReflect.Descriptor instead.
func (*RegisterUserRequest) Descriptor() ([]byte, []int) {
return file_stocklet_user_v1_service_proto_rawDescGZIP(), []int{2}
}
func (x *RegisterUserRequest) GetFirstName() string {
if x != nil {
return x.FirstName
}
return ""
}
func (x *RegisterUserRequest) GetLastName() string {
if x != nil {
return x.LastName
}
return ""
}
func (x *RegisterUserRequest) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *RegisterUserRequest) GetPassword() string {
if x != nil {
return x.Password
}
return ""
}
type RegisterUserResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
}
func (x *RegisterUserResponse) Reset() {
*x = RegisterUserResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_user_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *RegisterUserResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*RegisterUserResponse) ProtoMessage() {}
func (x *RegisterUserResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_user_v1_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use RegisterUserResponse.ProtoReflect.Descriptor instead.
func (*RegisterUserResponse) Descriptor() ([]byte, []int) {
return file_stocklet_user_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *RegisterUserResponse) GetUser() *User {
if x != nil {
return x.User
}
return nil
}
var File_stocklet_user_v1_service_proto protoreflect.FileDescriptor
var file_stocklet_user_v1_service_proto_rawDesc = []byte{
0x0a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f,
0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x12, 0x10, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e,
0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65,
0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a,
0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f,
0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67,
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f,
0x62, 0x65, 0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2f,
0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x1c, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x75, 0x73, 0x65, 0x72,
0x2f, 0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
0x2a, 0x0a, 0x0f, 0x56, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x22, 0x3e, 0x0a, 0x10, 0x56,
0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x2a, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0xb9, 0x01, 0x0a, 0x13,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d,
0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72,
0x04, 0x10, 0x01, 0x18, 0x23, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x29, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 0x20,
0x01, 0x28, 0x09, 0x42, 0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18,
0x23, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x05, 0x65,
0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x42, 0x0a, 0xe0, 0x41, 0x02, 0xba,
0x48, 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x28, 0x0a,
0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42,
0x0c, 0xe0, 0x41, 0x02, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x40, 0x52, 0x08, 0x70,
0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x22, 0x42, 0x0a, 0x14, 0x52, 0x65, 0x67, 0x69, 0x73,
0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
0x2a, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31,
0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0xf1, 0x02, 0x0a, 0x0b,
0x55, 0x73, 0x65, 0x72, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x78, 0x0a, 0x0b, 0x53,
0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e,
0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x1a, 0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49,
0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x18, 0x82, 0xd3, 0xe4,
0x93, 0x02, 0x12, 0x12, 0x10, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x73, 0x65,
0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6e, 0x0a, 0x08, 0x56, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65,
0x72, 0x12, 0x21, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65,
0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71,
0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x55, 0x73, 0x65, 0x72,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15,
0x12, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73,
0x2f, 0x7b, 0x69, 0x64, 0x7d, 0x12, 0x78, 0x0a, 0x0c, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
0x72, 0x55, 0x73, 0x65, 0x72, 0x12, 0x25, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65,
0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x26, 0x2e, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31, 0x2e,
0x52, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70,
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x22, 0x11, 0x2f, 0x76,
0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x72, 0x65, 0x67, 0x69, 0x73, 0x74, 0x65, 0x72, 0x42,
0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65,
0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69,
0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b, 0x75, 0x73, 0x65,
0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_user_v1_service_proto_rawDescOnce sync.Once
file_stocklet_user_v1_service_proto_rawDescData = file_stocklet_user_v1_service_proto_rawDesc
)
func file_stocklet_user_v1_service_proto_rawDescGZIP() []byte {
file_stocklet_user_v1_service_proto_rawDescOnce.Do(func() {
file_stocklet_user_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_user_v1_service_proto_rawDescData)
})
return file_stocklet_user_v1_service_proto_rawDescData
}
var file_stocklet_user_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_stocklet_user_v1_service_proto_goTypes = []interface{}{
(*ViewUserRequest)(nil), // 0: stocklet.user.v1.ViewUserRequest
(*ViewUserResponse)(nil), // 1: stocklet.user.v1.ViewUserResponse
(*RegisterUserRequest)(nil), // 2: stocklet.user.v1.RegisterUserRequest
(*RegisterUserResponse)(nil), // 3: stocklet.user.v1.RegisterUserResponse
(*User)(nil), // 4: stocklet.user.v1.User
(*v1.ServiceInfoRequest)(nil), // 5: stocklet.common.v1.ServiceInfoRequest
(*v1.ServiceInfoResponse)(nil), // 6: stocklet.common.v1.ServiceInfoResponse
}
var file_stocklet_user_v1_service_proto_depIdxs = []int32{
4, // 0: stocklet.user.v1.ViewUserResponse.user:type_name -> stocklet.user.v1.User
4, // 1: stocklet.user.v1.RegisterUserResponse.user:type_name -> stocklet.user.v1.User
5, // 2: stocklet.user.v1.UserService.ServiceInfo:input_type -> stocklet.common.v1.ServiceInfoRequest
0, // 3: stocklet.user.v1.UserService.ViewUser:input_type -> stocklet.user.v1.ViewUserRequest
2, // 4: stocklet.user.v1.UserService.RegisterUser:input_type -> stocklet.user.v1.RegisterUserRequest
6, // 5: stocklet.user.v1.UserService.ServiceInfo:output_type -> stocklet.common.v1.ServiceInfoResponse
1, // 6: stocklet.user.v1.UserService.ViewUser:output_type -> stocklet.user.v1.ViewUserResponse
3, // 7: stocklet.user.v1.UserService.RegisterUser:output_type -> stocklet.user.v1.RegisterUserResponse
5, // [5:8] is the sub-list for method output_type
2, // [2:5] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_user_v1_service_proto_init() }
func file_stocklet_user_v1_service_proto_init() {
if File_stocklet_user_v1_service_proto != nil {
return
}
file_stocklet_user_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_stocklet_user_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewUserRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_user_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewUserResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_user_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterUserRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_user_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*RegisterUserResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_user_v1_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_stocklet_user_v1_service_proto_goTypes,
DependencyIndexes: file_stocklet_user_v1_service_proto_depIdxs,
MessageInfos: file_stocklet_user_v1_service_proto_msgTypes,
}.Build()
File_stocklet_user_v1_service_proto = out.File
file_stocklet_user_v1_service_proto_rawDesc = nil
file_stocklet_user_v1_service_proto_goTypes = nil
file_stocklet_user_v1_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,346 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: stocklet/user/v1/service.proto
/*
Package user_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package user_v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_UserService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_UserService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := server.ServiceInfo(ctx, &protoReq)
return msg, metadata, err
}
func request_UserService_ViewUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewUserRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := client.ViewUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_UserService_ViewUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewUserRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "id")
}
protoReq.Id, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "id", err)
}
msg, err := server.ViewUser(ctx, &protoReq)
return msg, metadata, err
}
var (
filter_UserService_RegisterUser_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}
)
func request_UserService_RegisterUser_0(ctx context.Context, marshaler runtime.Marshaler, client UserServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RegisterUserRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_RegisterUser_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.RegisterUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_UserService_RegisterUser_0(ctx context.Context, marshaler runtime.Marshaler, server UserServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq RegisterUserRequest
var metadata runtime.ServerMetadata
if err := req.ParseForm(); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_UserService_RegisterUser_0); err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.RegisterUser(ctx, &protoReq)
return msg, metadata, err
}
// RegisterUserServiceHandlerServer registers the http handlers for service UserService to "mux".
// UnaryRPC :call UserServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterUserServiceHandlerFromEndpoint instead.
func RegisterUserServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server UserServiceServer) error {
mux.Handle("GET", pattern_UserService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/user/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_UserService_ServiceInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_UserService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_UserService_ViewUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/ViewUser", runtime.WithHTTPPathPattern("/v1/user/users/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_UserService_ViewUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_UserService_ViewUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_UserService_RegisterUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.user.v1.UserService/RegisterUser", runtime.WithHTTPPathPattern("/v1/user/register"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_UserService_RegisterUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_UserService_RegisterUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterUserServiceHandlerFromEndpoint is same as RegisterUserServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterUserServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterUserServiceHandler(ctx, mux, conn)
}
// RegisterUserServiceHandler registers the http handlers for service UserService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterUserServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterUserServiceHandlerClient(ctx, mux, NewUserServiceClient(conn))
}
// RegisterUserServiceHandlerClient registers the http handlers for service UserService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "UserServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "UserServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "UserServiceClient" to call the correct interceptors.
func RegisterUserServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client UserServiceClient) error {
mux.Handle("GET", pattern_UserService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/user/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_UserService_ServiceInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_UserService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_UserService_ViewUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/ViewUser", runtime.WithHTTPPathPattern("/v1/user/users/{id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_UserService_ViewUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_UserService_ViewUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_UserService_RegisterUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.user.v1.UserService/RegisterUser", runtime.WithHTTPPathPattern("/v1/user/register"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_UserService_RegisterUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_UserService_RegisterUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_UserService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "user", "service"}, ""))
pattern_UserService_ViewUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "user", "users", "id"}, ""))
pattern_UserService_RegisterUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "user", "register"}, ""))
)
var (
forward_UserService_ServiceInfo_0 = runtime.ForwardResponseMessage
forward_UserService_ViewUser_0 = runtime.ForwardResponseMessage
forward_UserService_RegisterUser_0 = runtime.ForwardResponseMessage
)

View File

@@ -0,0 +1,205 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: stocklet/user/v1/service.proto
package user_v1
import (
context "context"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
UserService_ServiceInfo_FullMethodName = "/stocklet.user.v1.UserService/ServiceInfo"
UserService_ViewUser_FullMethodName = "/stocklet.user.v1.UserService/ViewUser"
UserService_RegisterUser_FullMethodName = "/stocklet.user.v1.UserService/RegisterUser"
)
// UserServiceClient is the client API for UserService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type UserServiceClient interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error)
ViewUser(ctx context.Context, in *ViewUserRequest, opts ...grpc.CallOption) (*ViewUserResponse, error)
RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error)
}
type userServiceClient struct {
cc grpc.ClientConnInterface
}
func NewUserServiceClient(cc grpc.ClientConnInterface) UserServiceClient {
return &userServiceClient{cc}
}
func (c *userServiceClient) ServiceInfo(ctx context.Context, in *v1.ServiceInfoRequest, opts ...grpc.CallOption) (*v1.ServiceInfoResponse, error) {
out := new(v1.ServiceInfoResponse)
err := c.cc.Invoke(ctx, UserService_ServiceInfo_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) ViewUser(ctx context.Context, in *ViewUserRequest, opts ...grpc.CallOption) (*ViewUserResponse, error) {
out := new(ViewUserResponse)
err := c.cc.Invoke(ctx, UserService_ViewUser_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *userServiceClient) RegisterUser(ctx context.Context, in *RegisterUserRequest, opts ...grpc.CallOption) (*RegisterUserResponse, error) {
out := new(RegisterUserResponse)
err := c.cc.Invoke(ctx, UserService_RegisterUser_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// UserServiceServer is the server API for UserService service.
// All implementations must embed UnimplementedUserServiceServer
// for forward compatibility
type UserServiceServer interface {
// View information about the service.
//
// buf:lint:ignore RPC_REQUEST_RESPONSE_UNIQUE
ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error)
ViewUser(context.Context, *ViewUserRequest) (*ViewUserResponse, error)
RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error)
mustEmbedUnimplementedUserServiceServer()
}
// UnimplementedUserServiceServer must be embedded to have forward compatible implementations.
type UnimplementedUserServiceServer struct {
}
func (UnimplementedUserServiceServer) ServiceInfo(context.Context, *v1.ServiceInfoRequest) (*v1.ServiceInfoResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ServiceInfo not implemented")
}
func (UnimplementedUserServiceServer) ViewUser(context.Context, *ViewUserRequest) (*ViewUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ViewUser not implemented")
}
func (UnimplementedUserServiceServer) RegisterUser(context.Context, *RegisterUserRequest) (*RegisterUserResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method RegisterUser not implemented")
}
func (UnimplementedUserServiceServer) mustEmbedUnimplementedUserServiceServer() {}
// UnsafeUserServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to UserServiceServer will
// result in compilation errors.
type UnsafeUserServiceServer interface {
mustEmbedUnimplementedUserServiceServer()
}
func RegisterUserServiceServer(s grpc.ServiceRegistrar, srv UserServiceServer) {
s.RegisterService(&UserService_ServiceDesc, srv)
}
func _UserService_ServiceInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(v1.ServiceInfoRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).ServiceInfo(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_ServiceInfo_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).ServiceInfo(ctx, req.(*v1.ServiceInfoRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_ViewUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ViewUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).ViewUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_ViewUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).ViewUser(ctx, req.(*ViewUserRequest))
}
return interceptor(ctx, in, info, handler)
}
func _UserService_RegisterUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(RegisterUserRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(UserServiceServer).RegisterUser(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: UserService_RegisterUser_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(UserServiceServer).RegisterUser(ctx, req.(*RegisterUserRequest))
}
return interceptor(ctx, in, info, handler)
}
// UserService_ServiceDesc is the grpc.ServiceDesc for UserService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var UserService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "stocklet.user.v1.UserService",
HandlerType: (*UserServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "ServiceInfo",
Handler: _UserService_ServiceInfo_Handler,
},
{
MethodName: "ViewUser",
Handler: _UserService_ViewUser_Handler,
},
{
MethodName: "RegisterUser",
Handler: _UserService_RegisterUser_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "stocklet/user/v1/service.proto",
}

View File

@@ -0,0 +1,217 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/user/v1/types.proto
package user_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type User struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
Email string `protobuf:"bytes,2,opt,name=email,proto3" json:"email,omitempty"`
FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
CreatedAt int64 `protobuf:"varint,5,opt,name=created_at,json=createdAt,proto3" json:"created_at,omitempty"`
UpdatedAt *int64 `protobuf:"varint,6,opt,name=updated_at,json=updatedAt,proto3,oneof" json:"updated_at,omitempty"`
}
func (x *User) Reset() {
*x = User{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_user_v1_types_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *User) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*User) ProtoMessage() {}
func (x *User) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_user_v1_types_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use User.ProtoReflect.Descriptor instead.
func (*User) Descriptor() ([]byte, []int) {
return file_stocklet_user_v1_types_proto_rawDescGZIP(), []int{0}
}
func (x *User) GetId() string {
if x != nil {
return x.Id
}
return ""
}
func (x *User) GetEmail() string {
if x != nil {
return x.Email
}
return ""
}
func (x *User) GetFirstName() string {
if x != nil {
return x.FirstName
}
return ""
}
func (x *User) GetLastName() string {
if x != nil {
return x.LastName
}
return ""
}
func (x *User) GetCreatedAt() int64 {
if x != nil {
return x.CreatedAt
}
return 0
}
func (x *User) GetUpdatedAt() int64 {
if x != nil && x.UpdatedAt != nil {
return *x.UpdatedAt
}
return 0
}
var File_stocklet_user_v1_types_proto protoreflect.FileDescriptor
var file_stocklet_user_v1_types_proto_rawDesc = []byte{
0x0a, 0x1c, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f,
0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x10,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x76, 0x31,
0x1a, 0x1b, 0x62, 0x75, 0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76,
0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0xe2, 0x01,
0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x17, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x02, 0x69, 0x64, 0x12,
0x1d, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07,
0xba, 0x48, 0x04, 0x72, 0x02, 0x60, 0x01, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x28,
0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01,
0x28, 0x09, 0x42, 0x09, 0xba, 0x48, 0x06, 0x72, 0x04, 0x10, 0x01, 0x18, 0x23, 0x52, 0x09, 0x66,
0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x26, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74,
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x09, 0xba, 0x48, 0x06,
0x72, 0x04, 0x10, 0x01, 0x18, 0x23, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65,
0x12, 0x1d, 0x0a, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x05,
0x20, 0x01, 0x28, 0x03, 0x52, 0x09, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74, 0x12,
0x22, 0x0a, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x61, 0x74, 0x18, 0x06, 0x20,
0x01, 0x28, 0x03, 0x48, 0x00, 0x52, 0x09, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x41, 0x74,
0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x64, 0x5f,
0x61, 0x74, 0x42, 0x43, 0x5a, 0x41, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d,
0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c, 0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65,
0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65, 0x6e, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x2f, 0x76, 0x31, 0x3b,
0x75, 0x73, 0x65, 0x72, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
}
var (
file_stocklet_user_v1_types_proto_rawDescOnce sync.Once
file_stocklet_user_v1_types_proto_rawDescData = file_stocklet_user_v1_types_proto_rawDesc
)
func file_stocklet_user_v1_types_proto_rawDescGZIP() []byte {
file_stocklet_user_v1_types_proto_rawDescOnce.Do(func() {
file_stocklet_user_v1_types_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_user_v1_types_proto_rawDescData)
})
return file_stocklet_user_v1_types_proto_rawDescData
}
var file_stocklet_user_v1_types_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
var file_stocklet_user_v1_types_proto_goTypes = []interface{}{
(*User)(nil), // 0: stocklet.user.v1.User
}
var file_stocklet_user_v1_types_proto_depIdxs = []int32{
0, // [0:0] is the sub-list for method output_type
0, // [0:0] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name
0, // [0:0] is the sub-list for extension extendee
0, // [0:0] is the sub-list for field type_name
}
func init() { file_stocklet_user_v1_types_proto_init() }
func file_stocklet_user_v1_types_proto_init() {
if File_stocklet_user_v1_types_proto != nil {
return
}
if !protoimpl.UnsafeEnabled {
file_stocklet_user_v1_types_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*User); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
file_stocklet_user_v1_types_proto_msgTypes[0].OneofWrappers = []interface{}{}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_user_v1_types_proto_rawDesc,
NumEnums: 0,
NumMessages: 1,
NumExtensions: 0,
NumServices: 0,
},
GoTypes: file_stocklet_user_v1_types_proto_goTypes,
DependencyIndexes: file_stocklet_user_v1_types_proto_depIdxs,
MessageInfos: file_stocklet_user_v1_types_proto_msgTypes,
}.Build()
File_stocklet_user_v1_types_proto = out.File
file_stocklet_user_v1_types_proto_rawDesc = nil
file_stocklet_user_v1_types_proto_goTypes = nil
file_stocklet_user_v1_types_proto_depIdxs = nil
}

View File

@@ -0,0 +1,472 @@
// Copyright (C) 2024 Declan Teevan
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero 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 Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.31.0
// protoc (unknown)
// source: stocklet/warehouse/v1/service.proto
package warehouse_v1
import (
_ "buf.build/gen/go/bufbuild/protovalidate/protocolbuffers/go/buf/validate"
v1 "github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
v11 "github.com/hexolan/stocklet/internal/pkg/protogen/events/v1"
_ "google.golang.org/genproto/googleapis/api/annotations"
_ "google.golang.org/genproto/googleapis/api/visibility"
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
emptypb "google.golang.org/protobuf/types/known/emptypb"
reflect "reflect"
sync "sync"
)
const (
// Verify that this generated code is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
// Verify that runtime/protoimpl is sufficiently up-to-date.
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
type ViewProductStockRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ProductId string `protobuf:"bytes,1,opt,name=product_id,json=productId,proto3" json:"product_id,omitempty"`
}
func (x *ViewProductStockRequest) Reset() {
*x = ViewProductStockRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewProductStockRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewProductStockRequest) ProtoMessage() {}
func (x *ViewProductStockRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewProductStockRequest.ProtoReflect.Descriptor instead.
func (*ViewProductStockRequest) Descriptor() ([]byte, []int) {
return file_stocklet_warehouse_v1_service_proto_rawDescGZIP(), []int{0}
}
func (x *ViewProductStockRequest) GetProductId() string {
if x != nil {
return x.ProductId
}
return ""
}
type ViewProductStockResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Stock *ProductStock `protobuf:"bytes,1,opt,name=stock,proto3" json:"stock,omitempty"`
}
func (x *ViewProductStockResponse) Reset() {
*x = ViewProductStockResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewProductStockResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewProductStockResponse) ProtoMessage() {}
func (x *ViewProductStockResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewProductStockResponse.ProtoReflect.Descriptor instead.
func (*ViewProductStockResponse) Descriptor() ([]byte, []int) {
return file_stocklet_warehouse_v1_service_proto_rawDescGZIP(), []int{1}
}
func (x *ViewProductStockResponse) GetStock() *ProductStock {
if x != nil {
return x.Stock
}
return nil
}
type ViewReservationRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
ReservationId string `protobuf:"bytes,1,opt,name=reservation_id,json=reservationId,proto3" json:"reservation_id,omitempty"`
}
func (x *ViewReservationRequest) Reset() {
*x = ViewReservationRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewReservationRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewReservationRequest) ProtoMessage() {}
func (x *ViewReservationRequest) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewReservationRequest.ProtoReflect.Descriptor instead.
func (*ViewReservationRequest) Descriptor() ([]byte, []int) {
return file_stocklet_warehouse_v1_service_proto_rawDescGZIP(), []int{2}
}
func (x *ViewReservationRequest) GetReservationId() string {
if x != nil {
return x.ReservationId
}
return ""
}
type ViewReservationResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
Reservation *Reservation `protobuf:"bytes,1,opt,name=reservation,proto3" json:"reservation,omitempty"`
}
func (x *ViewReservationResponse) Reset() {
*x = ViewReservationResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
}
func (x *ViewReservationResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*ViewReservationResponse) ProtoMessage() {}
func (x *ViewReservationResponse) ProtoReflect() protoreflect.Message {
mi := &file_stocklet_warehouse_v1_service_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use ViewReservationResponse.ProtoReflect.Descriptor instead.
func (*ViewReservationResponse) Descriptor() ([]byte, []int) {
return file_stocklet_warehouse_v1_service_proto_rawDescGZIP(), []int{3}
}
func (x *ViewReservationResponse) GetReservation() *Reservation {
if x != nil {
return x.Reservation
}
return nil
}
var File_stocklet_warehouse_v1_service_proto protoreflect.FileDescriptor
var file_stocklet_warehouse_v1_service_proto_rawDesc = []byte{
0x0a, 0x23, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68,
0x6f, 0x75, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x15, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e,
0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x1a, 0x1b, 0x62, 0x75,
0x66, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x65, 0x2f, 0x76, 0x61, 0x6c, 0x69, 0x64,
0x61, 0x74, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1c, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x61, 0x6e, 0x6e, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,
0x61, 0x70, 0x69, 0x2f, 0x76, 0x69, 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x63, 0x6f, 0x6d, 0x6d,
0x6f, 0x6e, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x73, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x2e, 0x70,
0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x65,
0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74,
0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2f, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x76, 0x31, 0x2f, 0x73, 0x68, 0x69,
0x70, 0x70, 0x69, 0x6e, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x21, 0x73, 0x74, 0x6f,
0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2f,
0x76, 0x31, 0x2f, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x41,
0x0a, 0x17, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x74, 0x6f,
0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x0a, 0x70, 0x72, 0x6f,
0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba,
0x48, 0x04, 0x72, 0x02, 0x10, 0x01, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x49,
0x64, 0x22, 0x55, 0x0a, 0x18, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x39, 0x0a,
0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x23, 0x2e, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x63,
0x6b, 0x52, 0x05, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x22, 0x48, 0x0a, 0x16, 0x56, 0x69, 0x65, 0x77,
0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,
0x73, 0x74, 0x12, 0x2e, 0x0a, 0x0e, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f,
0x6e, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x07, 0xba, 0x48, 0x04, 0x72,
0x02, 0x10, 0x01, 0x52, 0x0d, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e,
0x49, 0x64, 0x22, 0x5f, 0x0a, 0x17, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x44, 0x0a,
0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01,
0x28, 0x0b, 0x32, 0x22, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61,
0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x65, 0x73, 0x65, 0x72,
0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74,
0x69, 0x6f, 0x6e, 0x32, 0xa6, 0x07, 0x0a, 0x10, 0x57, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73,
0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7d, 0x0a, 0x0b, 0x53, 0x65, 0x72, 0x76,
0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x26, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72,
0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x27, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x63, 0x6f, 0x6d, 0x6d, 0x6f,
0x6e, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x49, 0x6e, 0x66, 0x6f,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1d, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17,
0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2f,
0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x9f, 0x01, 0x0a, 0x10, 0x56, 0x69, 0x65, 0x77,
0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x53, 0x74, 0x6f, 0x63, 0x6b, 0x12, 0x2e, 0x2e, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2f, 0x2e, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74,
0x53, 0x74, 0x6f, 0x63, 0x6b, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x2a, 0x82,
0xd3, 0xe4, 0x93, 0x02, 0x24, 0x12, 0x22, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68,
0x6f, 0x75, 0x73, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x2f, 0x7b, 0x70, 0x72,
0x6f, 0x64, 0x75, 0x63, 0x74, 0x5f, 0x69, 0x64, 0x7d, 0x12, 0xa4, 0x01, 0x0a, 0x0f, 0x56, 0x69,
0x65, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x2d, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75,
0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76,
0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x2e, 0x2e, 0x73,
0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73,
0x65, 0x2e, 0x76, 0x31, 0x2e, 0x56, 0x69, 0x65, 0x77, 0x52, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61,
0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x32, 0x82, 0xd3,
0xe4, 0x93, 0x02, 0x2c, 0x12, 0x2a, 0x2f, 0x76, 0x31, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f,
0x75, 0x73, 0x65, 0x2f, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x2f,
0x7b, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x7d,
0x12, 0x6f, 0x0a, 0x1a, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x50, 0x72, 0x6f, 0x64, 0x75,
0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x27,
0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73,
0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x64, 0x75, 0x63, 0x74, 0x43, 0x72, 0x65, 0x61, 0x74,
0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22,
0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41,
0x4c, 0x12, 0x6b, 0x0a, 0x18, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x4f, 0x72, 0x64, 0x65,
0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x25, 0x2e,
0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e,
0x76, 0x31, 0x2e, 0x4f, 0x72, 0x64, 0x65, 0x72, 0x50, 0x65, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x45,
0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2,
0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x77,
0x0a, 0x1e, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e,
0x74, 0x41, 0x6c, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74,
0x12, 0x2b, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e,
0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x68, 0x69, 0x70, 0x6d, 0x65, 0x6e, 0x74, 0x41, 0x6c,
0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x1a, 0x16, 0x2e,
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93, 0x02, 0x0a, 0x12, 0x08, 0x49,
0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x12, 0x73, 0x0a, 0x1c, 0x50, 0x72, 0x6f, 0x63, 0x65,
0x73, 0x73, 0x50, 0x61, 0x79, 0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73,
0x65, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x29, 0x2e, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c,
0x65, 0x74, 0x2e, 0x65, 0x76, 0x65, 0x6e, 0x74, 0x73, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x61, 0x79,
0x6d, 0x65, 0x6e, 0x74, 0x50, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x45, 0x76, 0x65,
0x6e, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x10, 0xfa, 0xd2, 0xe4, 0x93,
0x02, 0x0a, 0x12, 0x08, 0x49, 0x4e, 0x54, 0x45, 0x52, 0x4e, 0x41, 0x4c, 0x42, 0x4d, 0x5a, 0x4b,
0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x68, 0x65, 0x78, 0x6f, 0x6c,
0x61, 0x6e, 0x2f, 0x73, 0x74, 0x6f, 0x63, 0x6b, 0x6c, 0x65, 0x74, 0x2f, 0x69, 0x6e, 0x74, 0x65,
0x72, 0x6e, 0x61, 0x6c, 0x2f, 0x70, 0x6b, 0x67, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x67, 0x65,
0x6e, 0x2f, 0x77, 0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x2f, 0x76, 0x31, 0x3b, 0x77,
0x61, 0x72, 0x65, 0x68, 0x6f, 0x75, 0x73, 0x65, 0x5f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
0x74, 0x6f, 0x33,
}
var (
file_stocklet_warehouse_v1_service_proto_rawDescOnce sync.Once
file_stocklet_warehouse_v1_service_proto_rawDescData = file_stocklet_warehouse_v1_service_proto_rawDesc
)
func file_stocklet_warehouse_v1_service_proto_rawDescGZIP() []byte {
file_stocklet_warehouse_v1_service_proto_rawDescOnce.Do(func() {
file_stocklet_warehouse_v1_service_proto_rawDescData = protoimpl.X.CompressGZIP(file_stocklet_warehouse_v1_service_proto_rawDescData)
})
return file_stocklet_warehouse_v1_service_proto_rawDescData
}
var file_stocklet_warehouse_v1_service_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_stocklet_warehouse_v1_service_proto_goTypes = []interface{}{
(*ViewProductStockRequest)(nil), // 0: stocklet.warehouse.v1.ViewProductStockRequest
(*ViewProductStockResponse)(nil), // 1: stocklet.warehouse.v1.ViewProductStockResponse
(*ViewReservationRequest)(nil), // 2: stocklet.warehouse.v1.ViewReservationRequest
(*ViewReservationResponse)(nil), // 3: stocklet.warehouse.v1.ViewReservationResponse
(*ProductStock)(nil), // 4: stocklet.warehouse.v1.ProductStock
(*Reservation)(nil), // 5: stocklet.warehouse.v1.Reservation
(*v1.ServiceInfoRequest)(nil), // 6: stocklet.common.v1.ServiceInfoRequest
(*v11.ProductCreatedEvent)(nil), // 7: stocklet.events.v1.ProductCreatedEvent
(*v11.OrderPendingEvent)(nil), // 8: stocklet.events.v1.OrderPendingEvent
(*v11.ShipmentAllocationEvent)(nil), // 9: stocklet.events.v1.ShipmentAllocationEvent
(*v11.PaymentProcessedEvent)(nil), // 10: stocklet.events.v1.PaymentProcessedEvent
(*v1.ServiceInfoResponse)(nil), // 11: stocklet.common.v1.ServiceInfoResponse
(*emptypb.Empty)(nil), // 12: google.protobuf.Empty
}
var file_stocklet_warehouse_v1_service_proto_depIdxs = []int32{
4, // 0: stocklet.warehouse.v1.ViewProductStockResponse.stock:type_name -> stocklet.warehouse.v1.ProductStock
5, // 1: stocklet.warehouse.v1.ViewReservationResponse.reservation:type_name -> stocklet.warehouse.v1.Reservation
6, // 2: stocklet.warehouse.v1.WarehouseService.ServiceInfo:input_type -> stocklet.common.v1.ServiceInfoRequest
0, // 3: stocklet.warehouse.v1.WarehouseService.ViewProductStock:input_type -> stocklet.warehouse.v1.ViewProductStockRequest
2, // 4: stocklet.warehouse.v1.WarehouseService.ViewReservation:input_type -> stocklet.warehouse.v1.ViewReservationRequest
7, // 5: stocklet.warehouse.v1.WarehouseService.ProcessProductCreatedEvent:input_type -> stocklet.events.v1.ProductCreatedEvent
8, // 6: stocklet.warehouse.v1.WarehouseService.ProcessOrderPendingEvent:input_type -> stocklet.events.v1.OrderPendingEvent
9, // 7: stocklet.warehouse.v1.WarehouseService.ProcessShipmentAllocationEvent:input_type -> stocklet.events.v1.ShipmentAllocationEvent
10, // 8: stocklet.warehouse.v1.WarehouseService.ProcessPaymentProcessedEvent:input_type -> stocklet.events.v1.PaymentProcessedEvent
11, // 9: stocklet.warehouse.v1.WarehouseService.ServiceInfo:output_type -> stocklet.common.v1.ServiceInfoResponse
1, // 10: stocklet.warehouse.v1.WarehouseService.ViewProductStock:output_type -> stocklet.warehouse.v1.ViewProductStockResponse
3, // 11: stocklet.warehouse.v1.WarehouseService.ViewReservation:output_type -> stocklet.warehouse.v1.ViewReservationResponse
12, // 12: stocklet.warehouse.v1.WarehouseService.ProcessProductCreatedEvent:output_type -> google.protobuf.Empty
12, // 13: stocklet.warehouse.v1.WarehouseService.ProcessOrderPendingEvent:output_type -> google.protobuf.Empty
12, // 14: stocklet.warehouse.v1.WarehouseService.ProcessShipmentAllocationEvent:output_type -> google.protobuf.Empty
12, // 15: stocklet.warehouse.v1.WarehouseService.ProcessPaymentProcessedEvent:output_type -> google.protobuf.Empty
9, // [9:16] is the sub-list for method output_type
2, // [2:9] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name
2, // [2:2] is the sub-list for extension extendee
0, // [0:2] is the sub-list for field type_name
}
func init() { file_stocklet_warehouse_v1_service_proto_init() }
func file_stocklet_warehouse_v1_service_proto_init() {
if File_stocklet_warehouse_v1_service_proto != nil {
return
}
file_stocklet_warehouse_v1_types_proto_init()
if !protoimpl.UnsafeEnabled {
file_stocklet_warehouse_v1_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewProductStockRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_warehouse_v1_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewProductStockResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_warehouse_v1_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewReservationRequest); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
file_stocklet_warehouse_v1_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*ViewReservationResponse); i {
case 0:
return &v.state
case 1:
return &v.sizeCache
case 2:
return &v.unknownFields
default:
return nil
}
}
}
type x struct{}
out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_stocklet_warehouse_v1_service_proto_rawDesc,
NumEnums: 0,
NumMessages: 4,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_stocklet_warehouse_v1_service_proto_goTypes,
DependencyIndexes: file_stocklet_warehouse_v1_service_proto_depIdxs,
MessageInfos: file_stocklet_warehouse_v1_service_proto_msgTypes,
}.Build()
File_stocklet_warehouse_v1_service_proto = out.File
file_stocklet_warehouse_v1_service_proto_rawDesc = nil
file_stocklet_warehouse_v1_service_proto_goTypes = nil
file_stocklet_warehouse_v1_service_proto_depIdxs = nil
}

View File

@@ -0,0 +1,362 @@
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: stocklet/warehouse/v1/service.proto
/*
Package warehouse_v1 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package warehouse_v1
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"github.com/hexolan/stocklet/internal/pkg/protogen/common/v1"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_WarehouseService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, client WarehouseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := client.ServiceInfo(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WarehouseService_ServiceInfo_0(ctx context.Context, marshaler runtime.Marshaler, server WarehouseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq common_v1.ServiceInfoRequest
var metadata runtime.ServerMetadata
msg, err := server.ServiceInfo(ctx, &protoReq)
return msg, metadata, err
}
func request_WarehouseService_ViewProductStock_0(ctx context.Context, marshaler runtime.Marshaler, client WarehouseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewProductStockRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["product_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "product_id")
}
protoReq.ProductId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "product_id", err)
}
msg, err := client.ViewProductStock(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WarehouseService_ViewProductStock_0(ctx context.Context, marshaler runtime.Marshaler, server WarehouseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewProductStockRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["product_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "product_id")
}
protoReq.ProductId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "product_id", err)
}
msg, err := server.ViewProductStock(ctx, &protoReq)
return msg, metadata, err
}
func request_WarehouseService_ViewReservation_0(ctx context.Context, marshaler runtime.Marshaler, client WarehouseServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewReservationRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["reservation_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "reservation_id")
}
protoReq.ReservationId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "reservation_id", err)
}
msg, err := client.ViewReservation(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_WarehouseService_ViewReservation_0(ctx context.Context, marshaler runtime.Marshaler, server WarehouseServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ViewReservationRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["reservation_id"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "reservation_id")
}
protoReq.ReservationId, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "reservation_id", err)
}
msg, err := server.ViewReservation(ctx, &protoReq)
return msg, metadata, err
}
// RegisterWarehouseServiceHandlerServer registers the http handlers for service WarehouseService to "mux".
// UnaryRPC :call WarehouseServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterWarehouseServiceHandlerFromEndpoint instead.
func RegisterWarehouseServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server WarehouseServiceServer) error {
mux.Handle("GET", pattern_WarehouseService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/warehouse/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WarehouseService_ServiceInfo_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_WarehouseService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WarehouseService_ViewProductStock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewProductStock", runtime.WithHTTPPathPattern("/v1/warehouse/product/{product_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WarehouseService_ViewProductStock_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_WarehouseService_ViewProductStock_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WarehouseService_ViewReservation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewReservation", runtime.WithHTTPPathPattern("/v1/warehouse/reservation/{reservation_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_WarehouseService_ViewReservation_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_WarehouseService_ViewReservation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterWarehouseServiceHandlerFromEndpoint is same as RegisterWarehouseServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterWarehouseServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterWarehouseServiceHandler(ctx, mux, conn)
}
// RegisterWarehouseServiceHandler registers the http handlers for service WarehouseService to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterWarehouseServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterWarehouseServiceHandlerClient(ctx, mux, NewWarehouseServiceClient(conn))
}
// RegisterWarehouseServiceHandlerClient registers the http handlers for service WarehouseService
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "WarehouseServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "WarehouseServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "WarehouseServiceClient" to call the correct interceptors.
func RegisterWarehouseServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client WarehouseServiceClient) error {
mux.Handle("GET", pattern_WarehouseService_ServiceInfo_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ServiceInfo", runtime.WithHTTPPathPattern("/v1/warehouse/service"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WarehouseService_ServiceInfo_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_WarehouseService_ServiceInfo_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WarehouseService_ViewProductStock_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewProductStock", runtime.WithHTTPPathPattern("/v1/warehouse/product/{product_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WarehouseService_ViewProductStock_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_WarehouseService_ViewProductStock_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("GET", pattern_WarehouseService_ViewReservation_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/stocklet.warehouse.v1.WarehouseService/ViewReservation", runtime.WithHTTPPathPattern("/v1/warehouse/reservation/{reservation_id}"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_WarehouseService_ViewReservation_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_WarehouseService_ViewReservation_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_WarehouseService_ServiceInfo_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "warehouse", "service"}, ""))
pattern_WarehouseService_ViewProductStock_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "warehouse", "product", "product_id"}, ""))
pattern_WarehouseService_ViewReservation_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2, 1, 0, 4, 1, 5, 3}, []string{"v1", "warehouse", "reservation", "reservation_id"}, ""))
)
var (
forward_WarehouseService_ServiceInfo_0 = runtime.ForwardResponseMessage
forward_WarehouseService_ViewProductStock_0 = runtime.ForwardResponseMessage
forward_WarehouseService_ViewReservation_0 = runtime.ForwardResponseMessage
)

Some files were not shown because too many files have changed in this diff Show More