Compare commits
4 Commits
main
...
silvermobi
Author | SHA1 | Date |
---|---|---|
|
e65885676e | |
|
b8e78dd687 | |
|
4c3aa9c3d3 | |
|
88739650bc |
|
@ -1,30 +0,0 @@
|
||||||
# Binaries for programs and plugins
|
|
||||||
*.exe
|
|
||||||
*.exe~
|
|
||||||
*.dll
|
|
||||||
*.so
|
|
||||||
*.dylib
|
|
||||||
|
|
||||||
# Test binary, built with `go test -c`
|
|
||||||
*.test
|
|
||||||
*.cover*
|
|
||||||
|
|
||||||
# Output of the go coverage tool, specifically when used with LiteIDE
|
|
||||||
*.out
|
|
||||||
|
|
||||||
# Dependency directories (remove the comment below to include it)
|
|
||||||
vendor/
|
|
||||||
vendor*/
|
|
||||||
*.lock
|
|
||||||
go.sum
|
|
||||||
|
|
||||||
# Jetbrain IDE files
|
|
||||||
.idea/
|
|
||||||
.idea/*
|
|
||||||
.idea/**/*
|
|
||||||
|
|
||||||
config.yaml
|
|
||||||
|
|
||||||
# other
|
|
||||||
/scripts
|
|
||||||
/test-*
|
|
660
LICENSE.md
660
LICENSE.md
|
@ -1,660 +0,0 @@
|
||||||
# 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.
|
|
||||||
|
|
||||||
<one line to give the program's name and a brief idea of what it does.>
|
|
||||||
Copyright (C) <year> <name of author>
|
|
||||||
|
|
||||||
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/>.
|
|
|
@ -0,0 +1,79 @@
|
||||||
|
service_name: SILVERMOBI
|
||||||
|
|
||||||
|
storage:
|
||||||
|
db:
|
||||||
|
type: psql
|
||||||
|
psql:
|
||||||
|
host: localhost
|
||||||
|
dbname: coopgo_platform
|
||||||
|
user: maxime
|
||||||
|
password: posgres
|
||||||
|
sslmode: disable
|
||||||
|
port: 5432
|
||||||
|
schema: silvermobi_backend
|
||||||
|
tables:
|
||||||
|
users_firebase: users_firebase
|
||||||
|
services:
|
||||||
|
internal:
|
||||||
|
mobility_accounts:
|
||||||
|
type: grpc
|
||||||
|
dial: localhost:8090
|
||||||
|
push:
|
||||||
|
type: gorush-grpc
|
||||||
|
dial: localhost:8095
|
||||||
|
external:
|
||||||
|
grpc:
|
||||||
|
enable: true
|
||||||
|
ip: localhost
|
||||||
|
port: 8099
|
||||||
|
web:
|
||||||
|
enable: true
|
||||||
|
port: 8098
|
||||||
|
moncomptemobilite:
|
||||||
|
enable: true
|
||||||
|
port: 8097
|
||||||
|
oidc:
|
||||||
|
provider: https://idp-fabmob.stg.hub.flowbird.io/auth/realms/mcm
|
||||||
|
client_id: ridygo-pub
|
||||||
|
# redirect_url: "http://192.168.1.27:8097/callbacks/oidc/cee"
|
||||||
|
redirect_url: "http://192.168.1.27:8097/callbacks/oidc/cee"
|
||||||
|
# redirect_url: "http://localhost:8097/callbacks/oidc/cee"
|
||||||
|
certinergy:
|
||||||
|
enable: true
|
||||||
|
port: 8100
|
||||||
|
jwt_key: 6mt29Z4rkCPmib9ckigPWFbaDTQFUPyK
|
||||||
|
# jwt_key : UjXnZr4u7x!A%D*G-KaPdSgVkYp3s5v8 # PROD
|
||||||
|
clients:
|
||||||
|
- name: certinergy
|
||||||
|
id: cd11c681-4168-4bdf-8f2d-9e3ade5fac8d
|
||||||
|
bearer: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjZDExYzY4MS00MTY4LTRiZGYtOGYyZC05ZTNhZGU1ZmFjOGQiLCJuYW1lIjoiY2VydGluZXJneSIsImlhdCI6MTUxNjIzOTAyMn0.tPwn3uD_6T4FjOTehYDRNg39x2A4E9FFv6qTgduODaA
|
||||||
|
# bearer: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJjZDExYzY4MS00MTY4LTRiZGYtOGYyZC05ZTNhZGU1ZmFjOGQiLCJuYW1lIjoiY2VydGluZXJneSIsImlhdCI6MTUxNjIzOTAyMn0.LAr2l5X9XFRbPRPQvZLt8AWyfzbFGS5BO9MlB4U5HJo # PROD
|
||||||
|
solidarity_service:
|
||||||
|
address: 10.73.189.26:8089 #10.73.190.5
|
||||||
|
identification:
|
||||||
|
local:
|
||||||
|
jwt_secret: JWT_KEY
|
||||||
|
ttl: 20000s
|
||||||
|
|
||||||
|
carpooling_proofs:
|
||||||
|
rpc_registry:
|
||||||
|
base_url: https://api.demo.covoiturage.beta.gouv.fr
|
||||||
|
token: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhIjoiN2Y4MTQwNzYtOTJmOS00NjExLTlhMmItZjA0MzU4MmMwOWI3IiwibyI6OSwicyI6Im9wZXJhdG9yIiwicCI6WyJjb21tb24uY2VydGlmaWNhdGUuZmluZCIsImNvbW1vbi5jb21wYW55LmZldGNoIiwiY29tbW9uLmNvbXBhbnkuZmluZCIsImNvbW1vbi5ob25vci5zYXZlIiwiY29tbW9uLmhvbm9yLnN0YXRzIiwiY29tbW9uLm9wZXJhdG9yLmxpc3QiLCJjb21tb24ub3BlcmF0b3IuZmluZCIsImNvbW1vbi5wb2xpY3kubGlzdCIsImNvbW1vbi5wb2xpY3kubGlzdC50ZW1wbGF0ZXMiLCJjb21tb24udGVycml0b3J5LmZpbmQiLCJjb21tb24udGVycml0b3J5Lmxpc3QiLCJjb21tb24udGVycml0b3J5LnJlYWQiLCJjb21tb24udHJpcC5zdGF0cyIsImNvbW1vbi51c2VyLnVwZGF0ZSIsImNvbW1vbi51c2VyLmZpbmQiLCJjb21tb24udXNlci5wb2xpY3lTaW11bGF0ZSIsIm9wZXJhdG9yLmFjcXVpc2l0aW9uLmNyZWF0ZSIsIm9wZXJhdG9yLmFjcXVpc2l0aW9uLmNhbmNlbCIsIm9wZXJhdG9yLmFjcXVpc2l0aW9uLnN0YXR1cyIsIm9wZXJhdG9yLmNlcnRpZmljYXRlLmNyZWF0ZSIsIm9wZXJhdG9yLmNlcnRpZmljYXRlLmRvd25sb2FkIiwib3BlcmF0b3IucG9saWN5LnNpbXVsYXRlLmZ1dHVyZSJdLCJ2IjoyLCJpYXQiOjE2NzgwOTg0NTR9.b4ezR41U4kGwa6FVF0-JyvqEE1kKtxGEa5gzqh4ctTU
|
||||||
|
|
||||||
|
|
||||||
|
geocoder:
|
||||||
|
type: pelias
|
||||||
|
pelias:
|
||||||
|
base_url: https://geocode.ridygo.fr
|
||||||
|
|
||||||
|
routing:
|
||||||
|
type: valhalla
|
||||||
|
valhalla:
|
||||||
|
base_url: https://valhalla.coopgo.io/
|
||||||
|
|
||||||
|
emailing:
|
||||||
|
smtp:
|
||||||
|
host: mail.gandi.net
|
||||||
|
port: 587
|
||||||
|
username: support@parcoursmob.fr
|
||||||
|
password: Sc1tYc00p
|
16
go.mod
16
go.mod
|
@ -1,6 +1,6 @@
|
||||||
module git.coopgo.io/coopgo-apps/silvermobi
|
module git.coopgo.io/coopgo-apps/silvermobi
|
||||||
|
|
||||||
go 1.21
|
go 1.22
|
||||||
|
|
||||||
toolchain go1.23.2
|
toolchain go1.23.2
|
||||||
|
|
||||||
|
@ -19,8 +19,8 @@ require (
|
||||||
github.com/rs/zerolog v1.29.1
|
github.com/rs/zerolog v1.29.1
|
||||||
github.com/spf13/viper v1.16.0
|
github.com/spf13/viper v1.16.0
|
||||||
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
|
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1
|
||||||
google.golang.org/grpc v1.65.0
|
google.golang.org/grpc v1.68.1
|
||||||
google.golang.org/protobuf v1.34.1
|
google.golang.org/protobuf v1.34.2
|
||||||
gopkg.in/mail.v2 v2.3.1
|
gopkg.in/mail.v2 v2.3.1
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -58,11 +58,11 @@ require (
|
||||||
go.uber.org/atomic v1.10.0 // indirect
|
go.uber.org/atomic v1.10.0 // indirect
|
||||||
go.uber.org/multierr v1.8.0 // indirect
|
go.uber.org/multierr v1.8.0 // indirect
|
||||||
go.uber.org/zap v1.21.0 // indirect
|
go.uber.org/zap v1.21.0 // indirect
|
||||||
golang.org/x/crypto v0.23.0 // indirect
|
golang.org/x/crypto v0.27.0 // indirect
|
||||||
golang.org/x/net v0.25.0 // indirect
|
golang.org/x/net v0.29.0 // indirect
|
||||||
golang.org/x/sync v0.7.0 // indirect
|
golang.org/x/sync v0.8.0 // indirect
|
||||||
golang.org/x/sys v0.20.0 // indirect
|
golang.org/x/sys v0.25.0 // indirect
|
||||||
golang.org/x/text v0.15.0 // indirect
|
golang.org/x/text v0.18.0 // indirect
|
||||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc // indirect
|
||||||
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
|
gopkg.in/check.v1 v1.0.0-20200227125254-8fa46927fb4f // indirect
|
||||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||||
|
|
41
go.sum
41
go.sum
|
@ -25,7 +25,8 @@ cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUM
|
||||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||||
cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ=
|
cloud.google.com/go/compute v1.19.0 h1:+9zda3WGgW1ZSTlVppLCYFIr48Pa35q1uG2N1itbCEQ=
|
||||||
cloud.google.com/go/compute/metadata v0.3.0 h1:Tz+eQXMEqDIKRsmY3cHTL6FVaynIjX2QxYC4trgAKZc=
|
cloud.google.com/go/compute/metadata v0.5.0 h1:Zr0eK8JbFv6+Wi4ilXAR8FJ3wyNdpxHKJNPos6LTZOY=
|
||||||
|
cloud.google.com/go/compute/metadata v0.5.0/go.mod h1:aHnloV2TPI38yx4s9+wAZhHykWvVCfu7hQbF+9CWoiY=
|
||||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||||
cloud.google.com/go/maps v0.7.0 h1:mv9YaczD4oZBZkM5XJl6fXQ984IkJNHPwkc8MUsdkBo=
|
cloud.google.com/go/maps v0.7.0 h1:mv9YaczD4oZBZkM5XJl6fXQ984IkJNHPwkc8MUsdkBo=
|
||||||
|
@ -76,6 +77,7 @@ github.com/envoyproxy/go-control-plane v0.9.7/go.mod h1:cwu0lG7PUMfa9snN8LXBig5y
|
||||||
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
github.com/envoyproxy/go-control-plane v0.9.9-0.20201210154907-fd9021fe5dad/go.mod h1:cXg6YxExXjJnVBQHBLXeUAgxn2UodCpnH306RInaBQk=
|
||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
|
github.com/frankban/quicktest v1.14.4 h1:g2rn0vABPOOXmZUj+vbmUp0lPoXEMuhTpIluN0XL9UY=
|
||||||
|
github.com/frankban/quicktest v1.14.4/go.mod h1:4ptaffx2x8+WTWXmUCuVU6aPUX1/Mz7zb5vbUoiM6w0=
|
||||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||||
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
github.com/fsnotify/fsnotify v1.6.0/go.mod h1:sl3t1tCWJFWoRz9R8WJCbQihKKwmorjAbSClcnxKAGw=
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
|
@ -133,6 +135,7 @@ github.com/google/go-cmp v0.5.2/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||||
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.4/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
github.com/google/go-cmp v0.5.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 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
|
||||||
|
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||||
|
@ -172,9 +175,11 @@ github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxv
|
||||||
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
github.com/kr/fs v0.1.0/go.mod h1:FFnZGqtBN9Gxj7eW1uZ42v5BccTP0vu6NEaFoC2HwRg=
|
||||||
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
|
||||||
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
|
||||||
|
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
|
||||||
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
|
||||||
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
|
||||||
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||||
|
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||||
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
github.com/magiconair/properties v1.8.7 h1:IeQXZAiQcpL9mgcAe1Nu6cX9LLw6ExEHKjN0VQdvPDY=
|
||||||
|
@ -207,6 +212,7 @@ github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZN
|
||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||||
|
github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
|
||||||
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||||
github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc=
|
github.com/rs/zerolog v1.29.1 h1:cO+d60CHkknCbvzEWxP0S9K6KqyTjrCNUy1LdQLCGPc=
|
||||||
github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU=
|
github.com/rs/zerolog v1.29.1/go.mod h1:Le6ESbR7hc+DP6Lt1THiV8CQSdkkNrd3R0XbEgp3ZBU=
|
||||||
|
@ -242,6 +248,7 @@ github.com/subosito/gotenv v1.4.2 h1:X1TuBLAMDFbaTAChgCBLu3DU3UPyELpnF2jjJ2cz/S8
|
||||||
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
|
github.com/subosito/gotenv v1.4.2/go.mod h1:ayKnFf/c6rvx/2iiLrJUk1e6plDbT3edrFNGqEflhK0=
|
||||||
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
|
||||||
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
|
github.com/tidwall/pretty v1.2.1 h1:qjsOFOWWQl+N3RsoF5/ssm1pHmJJwhjlSbZ51I6wMl4=
|
||||||
|
github.com/tidwall/pretty v1.2.1/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
|
||||||
github.com/twpayne/go-polyline v1.1.1 h1:/tSF1BR7rN4HWj4XKqvRUNrCiYVMCvywxTFVofvDV0w=
|
github.com/twpayne/go-polyline v1.1.1 h1:/tSF1BR7rN4HWj4XKqvRUNrCiYVMCvywxTFVofvDV0w=
|
||||||
github.com/twpayne/go-polyline v1.1.1/go.mod h1:ybd9IWWivW/rlXPXuuckeKUyF3yrIim+iqA7kSl4NFY=
|
github.com/twpayne/go-polyline v1.1.1/go.mod h1:ybd9IWWivW/rlXPXuuckeKUyF3yrIim+iqA7kSl4NFY=
|
||||||
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
github.com/xdg-go/pbkdf2 v1.0.0 h1:Su7DPu48wXMwC3bs7MCNG+z4FhcyEuz5dlvchbq0B0c=
|
||||||
|
@ -291,8 +298,8 @@ golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPh
|
||||||
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
golang.org/x/crypto v0.0.0-20210421170649-83a5a9bb288b/go.mod h1:T9bdIzuCu7OtxOm1hfPfRQxPLYneinmdGuTeoZ9dtd4=
|
||||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
golang.org/x/crypto v0.0.0-20220722155217-630584e8d5aa/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||||
golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI=
|
golang.org/x/crypto v0.27.0 h1:GXm2NjJrPaiv/h1tb2UH8QfgC/hOf/+z0p6PT8o1w7A=
|
||||||
golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8=
|
golang.org/x/crypto v0.27.0/go.mod h1:1Xngt8kV6Dvbssa53Ziq6Eqn0HqbZi5Z6R0ZpwQzt70=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
|
@ -360,8 +367,8 @@ golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
|
golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo=
|
||||||
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
|
golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
|
@ -371,7 +378,8 @@ golang.org/x/oauth2 v0.0.0-20200902213428-5d25da1a8d43/go.mod h1:KelEdhl1UZF7XfJ
|
||||||
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
golang.org/x/oauth2 v0.0.0-20201109201403-9fd604954f58/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
golang.org/x/oauth2 v0.0.0-20201208152858-08078c50e5b5/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
golang.org/x/oauth2 v0.0.0-20210218202405-ba52d332ba99/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
golang.org/x/oauth2 v0.20.0 h1:4mQdhULixXKP1rwYBW0vAijoXnkTG0BLCDRzfe1idMo=
|
golang.org/x/oauth2 v0.23.0 h1:PbgcYx2W7i4LvjJWEbf0ngHV6qJYr86PkAV3bXdLEbs=
|
||||||
|
golang.org/x/oauth2 v0.23.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
|
@ -383,8 +391,8 @@ golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJ
|
||||||
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
|
golang.org/x/sync v0.8.0 h1:3NFvSEYkUoMifnESzZl15y791HH1qU2xm6eCJU5ZPXQ=
|
||||||
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
golang.org/x/sync v0.8.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
|
||||||
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
|
@ -429,8 +437,8 @@ golang.org/x/sys v0.0.0-20211025201205-69cdffdb9359/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||||
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.20.0 h1:Od9JTbYCk261bKm4M/mw7AklTlFYIa0bIp9BgSm1S8Y=
|
golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34=
|
||||||
golang.org/x/sys v0.20.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
|
golang.org/x/sys v0.25.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-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
|
@ -440,8 +448,8 @@ golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.15.0 h1:h1V/4gjBv8v9cjcR6+AR5+/cIYK5N/WAgiv4xlsEtAk=
|
golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224=
|
||||||
golang.org/x/text v0.15.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
|
golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
|
@ -581,8 +589,8 @@ google.golang.org/grpc v1.31.1/go.mod h1:N36X2cJ7JwdamYAgDz+s+rVMFjt3numwzf/HckM
|
||||||
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
google.golang.org/grpc v1.33.2/go.mod h1:JMHMWHQWaTccqQQlmk3MJZS+GWXOdAesneDmEnv2fbc=
|
||||||
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
google.golang.org/grpc v1.34.0/go.mod h1:WotjhfgOW/POjDeRt8vscBtXq+2VjORFy659qA51WJ8=
|
||||||
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
google.golang.org/grpc v1.35.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
google.golang.org/grpc v1.65.0 h1:bs/cUb4lp1G5iImFFd3u5ixQzweKizoZJAwBNLR42lc=
|
google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0=
|
||||||
google.golang.org/grpc v1.65.0/go.mod h1:WgYC2ypjlB0EiQi6wdKixMqukr6lBc0Vo+oOgjrM5ZQ=
|
google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw=
|
||||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||||
|
@ -595,8 +603,8 @@ google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGj
|
||||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.34.1 h1:9ddQBjfCyZPOHPUiPxpYESBLc+T8P3E+Vo4IbKZgFWg=
|
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
|
||||||
google.golang.org/protobuf v1.34.1/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos=
|
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
|
||||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
|
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc h1:2gGKlE2+asNV9m7xrywl36YYNnBG5ZQ0r/BOOxqPpmk=
|
||||||
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
|
gopkg.in/alexcesaro/quotedprintable.v3 v3.0.0-20150716171945-2caba252f4dc/go.mod h1:m7x9LTH6d71AHyAX77c9yqWCCa3UKHcVEj9y7hAtKDk=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
|
@ -611,6 +619,7 @@ gopkg.in/mail.v2 v2.3.1/go.mod h1:htwXN1Qh09vZJ1NVKxQqHPBaCBbzKhp5GzuJEA4VJWw=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||||
|
|
|
@ -2,19 +2,15 @@ package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/models"
|
"git.coopgo.io/coopgo-apps/silvermobi/models"
|
||||||
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *SilverMobiHandler) GetAccountInfos(ctx context.Context, id string) (account *models.Account, err error) {
|
func (h *SilvermobiHandler) GetAccountInfos(ctx context.Context, id string) (account *models.Account, err error) {
|
||||||
var resp *grpcapi.GetAccountResponse
|
resp, err := h.Services.MobilityAccounts.Client.GetAccount(ctx, &grpcapi.GetAccountRequest{Id: id})
|
||||||
|
if err != nil {
|
||||||
if resp, err = h.Services.MobilityAccounts.Client.GetAccount(ctx, &grpcapi.GetAccountRequest{Id: id}); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
account = h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
account = h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
||||||
|
|
||||||
return account, nil
|
return account, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,61 +3,49 @@ package handler
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/models"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *SilverMobiHandler) Login(ctx context.Context, username string, password string) (jwt string, err error) {
|
func (h *SilvermobiHandler) Login(ctx context.Context, username string, password string) (jwt string, err error) {
|
||||||
var (
|
account, err := h.Services.MobilityAccounts.Login(ctx, username, password, "parcoursmob_beneficiaries")
|
||||||
account *models.Account
|
if err != nil {
|
||||||
pTTL time.Duration
|
|
||||||
)
|
|
||||||
|
|
||||||
if account, err = h.Services.MobilityAccounts.Login(ctx, username, password, "silvermobi"); err != nil {
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
key := h.Config.GetString("identification.local.jwt_secret")
|
key := h.Config.GetString("identification.local.jwt_secret")
|
||||||
ttl := h.Config.GetString("identification.local.ttl")
|
ttl := h.Config.GetString("identification.local.ttl")
|
||||||
|
parsedttl, err := time.ParseDuration(ttl)
|
||||||
if pTTL, err = time.ParseDuration(ttl); err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
return account.CreateToken(parsedttl, key)
|
||||||
return account.CreateToken(pTTL, key)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) Register(ctx context.Context, username string, password string, email string,
|
func (h *SilvermobiHandler) Register(ctx context.Context, username string, password string, email string, phone_number string, first_name string, last_name string) (jwt string, err error) {
|
||||||
phoneNumber string, firstName string, lastName string) (jwt string, err error) {
|
account, err := h.Services.MobilityAccounts.Register(
|
||||||
|
|
||||||
var (
|
|
||||||
account *models.Account
|
|
||||||
pTTL time.Duration
|
|
||||||
)
|
|
||||||
|
|
||||||
if account, err = h.Services.MobilityAccounts.Register(
|
|
||||||
ctx,
|
ctx,
|
||||||
username,
|
username,
|
||||||
password,
|
password,
|
||||||
email,
|
email,
|
||||||
phoneNumber,
|
phone_number,
|
||||||
map[string]any{
|
map[string]any{
|
||||||
"first_name": firstName,
|
"first_name": first_name,
|
||||||
"last_name": lastName,
|
"last_name": last_name,
|
||||||
"email": email,
|
"email": email,
|
||||||
"phone_number": phoneNumber,
|
"phone_number": phone_number,
|
||||||
},
|
},
|
||||||
"silvermobi",
|
"parcoursmob_beneficiaries",
|
||||||
); err != nil {
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
key := h.Config.GetString("identification.local.jwt_secret")
|
key := h.Config.GetString("identification.local.jwt_secret")
|
||||||
ttl := h.Config.GetString("identification.local.ttl")
|
ttl := h.Config.GetString("identification.local.ttl")
|
||||||
|
|
||||||
if pTTL, err = time.ParseDuration(ttl); err != nil {
|
parsedttl, err := time.ParseDuration(ttl)
|
||||||
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
||||||
return account.CreateToken(pTTL, key)
|
return account.CreateToken(parsedttl, key)
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,8 @@ package handler
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
|
"crypto/tls"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
|
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/models"
|
|
||||||
gomail "gopkg.in/mail.v2"
|
gomail "gopkg.in/mail.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -19,50 +18,29 @@ func generateRandomPassword(length int) (string, error) {
|
||||||
return password, nil
|
return password, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) ForgetAccount(ctx context.Context, username string, namespace string) (response bool,
|
func (h *SilvermobiHandler) ForgetAccount(ctx context.Context, username string, namespace string) (response bool, access_Code string) {
|
||||||
accessCode string) {
|
account, err := h.Services.MobilityAccounts.GetAccountUsername(ctx, username, namespace)
|
||||||
|
if err == nil {
|
||||||
var (
|
|
||||||
err error
|
|
||||||
account *models.Account
|
|
||||||
)
|
|
||||||
|
|
||||||
account, err = h.Services.MobilityAccounts.GetAccountUsername(ctx, username, namespace)
|
|
||||||
|
|
||||||
if err != nil {
|
|
||||||
return false, ""
|
|
||||||
}
|
|
||||||
|
|
||||||
message := []byte("Hello dear,\nYour new Silvermobi password is: ")
|
message := []byte("Hello dear,\nYour new Silvermobi password is: ")
|
||||||
|
|
||||||
password, _ := generateRandomPassword(10)
|
password, _ := generateRandomPassword(10)
|
||||||
|
update := h.Services.MobilityAccounts.UpdatePassword(ctx, account.ID, password)
|
||||||
if update := h.Services.MobilityAccounts.UpdatePassword(ctx, account.ID, password); !update {
|
if update == false {
|
||||||
return false, ""
|
return false, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
m := gomail.NewMessage()
|
m := gomail.NewMessage()
|
||||||
m.SetHeader("From", h.Config.GetString("emailing.smtp.username"))
|
m.SetHeader("From", h.Config.GetString("emailing.smtp.username"))
|
||||||
m.SetHeader("To", username)
|
m.SetHeader("To", username)
|
||||||
m.SetHeader("Subject", "Silvermobi Password Recovery")
|
m.SetHeader("Subject", "Silvermobi Password Recovery")
|
||||||
|
|
||||||
message = append(message, []byte(password)...)
|
message = append(message, []byte(password)...)
|
||||||
|
|
||||||
m.SetBody("text/plain", string(message))
|
m.SetBody("text/plain", string(message))
|
||||||
|
d := gomail.NewDialer(h.Config.GetString("emailing.smtp.host"), h.Config.GetInt("emailing.smtp.port"), h.Config.GetString("emailing.smtp.username"),
|
||||||
d := gomail.NewDialer(
|
h.Config.GetString("emailing.smtp.password"))
|
||||||
h.Config.GetString("emailing.smtp.host"),
|
d.TLSConfig = &tls.Config{InsecureSkipVerify: true}
|
||||||
h.Config.GetInt("emailing.smtp.port"),
|
if err := d.DialAndSend(m); err != nil {
|
||||||
h.Config.GetString("emailing.smtp.username"),
|
|
||||||
h.Config.GetString("emailing.smtp.password"),
|
|
||||||
)
|
|
||||||
|
|
||||||
d.StartTLSPolicy = gomail.MandatoryStartTLS
|
|
||||||
|
|
||||||
if err = d.DialAndSend(m); err != nil {
|
|
||||||
return false, ""
|
return false, ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return true, password
|
return true, password
|
||||||
|
} else {
|
||||||
|
return false, ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,13 +2,12 @@ package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"git.coopgo.io/coopgo-platform/routing-service"
|
|
||||||
"github.com/paulmach/orb"
|
"github.com/paulmach/orb"
|
||||||
"github.com/paulmach/orb/geojson"
|
"github.com/paulmach/orb/geojson"
|
||||||
|
"google.golang.org/genproto/googleapis/maps/routing/v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *SilverMobiHandler) GeoAutocomplete(text string) (*geojson.FeatureCollection, error) {
|
func (h *SilvermobiHandler) GeoAutocomplete(text string, lat, lon float64) (*geojson.FeatureCollection, error) {
|
||||||
result, err := h.Services.Geocoder.Autocomplete(text)
|
result, err := h.Services.Geocoder.Autocomplete(text)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -16,45 +15,36 @@ func (h *SilverMobiHandler) GeoAutocomplete(text string) (*geojson.FeatureCollec
|
||||||
return result, nil
|
return result, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) GeoRoute(locations geojson.FeatureCollection) (route *routing.Route, err error) {
|
func (h *SilvermobiHandler) GeoRoute(locations geojson.FeatureCollection) (route *routing.Route, err error) {
|
||||||
var (
|
route_locations := []orb.Point{}
|
||||||
routeLocations []orb.Point
|
|
||||||
featuresType string
|
features_type := ""
|
||||||
)
|
|
||||||
|
|
||||||
for _, f := range locations.Features {
|
for _, f := range locations.Features {
|
||||||
|
|
||||||
ft := f.Geometry.GeoJSONType()
|
ft := f.Geometry.GeoJSONType()
|
||||||
|
if features_type != "" && ft != features_type {
|
||||||
if ft != featuresType {
|
return nil, fmt.Errorf("mixing different types of geometries in the feature collection is not allowed : %s and %s found", features_type, ft)
|
||||||
return nil, fmt.Errorf("mixing different types of geometries in"+
|
|
||||||
" the feature collection is not allowed : %s and %s found", featuresType, ft)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
featuresType = ft
|
features_type = ft
|
||||||
|
|
||||||
if featuresType == "Point" {
|
if features_type == "Point" {
|
||||||
if point, ok := f.Geometry.(orb.Point); ok {
|
if point, ok := f.Geometry.(orb.Point); ok {
|
||||||
routeLocations = append(routeLocations, point)
|
route_locations = append(route_locations, point)
|
||||||
} else {
|
|
||||||
return nil, fmt.Errorf("invalid geometry type for point")
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("feature type %s not supported", featuresType)
|
return nil, fmt.Errorf("feature type %s not supported", features_type)
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if route, err = h.Services.Routing.Route(routeLocations); err != nil {
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return route, nil
|
return route, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) GeoReturnRoute(locations geojson.FeatureCollection) (route *routing.Route, err error) {
|
func (h *SilvermobiHandler) GeoReturnRoute(locations geojson.FeatureCollection) (route *routing.Route, err error) {
|
||||||
|
|
||||||
loc := locations
|
loc := locations
|
||||||
|
route.Polyline.String()
|
||||||
reverse(loc.Features)
|
reverse(loc.Features)
|
||||||
|
|
||||||
return h.GeoRoute(loc)
|
return h.GeoRoute(loc)
|
||||||
|
|
|
@ -6,15 +6,14 @@ import (
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
type SilverMobiHandler struct {
|
type SilvermobiHandler struct {
|
||||||
Config *viper.Viper
|
Config *viper.Viper
|
||||||
Services *services.ServiceHandler
|
Services *services.ServicesHandler
|
||||||
Storage storage.Storage
|
Storage storage.Storage
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSilverMobiHandler(cfg *viper.Viper, services *services.ServiceHandler,
|
func NewSilvermobiHandler(cfg *viper.Viper, services *services.ServicesHandler, storage storage.Storage) (*SilvermobiHandler, error) {
|
||||||
storage storage.Storage) (*SilverMobiHandler, error) {
|
return &SilvermobiHandler{
|
||||||
return &SilverMobiHandler{
|
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
Services: services,
|
Services: services,
|
||||||
Storage: storage,
|
Storage: storage,
|
||||||
|
|
|
@ -2,69 +2,63 @@ package handler
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"crypto/tls"
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/services"
|
"git.coopgo.io/coopgo-apps/silvermobi/services"
|
||||||
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||||
gomail "gopkg.in/mail.v2"
|
gomail "gopkg.in/mail.v2"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *SilverMobiHandler) PutFirebase(ctx context.Context, id string, token string, devicePlatform string) (err error) {
|
func (h *SilvermobiHandler) PutFirebase(ctx context.Context, id string, token string, device_platform string) (err error) {
|
||||||
err = h.Storage.CreateFirebaseToken(id, token, devicePlatform)
|
err = h.Storage.CreateFirebaseToken(id, token, device_platform)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) SendNotification(id, title, message string) error {
|
func (h *SilvermobiHandler) SendNotification(id, title, message string) (err error) {
|
||||||
firebaseToken, platform, err := h.Storage.GetFirebaseToken(id)
|
firebase_token, platfrom, _ := h.Storage.GetFirebaseToken(id)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
if platfrom == "android" {
|
||||||
notify := services.Notification{
|
_ = h.Services.Push.Send(
|
||||||
Recipients: []string{firebaseToken},
|
services.Notification{
|
||||||
|
Platform: services.PushToAndroid,
|
||||||
|
Recipients: []string{firebase_token},
|
||||||
Title: title,
|
Title: title,
|
||||||
Message: message,
|
Message: message,
|
||||||
}
|
},
|
||||||
if platform == "android" {
|
)
|
||||||
notify.Platform = services.PushToAndroid
|
|
||||||
err = h.Services.Push.Send(notify)
|
|
||||||
} else {
|
} else {
|
||||||
notify.Platform = services.PushToIos
|
_ = h.Services.Push.Send(
|
||||||
err = h.Services.Push.Send(notify)
|
services.Notification{
|
||||||
}
|
Platform: services.PushToIos,
|
||||||
|
Recipients: []string{firebase_token},
|
||||||
return err
|
Title: title,
|
||||||
|
Message: message,
|
||||||
}
|
},
|
||||||
func (h *SilverMobiHandler) SendEmail(id, title, message string) (err error) {
|
)
|
||||||
var resp *grpcapi.GetAccountResponse
|
|
||||||
|
|
||||||
if resp, err = h.Services.MobilityAccounts.Client.GetAccount(context.Background(),
|
|
||||||
&grpcapi.GetAccountRequest{Id: id}); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
account := h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
|
||||||
|
|
||||||
m := gomail.NewMessage()
|
|
||||||
|
|
||||||
m.SetHeader("From", h.Config.GetString("emailing.smtp.username"))
|
|
||||||
m.SetHeader("To", account.Email)
|
|
||||||
m.SetHeader("Subject", title)
|
|
||||||
m.SetBody("text/plain", message)
|
|
||||||
|
|
||||||
d := gomail.NewDialer(
|
|
||||||
h.Config.GetString("emailing.smtp.host"),
|
|
||||||
h.Config.GetInt("emailing.smtp.port"),
|
|
||||||
h.Config.GetString("emailing.smtp.username"),
|
|
||||||
h.Config.GetString("emailing.smtp.password"))
|
|
||||||
|
|
||||||
d.StartTLSPolicy = gomail.MandatoryStartTLS
|
|
||||||
|
|
||||||
if err = d.DialAndSend(m); err != nil {
|
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
func (h *SilvermobiHandler) SendEmail(id, title, message string) (err error) {
|
||||||
|
resp, err := h.Services.MobilityAccounts.Client.GetAccount(context.Background(), &grpcapi.GetAccountRequest{Id: id})
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
account := h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
||||||
|
m := gomail.NewMessage()
|
||||||
|
m.SetHeader("From", h.Config.GetString("emailing.smtp.username"))
|
||||||
|
m.SetHeader("To", account.Email)
|
||||||
|
m.SetHeader("Subject", title)
|
||||||
|
m.SetBody("text/plain", message)
|
||||||
|
d := gomail.NewDialer(h.Config.GetString("emailing.smtp.host"), h.Config.GetInt("emailing.smtp.port"), h.Config.GetString("emailing.smtp.username"),
|
||||||
|
h.Config.GetString("emailing.smtp.password"))
|
||||||
|
d.TLSConfig = &tls.Config{InsecureSkipVerify: true}
|
||||||
|
if err := d.DialAndSend(m); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
return nil
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -3,53 +3,48 @@ package handler
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"math/rand"
|
|
||||||
|
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/services"
|
"git.coopgo.io/coopgo-apps/silvermobi/services"
|
||||||
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
"git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||||
"github.com/pkg/errors"
|
"github.com/pkg/errors"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
|
"math/rand"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (h *SilverMobiHandler) UpdatePhoneNumber(ctx context.Context, id string, phoneNumber string) (err error) {
|
func (h *SilvermobiHandler) UpdatePhoneNumber(ctx context.Context, id string, phone_number string) error {
|
||||||
|
|
||||||
code := rand.Intn(9999)
|
code := rand.Intn(9999)
|
||||||
|
err := h.Services.MobilityAccounts.UpdatePhoneNumber(
|
||||||
if err = h.Services.MobilityAccounts.UpdatePhoneNumber(
|
|
||||||
ctx,
|
ctx,
|
||||||
id,
|
id,
|
||||||
phoneNumber,
|
phone_number,
|
||||||
false,
|
false,
|
||||||
fmt.Sprintf("%04d", code),
|
fmt.Sprintf("%04d", code),
|
||||||
); err != nil {
|
)
|
||||||
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("updating phone number failed")
|
log.Error().Err(err).Msg("updating phone number failed")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = h.Services.Push.Send(
|
err = h.Services.Push.Send(
|
||||||
services.Notification{
|
services.Notification{
|
||||||
Platform: services.PushToSMSFactor,
|
Platform: services.PushToSMSFactor,
|
||||||
Recipients: []string{phoneNumber[1:]},
|
Recipients: []string{phone_number[1:]},
|
||||||
Title: "SILVERMOBI",
|
Title: "SILVERMOBI",
|
||||||
Message: fmt.Sprintf("SILVERMOBI - Votre code de validation : %04d", code),
|
Message: fmt.Sprintf("SILVERMOBI - Votre code de validation : %04d", code),
|
||||||
},
|
},
|
||||||
); err != nil {
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("issue sending verification code by sms")
|
log.Error().Err(err).Msg("issue sending verification code by sms")
|
||||||
return err
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) VerifyPhoneNumber(ctx context.Context, id string, phoneNumber string,
|
func (h *SilvermobiHandler) VerifyPhoneNumber(ctx context.Context, id string, phone_number string, verification_code string) error {
|
||||||
verificationCode string) error {
|
|
||||||
|
|
||||||
request := &grpcapi.GetAccountRequest{
|
request := &grpcapi.GetAccountRequest{
|
||||||
Id: id,
|
Id: id,
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := h.Services.MobilityAccounts.Client.GetAccount(ctx, request)
|
resp, err := h.Services.MobilityAccounts.Client.GetAccount(ctx, request)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -57,21 +52,20 @@ func (h *SilverMobiHandler) VerifyPhoneNumber(ctx context.Context, id string, ph
|
||||||
account_ := resp.Account
|
account_ := resp.Account
|
||||||
|
|
||||||
log.Debug().
|
log.Debug().
|
||||||
Str("phone_number", phoneNumber).
|
Str("phone_number", phone_number).
|
||||||
Str("account.phone_number", account_.Authentication.Local.PhoneNumber).
|
Str("account.phone_number", account_.Authentication.Local.PhoneNumber).
|
||||||
Str("verification_code", verificationCode).
|
Str("verification_code", verification_code).
|
||||||
Str("account.verification_code", account_.Authentication.Local.PhoneNumberValidation.ValidationCode).
|
Str("account.verification_code", account_.Authentication.Local.PhoneNumberValidation.ValidationCode).
|
||||||
Msg("Verify phone number")
|
Msg("Verify phone number")
|
||||||
|
|
||||||
if account_.Authentication.Local.PhoneNumber != phoneNumber ||
|
if account_.Authentication.Local.PhoneNumber != phone_number || account_.Authentication.Local.PhoneNumberValidation.ValidationCode != verification_code {
|
||||||
account_.Authentication.Local.PhoneNumberValidation.ValidationCode != verificationCode {
|
return errors.New("cound not validate phone number : verification code mismatch")
|
||||||
return errors.New("could not validate phone number : verification code mismatch")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
err = h.Services.MobilityAccounts.UpdatePhoneNumber(
|
err = h.Services.MobilityAccounts.UpdatePhoneNumber(
|
||||||
ctx,
|
ctx,
|
||||||
id,
|
id,
|
||||||
phoneNumber,
|
phone_number,
|
||||||
true,
|
true,
|
||||||
"",
|
"",
|
||||||
)
|
)
|
||||||
|
@ -82,94 +76,77 @@ func (h *SilverMobiHandler) VerifyPhoneNumber(ctx context.Context, id string, ph
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) UpdateBirthDate(ctx context.Context, id string, birthdate string) error {
|
func (h *SilvermobiHandler) UpdateBirthDate(ctx context.Context, id string, birthdate string) error {
|
||||||
err := h.Services.MobilityAccounts.UpdateAccountBirthDate(ctx, id, "silvermobi", birthdate)
|
err := h.Services.MobilityAccounts.UpdateAccountBirthDate(ctx, id, "parcoursmob_beneficiaries", birthdate)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) SetAccountType(ctx context.Context, id string, accountType string) error {
|
func (h *SilvermobiHandler) SetAccountType(ctx context.Context, id string, accountType string) error {
|
||||||
err := h.Services.MobilityAccounts.SetAccountType(ctx, id, accountType)
|
err := h.Services.MobilityAccounts.SetAccountType(ctx, id, accountType)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (h *SilverMobiHandler) GetAccountType(ctx context.Context, id string) (accountType string, err error) {
|
func (h *SilvermobiHandler) GetAccountType(ctx context.Context, id string) (account_type string, err error) {
|
||||||
var resp *grpcapi.GetAccountResponse
|
|
||||||
|
|
||||||
request := &grpcapi.GetAccountRequest{
|
request := &grpcapi.GetAccountRequest{
|
||||||
Id: id,
|
Id: id,
|
||||||
}
|
}
|
||||||
|
resp, err := h.Services.MobilityAccounts.Client.GetAccount(ctx, request)
|
||||||
if resp, err = h.Services.MobilityAccounts.Client.GetAccount(ctx, request); err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
log.Error().Err(err).Msg("Failed get account type")
|
||||||
}
|
}
|
||||||
|
|
||||||
account := h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
account := h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
||||||
|
|
||||||
if account.Type != "" {
|
if account.Type != "" {
|
||||||
|
|
||||||
return account.Type, nil
|
return account.Type, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", errors.New("account type not set")
|
return "", errors.New("account type not set")
|
||||||
}
|
}
|
||||||
func (h *SilverMobiHandler) GetAccountPhone(ctx context.Context, id string) (phoneNumber string, err error) {
|
func (h *SilvermobiHandler) GetAccountPhone(ctx context.Context, id string) (phone_number string, err error) {
|
||||||
var resp *grpcapi.GetAccountResponse
|
|
||||||
|
|
||||||
request := &grpcapi.GetAccountRequest{
|
request := &grpcapi.GetAccountRequest{
|
||||||
Id: id,
|
Id: id,
|
||||||
}
|
}
|
||||||
|
resp, err := h.Services.MobilityAccounts.Client.GetAccount(ctx, request)
|
||||||
if resp, err = h.Services.MobilityAccounts.Client.GetAccount(ctx, request); err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
|
log.Error().Err(err).Msg("Failed get account type")
|
||||||
}
|
}
|
||||||
|
|
||||||
account := h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
account := h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
||||||
|
|
||||||
if account.PhoneNumber != "" {
|
if account.PhoneNumber != "" {
|
||||||
|
|
||||||
return account.PhoneNumber, nil
|
return account.PhoneNumber, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return "", errors.New("invalid request ")
|
return "", errors.New("invalid request ")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (h *SilverMobiHandler) CheckValidation(ctx context.Context, id string) (phoneValidation, birthValidation,
|
func (h *SilvermobiHandler) CheckValidation(ctx context.Context, id string) (phone_validation, birth_validation, type_validation bool, err error) {
|
||||||
typeValidation bool, err error) {
|
|
||||||
|
|
||||||
var resp *grpcapi.GetAccountResponse
|
|
||||||
|
|
||||||
request := &grpcapi.GetAccountRequest{
|
request := &grpcapi.GetAccountRequest{
|
||||||
Id: id,
|
Id: id,
|
||||||
}
|
}
|
||||||
|
resp, err := h.Services.MobilityAccounts.Client.GetAccount(ctx, request)
|
||||||
if resp, err = h.Services.MobilityAccounts.Client.GetAccount(ctx, request); err != nil {
|
if err != nil {
|
||||||
return false, false, false, err
|
return false, false, false, err
|
||||||
|
log.Error().Err(err).Msg("Failed get validation response")
|
||||||
}
|
}
|
||||||
|
|
||||||
account := h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
account := h.Services.MobilityAccounts.ToAccountModel(resp.Account.ToStorageType())
|
||||||
|
phone_validation = false
|
||||||
phoneValidation = false
|
birth_validation = false
|
||||||
birthValidation = false
|
type_validation = false
|
||||||
typeValidation = false
|
|
||||||
|
|
||||||
if account.LocalCredentials.PhoneNumberVerified {
|
if account.LocalCredentials.PhoneNumberVerified {
|
||||||
phoneValidation = true
|
phone_validation = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if account.BirthDate != "" {
|
if account.BirthDate != "" {
|
||||||
birthValidation = true
|
birth_validation = true
|
||||||
}
|
}
|
||||||
|
|
||||||
if account.Type != "" {
|
if account.Type != "" {
|
||||||
typeValidation = true
|
type_validation = true
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Info().Msg("Getting phone and birth validation for " + account.Email)
|
log.Info().Msg("Getting phone and birth validation for " + account.Email)
|
||||||
return phoneValidation, birthValidation, typeValidation, nil
|
return phone_validation, birth_validation, type_validation, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,17 +2,15 @@ package handler
|
||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
|
||||||
func (h *SilverMobiHandler) UpdatePassword(ctx context.Context, username string, password string) (response bool) {
|
func (h *SilvermobiHandler) UpdatePassword(ctx context.Context, username string, password string) (response bool) {
|
||||||
account, err := h.Services.MobilityAccounts.GetAccountUsername(ctx, username, "silvermobi")
|
account, err := h.Services.MobilityAccounts.GetAccountUsername(ctx, username, "parcoursmob_beneficiaries")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
result := h.Services.MobilityAccounts.UpdatePassword(ctx, account.ID, password)
|
result := h.Services.MobilityAccounts.UpdatePassword(ctx, account.ID, password)
|
||||||
if result == true {
|
if result == true {
|
||||||
return true
|
return true
|
||||||
}
|
} else {
|
||||||
|
|
||||||
return false
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
22
main.go
22
main.go
|
@ -10,39 +10,35 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
|
||||||
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
zerolog.TimeFieldFormat = zerolog.TimeFormatUnix
|
||||||
|
|
||||||
cfg, err := ReadConfig()
|
cfg, err := ReadConfig()
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
grpcEnable = cfg.GetBool("services.external.grpc.enable")
|
grpc_enable = cfg.GetBool("services.external.grpc.enable")
|
||||||
svc *services.ServiceHandler
|
|
||||||
stg storage.Storage
|
|
||||||
hdl *handler.SilverMobiHandler
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if svc, err = services.NewServicesHandler(cfg); err != nil {
|
services, err := services.NewServicesHandler(cfg)
|
||||||
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("failed starting services handler")
|
log.Fatal().Err(err).Msg("failed starting services handler")
|
||||||
}
|
}
|
||||||
|
storage, err := storage.NewPostgresqlStorage(cfg)
|
||||||
if stg, err = storage.NewPostgresqlStorage(cfg); err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("failed starting storage handler")
|
log.Fatal().Err(err).Msg("failed starting storage handler")
|
||||||
}
|
}
|
||||||
|
|
||||||
if hdl, err = handler.NewSilverMobiHandler(cfg, svc, stg); err != nil {
|
handler, err := handler.NewSilvermobiHandler(cfg, services, storage)
|
||||||
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("failed starting ridygo handler")
|
log.Fatal().Err(err).Msg("failed starting ridygo handler")
|
||||||
}
|
}
|
||||||
|
|
||||||
failed := make(chan error)
|
failed := make(chan error)
|
||||||
|
|
||||||
if grpcEnable {
|
if grpc_enable {
|
||||||
log.Info().Msg("Running gRPC server")
|
log.Info().Msg("Running gRPC server")
|
||||||
go grpcserver.Run(failed, cfg, hdl)
|
go grpcserver.Run(failed, cfg, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
err = <-failed
|
err = <-failed
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
package models
|
package models
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"time"
|
|
||||||
|
|
||||||
"github.com/golang-jwt/jwt/v4"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Account struct {
|
type Account struct {
|
||||||
|
@ -37,11 +36,11 @@ type UserClaims struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (account Account) CreateToken(ttl time.Duration, key string) (token string, err error) {
|
func (account Account) CreateToken(ttl time.Duration, key string) (token string, err error) {
|
||||||
expiresAt := jwt.NewNumericDate(time.Now().Add(ttl))
|
expires_at := jwt.NewNumericDate(time.Now().Add(ttl))
|
||||||
claims := UserClaims{
|
claims := UserClaims{
|
||||||
RegisteredClaims: jwt.RegisteredClaims{
|
RegisteredClaims: jwt.RegisteredClaims{
|
||||||
Subject: account.ID,
|
Subject: account.ID,
|
||||||
ExpiresAt: expiresAt,
|
ExpiresAt: expires_at,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2281,11 +2281,11 @@ var file_silvermobi_service_proto_rawDesc = []byte{
|
||||||
0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x13, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x13, 0x2e, 0x41, 0x63, 0x63, 0x6f, 0x75, 0x6e, 0x74,
|
||||||
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x41, 0x63,
|
0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x41, 0x63,
|
||||||
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x63, 0x6f, 0x75, 0x6e, 0x74, 0x49, 0x6e, 0x66, 0x6f, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
0x65, 0x22, 0x00, 0x42, 0x34, 0x5a, 0x32, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67,
|
0x65, 0x22, 0x00, 0x42, 0x3c, 0x5a, 0x3a, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67,
|
||||||
0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x70, 0x73,
|
0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x61, 0x70, 0x70, 0x73,
|
||||||
0x2f, 0x73, 0x69, 0x6c, 0x76, 0x65, 0x72, 0x6d, 0x6f, 0x62, 0x69, 0x2f, 0x67, 0x72, 0x70, 0x63,
|
0x2f, 0x73, 0x69, 0x6c, 0x76, 0x65, 0x72, 0x6d, 0x6f, 0x62, 0x69, 0x2f, 0x73, 0x65, 0x72, 0x76,
|
||||||
0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
0x65, 0x72, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x61, 0x70, 0x69, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x33,
|
0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|
|
@ -134,8 +134,8 @@ message AccountTypeRequest {
|
||||||
PASSENGER = 0;
|
PASSENGER = 0;
|
||||||
DRIVER = 1;
|
DRIVER = 1;
|
||||||
}
|
}
|
||||||
bool request = 2;
|
optional bool request = 2;
|
||||||
AccountType type = 1;
|
optional AccountType type = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AccountTypeResponse {
|
message AccountTypeResponse {
|
||||||
|
@ -144,7 +144,7 @@ message AccountTypeResponse {
|
||||||
PASSENGER = 0;
|
PASSENGER = 0;
|
||||||
DRIVER = 1;
|
DRIVER = 1;
|
||||||
}
|
}
|
||||||
AccountType type = 2;
|
optional AccountType type = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GeoAutocompleteRequest {
|
message GeoAutocompleteRequest {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.27.1
|
// protoc-gen-go v1.30.0
|
||||||
// protoc v3.12.4
|
// protoc v3.12.4
|
||||||
// source: solidarity-api-types.proto
|
// source: solidarity-api-types.proto
|
||||||
|
|
||||||
|
@ -307,11 +307,12 @@ type DriverJourney struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`
|
||||||
Car *Car `protobuf:"bytes,2,opt,name=car,proto3" json:"car,omitempty"`
|
Car *Car `protobuf:"bytes,2,opt,name=car,proto3,oneof" json:"car,omitempty"`
|
||||||
DriverDeparture_Date *timestamp.Timestamp `protobuf:"bytes,3,opt,name=driver_departure_Date,json=driverDepartureDate,proto3" json:"driver_departure_Date,omitempty"`
|
DriverDeparture_Date *timestamp.Timestamp `protobuf:"bytes,3,opt,name=driver_departure_Date,json=driverDepartureDate,proto3" json:"driver_departure_Date,omitempty"`
|
||||||
Price *Price `protobuf:"bytes,4,opt,name=price,proto3" json:"price,omitempty"`
|
Price *Price `protobuf:"bytes,4,opt,name=price,proto3,oneof" json:"price,omitempty"`
|
||||||
DriverDeparture_Address string `protobuf:"bytes,5,opt,name=driver_departure_Address,json=driverDepartureAddress,proto3" json:"driver_departure_Address,omitempty"`
|
DriverDeparture_Address string `protobuf:"bytes,5,opt,name=driver_departure_Address,json=driverDepartureAddress,proto3" json:"driver_departure_Address,omitempty"`
|
||||||
// Types that are assignable to Availabilities:
|
// Types that are assignable to Availabilities:
|
||||||
|
//
|
||||||
// *DriverJourney_RepeatedPunctualAvailabilities
|
// *DriverJourney_RepeatedPunctualAvailabilities
|
||||||
// *DriverJourney_RepeatedRegularAvailabilities
|
// *DriverJourney_RepeatedRegularAvailabilities
|
||||||
Availabilities isDriverJourney_Availabilities `protobuf_oneof:"availabilities"`
|
Availabilities isDriverJourney_Availabilities `protobuf_oneof:"availabilities"`
|
||||||
|
@ -523,8 +524,8 @@ type DriverRequest struct {
|
||||||
DriverAddress *Feature `protobuf:"bytes,1,opt,name=driver_address,json=driverAddress,proto3" json:"driver_address,omitempty"`
|
DriverAddress *Feature `protobuf:"bytes,1,opt,name=driver_address,json=driverAddress,proto3" json:"driver_address,omitempty"`
|
||||||
DriverRadius int32 `protobuf:"varint,2,opt,name=driver_radius,json=driverRadius,proto3" json:"driver_radius,omitempty"`
|
DriverRadius int32 `protobuf:"varint,2,opt,name=driver_radius,json=driverRadius,proto3" json:"driver_radius,omitempty"`
|
||||||
Driver *User `protobuf:"bytes,3,opt,name=driver,proto3" json:"driver,omitempty"`
|
Driver *User `protobuf:"bytes,3,opt,name=driver,proto3" json:"driver,omitempty"`
|
||||||
Preferences *Preferences `protobuf:"bytes,4,opt,name=preferences,proto3" json:"preferences,omitempty"`
|
Preferences *Preferences `protobuf:"bytes,4,opt,name=preferences,proto3,oneof" json:"preferences,omitempty"`
|
||||||
Car *Car `protobuf:"bytes,5,opt,name=car,proto3" json:"car,omitempty"`
|
Car *Car `protobuf:"bytes,5,opt,name=car,proto3,oneof" json:"car,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DriverRequest) Reset() {
|
func (x *DriverRequest) Reset() {
|
||||||
|
@ -827,10 +828,10 @@ type Booking struct {
|
||||||
PassengerDepartureRoute *Feature `protobuf:"bytes,5,opt,name=passenger_departure_route,json=passengerDepartureRoute,proto3" json:"passenger_departure_route,omitempty"`
|
PassengerDepartureRoute *Feature `protobuf:"bytes,5,opt,name=passenger_departure_route,json=passengerDepartureRoute,proto3" json:"passenger_departure_route,omitempty"`
|
||||||
PassengerDestinationRoute *Feature `protobuf:"bytes,6,opt,name=passenger_destination_route,json=passengerDestinationRoute,proto3" json:"passenger_destination_route,omitempty"`
|
PassengerDestinationRoute *Feature `protobuf:"bytes,6,opt,name=passenger_destination_route,json=passengerDestinationRoute,proto3" json:"passenger_destination_route,omitempty"`
|
||||||
Status BookingStatus `protobuf:"varint,7,opt,name=status,proto3,enum=BookingStatus" json:"status,omitempty"`
|
Status BookingStatus `protobuf:"varint,7,opt,name=status,proto3,enum=BookingStatus" json:"status,omitempty"`
|
||||||
Duration int64 `protobuf:"varint,8,opt,name=duration,proto3" json:"duration,omitempty"`
|
Duration *int64 `protobuf:"varint,8,opt,name=duration,proto3,oneof" json:"duration,omitempty"`
|
||||||
Distance int64 `protobuf:"varint,9,opt,name=distance,proto3" json:"distance,omitempty"`
|
Distance *int64 `protobuf:"varint,9,opt,name=distance,proto3,oneof" json:"distance,omitempty"`
|
||||||
Price *Price `protobuf:"bytes,10,opt,name=price,proto3" json:"price,omitempty"`
|
Price *Price `protobuf:"bytes,10,opt,name=price,proto3" json:"price,omitempty"`
|
||||||
Car *Car `protobuf:"bytes,11,opt,name=car,proto3" json:"car,omitempty"`
|
Car *Car `protobuf:"bytes,11,opt,name=car,proto3,oneof" json:"car,omitempty"`
|
||||||
PickupDate *timestamp.Timestamp `protobuf:"bytes,12,opt,name=pickup_date,json=pickupDate,proto3" json:"pickup_date,omitempty"`
|
PickupDate *timestamp.Timestamp `protobuf:"bytes,12,opt,name=pickup_date,json=pickupDate,proto3" json:"pickup_date,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -916,15 +917,15 @@ func (x *Booking) GetStatus() BookingStatus {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Booking) GetDuration() int64 {
|
func (x *Booking) GetDuration() int64 {
|
||||||
if x != nil {
|
if x != nil && x.Duration != nil {
|
||||||
return x.Duration
|
return *x.Duration
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Booking) GetDistance() int64 {
|
func (x *Booking) GetDistance() int64 {
|
||||||
if x != nil {
|
if x != nil && x.Distance != nil {
|
||||||
return x.Distance
|
return *x.Distance
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -955,8 +956,8 @@ type Car struct {
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Model string `protobuf:"bytes,1,opt,name=model,proto3" json:"model,omitempty"`
|
Model *string `protobuf:"bytes,1,opt,name=model,proto3,oneof" json:"model,omitempty"`
|
||||||
Brand string `protobuf:"bytes,2,opt,name=brand,proto3" json:"brand,omitempty"`
|
Brand *string `protobuf:"bytes,2,opt,name=brand,proto3,oneof" json:"brand,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Car) Reset() {
|
func (x *Car) Reset() {
|
||||||
|
@ -992,15 +993,15 @@ func (*Car) Descriptor() ([]byte, []int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Car) GetModel() string {
|
func (x *Car) GetModel() string {
|
||||||
if x != nil {
|
if x != nil && x.Model != nil {
|
||||||
return x.Model
|
return *x.Model
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Car) GetBrand() string {
|
func (x *Car) GetBrand() string {
|
||||||
if x != nil {
|
if x != nil && x.Brand != nil {
|
||||||
return x.Brand
|
return *x.Brand
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -1010,11 +1011,11 @@ type Preferences struct {
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Smoking bool `protobuf:"varint,1,opt,name=smoking,proto3" json:"smoking,omitempty"`
|
Smoking *bool `protobuf:"varint,1,opt,name=smoking,proto3,oneof" json:"smoking,omitempty"`
|
||||||
Animals bool `protobuf:"varint,2,opt,name=animals,proto3" json:"animals,omitempty"`
|
Animals *bool `protobuf:"varint,2,opt,name=animals,proto3,oneof" json:"animals,omitempty"`
|
||||||
Music bool `protobuf:"varint,3,opt,name=music,proto3" json:"music,omitempty"`
|
Music *bool `protobuf:"varint,3,opt,name=music,proto3,oneof" json:"music,omitempty"`
|
||||||
IsTalker bool `protobuf:"varint,4,opt,name=is_talker,json=isTalker,proto3" json:"is_talker,omitempty"`
|
IsTalker *bool `protobuf:"varint,4,opt,name=is_talker,json=isTalker,proto3,oneof" json:"is_talker,omitempty"`
|
||||||
LuggageSize int64 `protobuf:"varint,5,opt,name=luggage_size,json=luggageSize,proto3" json:"luggage_size,omitempty"`
|
LuggageSize *int64 `protobuf:"varint,5,opt,name=luggage_size,json=luggageSize,proto3,oneof" json:"luggage_size,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Preferences) Reset() {
|
func (x *Preferences) Reset() {
|
||||||
|
@ -1050,36 +1051,36 @@ func (*Preferences) Descriptor() ([]byte, []int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Preferences) GetSmoking() bool {
|
func (x *Preferences) GetSmoking() bool {
|
||||||
if x != nil {
|
if x != nil && x.Smoking != nil {
|
||||||
return x.Smoking
|
return *x.Smoking
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Preferences) GetAnimals() bool {
|
func (x *Preferences) GetAnimals() bool {
|
||||||
if x != nil {
|
if x != nil && x.Animals != nil {
|
||||||
return x.Animals
|
return *x.Animals
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Preferences) GetMusic() bool {
|
func (x *Preferences) GetMusic() bool {
|
||||||
if x != nil {
|
if x != nil && x.Music != nil {
|
||||||
return x.Music
|
return *x.Music
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Preferences) GetIsTalker() bool {
|
func (x *Preferences) GetIsTalker() bool {
|
||||||
if x != nil {
|
if x != nil && x.IsTalker != nil {
|
||||||
return x.IsTalker
|
return *x.IsTalker
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Preferences) GetLuggageSize() int64 {
|
func (x *Preferences) GetLuggageSize() int64 {
|
||||||
if x != nil {
|
if x != nil && x.LuggageSize != nil {
|
||||||
return x.LuggageSize
|
return *x.LuggageSize
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
@ -1089,9 +1090,9 @@ type Price struct {
|
||||||
sizeCache protoimpl.SizeCache
|
sizeCache protoimpl.SizeCache
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Type PriceType `protobuf:"varint,1,opt,name=type,proto3,enum=PriceType" json:"type,omitempty"`
|
Type *PriceType `protobuf:"varint,1,opt,name=type,proto3,enum=PriceType,oneof" json:"type,omitempty"`
|
||||||
Amount float64 `protobuf:"fixed64,2,opt,name=amount,proto3" json:"amount,omitempty"`
|
Amount *float64 `protobuf:"fixed64,2,opt,name=amount,proto3,oneof" json:"amount,omitempty"`
|
||||||
Currency string `protobuf:"bytes,3,opt,name=currency,proto3" json:"currency,omitempty"`
|
Currency *string `protobuf:"bytes,3,opt,name=currency,proto3,oneof" json:"currency,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Price) Reset() {
|
func (x *Price) Reset() {
|
||||||
|
@ -1127,22 +1128,22 @@ func (*Price) Descriptor() ([]byte, []int) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Price) GetType() PriceType {
|
func (x *Price) GetType() PriceType {
|
||||||
if x != nil {
|
if x != nil && x.Type != nil {
|
||||||
return x.Type
|
return *x.Type
|
||||||
}
|
}
|
||||||
return PriceType_FREE
|
return PriceType_FREE
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Price) GetAmount() float64 {
|
func (x *Price) GetAmount() float64 {
|
||||||
if x != nil {
|
if x != nil && x.Amount != nil {
|
||||||
return x.Amount
|
return *x.Amount
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *Price) GetCurrency() string {
|
func (x *Price) GetCurrency() string {
|
||||||
if x != nil {
|
if x != nil && x.Currency != nil {
|
||||||
return x.Currency
|
return *x.Currency
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -1154,12 +1155,12 @@ type User struct {
|
||||||
|
|
||||||
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
|
||||||
Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"`
|
Alias string `protobuf:"bytes,2,opt,name=alias,proto3" json:"alias,omitempty"`
|
||||||
FirstName string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3" json:"first_name,omitempty"`
|
FirstName *string `protobuf:"bytes,3,opt,name=first_name,json=firstName,proto3,oneof" json:"first_name,omitempty"`
|
||||||
LastName string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3" json:"last_name,omitempty"`
|
LastName *string `protobuf:"bytes,4,opt,name=last_name,json=lastName,proto3,oneof" json:"last_name,omitempty"`
|
||||||
Grade int64 `protobuf:"varint,5,opt,name=grade,proto3" json:"grade,omitempty"`
|
Grade *int64 `protobuf:"varint,5,opt,name=grade,proto3,oneof" json:"grade,omitempty"`
|
||||||
Picture string `protobuf:"bytes,6,opt,name=picture,proto3" json:"picture,omitempty"`
|
Picture *string `protobuf:"bytes,6,opt,name=picture,proto3,oneof" json:"picture,omitempty"`
|
||||||
Gender string `protobuf:"bytes,7,opt,name=gender,proto3" json:"gender,omitempty"`
|
Gender *string `protobuf:"bytes,7,opt,name=gender,proto3,oneof" json:"gender,omitempty"`
|
||||||
VerifiedIdentity bool `protobuf:"varint,8,opt,name=verified_identity,json=verifiedIdentity,proto3" json:"verified_identity,omitempty"`
|
VerifiedIdentity *bool `protobuf:"varint,8,opt,name=verified_identity,json=verifiedIdentity,proto3,oneof" json:"verified_identity,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *User) Reset() {
|
func (x *User) Reset() {
|
||||||
|
@ -1209,43 +1210,43 @@ func (x *User) GetAlias() string {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *User) GetFirstName() string {
|
func (x *User) GetFirstName() string {
|
||||||
if x != nil {
|
if x != nil && x.FirstName != nil {
|
||||||
return x.FirstName
|
return *x.FirstName
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *User) GetLastName() string {
|
func (x *User) GetLastName() string {
|
||||||
if x != nil {
|
if x != nil && x.LastName != nil {
|
||||||
return x.LastName
|
return *x.LastName
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *User) GetGrade() int64 {
|
func (x *User) GetGrade() int64 {
|
||||||
if x != nil {
|
if x != nil && x.Grade != nil {
|
||||||
return x.Grade
|
return *x.Grade
|
||||||
}
|
}
|
||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *User) GetPicture() string {
|
func (x *User) GetPicture() string {
|
||||||
if x != nil {
|
if x != nil && x.Picture != nil {
|
||||||
return x.Picture
|
return *x.Picture
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *User) GetGender() string {
|
func (x *User) GetGender() string {
|
||||||
if x != nil {
|
if x != nil && x.Gender != nil {
|
||||||
return x.Gender
|
return *x.Gender
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *User) GetVerifiedIdentity() bool {
|
func (x *User) GetVerifiedIdentity() bool {
|
||||||
if x != nil {
|
if x != nil && x.VerifiedIdentity != nil {
|
||||||
return x.VerifiedIdentity
|
return *x.VerifiedIdentity
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
@ -1261,192 +1262,217 @@ var file_solidarity_api_types_proto_rawDesc = []byte{
|
||||||
0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f,
|
0x01, 0x20, 0x01, 0x28, 0x01, 0x52, 0x03, 0x6c, 0x61, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6c, 0x6f,
|
||||||
0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x12, 0x18,
|
0x6e, 0x67, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x04, 0x6c, 0x6f, 0x6e, 0x67, 0x12, 0x18,
|
||||||
0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x0a, 0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xd7, 0x03, 0x0a, 0x0d, 0x44, 0x72, 0x69,
|
0x07, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x22, 0xf3, 0x03, 0x0a, 0x0d, 0x44, 0x72, 0x69,
|
||||||
0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x04, 0x75, 0x73,
|
0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x12, 0x19, 0x0a, 0x04, 0x75, 0x73,
|
||||||
0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52,
|
0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52,
|
||||||
0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x03, 0x63, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01,
|
0x04, 0x75, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x0a, 0x03, 0x63, 0x61, 0x72, 0x18, 0x02, 0x20, 0x01,
|
||||||
0x28, 0x0b, 0x32, 0x04, 0x2e, 0x43, 0x61, 0x72, 0x52, 0x03, 0x63, 0x61, 0x72, 0x12, 0x4e, 0x0a,
|
0x28, 0x0b, 0x32, 0x04, 0x2e, 0x43, 0x61, 0x72, 0x48, 0x01, 0x52, 0x03, 0x63, 0x61, 0x72, 0x88,
|
||||||
0x15, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72,
|
0x01, 0x01, 0x12, 0x4e, 0x0a, 0x15, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x70,
|
||||||
0x65, 0x5f, 0x44, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67,
|
0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x44, 0x61, 0x74, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28,
|
||||||
0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54,
|
0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x13, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
|
0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x13, 0x64,
|
||||||
0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a,
|
0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x44, 0x61,
|
||||||
0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x50,
|
0x74, 0x65, 0x12, 0x21, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28,
|
||||||
0x72, 0x69, 0x63, 0x65, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x38, 0x0a, 0x18, 0x64,
|
0x0b, 0x32, 0x06, 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x48, 0x02, 0x52, 0x05, 0x70, 0x72, 0x69,
|
||||||
0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f,
|
0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x38, 0x0a, 0x18, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f,
|
||||||
0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x64,
|
0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
|
||||||
0x72, 0x69, 0x76, 0x65, 0x72, 0x44, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x41, 0x64,
|
0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x16, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x44,
|
||||||
0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x6d, 0x0a, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65,
|
|
||||||
0x64, 0x5f, 0x70, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c,
|
|
||||||
0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
|
||||||
0x21, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75,
|
|
||||||
0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c,
|
|
||||||
0x6f, 0x74, 0x48, 0x00, 0x52, 0x1e, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75,
|
|
||||||
0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
|
||||||
0x74, 0x69, 0x65, 0x73, 0x12, 0x6a, 0x0a, 0x1f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64,
|
|
||||||
0x5f, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
|
|
||||||
0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e,
|
|
||||||
0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41,
|
|
||||||
0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x48,
|
|
||||||
0x00, 0x52, 0x1d, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, 0x75, 0x6c,
|
|
||||||
0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73,
|
|
||||||
0x42, 0x10, 0x0a, 0x0e, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69,
|
|
||||||
0x65, 0x73, 0x22, 0x76, 0x0a, 0x20, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75,
|
|
||||||
0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
|
||||||
0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x52, 0x0a, 0x17, 0x70, 0x75, 0x6e, 0x63, 0x74, 0x75,
|
|
||||||
0x61, 0x6c, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65,
|
|
||||||
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75,
|
|
||||||
0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c,
|
|
||||||
0x6f, 0x74, 0x52, 0x16, 0x70, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69,
|
|
||||||
0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x72, 0x0a, 0x1f, 0x52, 0x65,
|
|
||||||
0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61,
|
|
||||||
0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x4f, 0x0a,
|
|
||||||
0x16, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
|
|
||||||
0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e,
|
|
||||||
0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c,
|
|
||||||
0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x15, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72,
|
|
||||||
0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0xcc,
|
|
||||||
0x01, 0x0a, 0x0d, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
|
||||||
0x12, 0x2f, 0x0a, 0x0e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65,
|
|
||||||
0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75,
|
|
||||||
0x72, 0x65, 0x52, 0x0d, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73,
|
|
||||||
0x73, 0x12, 0x23, 0x0a, 0x0d, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x72, 0x61, 0x64, 0x69,
|
|
||||||
0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
|
|
||||||
0x52, 0x61, 0x64, 0x69, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
|
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x06, 0x64,
|
|
||||||
0x72, 0x69, 0x76, 0x65, 0x72, 0x12, 0x2e, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
|
|
||||||
0x6e, 0x63, 0x65, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x72, 0x65,
|
|
||||||
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72,
|
|
||||||
0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x16, 0x0a, 0x03, 0x63, 0x61, 0x72, 0x18, 0x05, 0x20, 0x01,
|
|
||||||
0x28, 0x0b, 0x32, 0x04, 0x2e, 0x43, 0x61, 0x72, 0x52, 0x03, 0x63, 0x61, 0x72, 0x22, 0x82, 0x01,
|
|
||||||
0x0a, 0x18, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61,
|
|
||||||
0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x64, 0x61,
|
|
||||||
0x74, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c,
|
|
||||||
0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73,
|
|
||||||
0x74, 0x61, 0x6d, 0x70, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74,
|
|
||||||
0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73,
|
|
||||||
0x74, 0x61, 0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54,
|
|
||||||
0x69, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69,
|
|
||||||
0x6d, 0x65, 0x22, 0x7b, 0x0a, 0x17, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61,
|
|
||||||
0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x28, 0x0a,
|
|
||||||
0x09, 0x64, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e,
|
|
||||||
0x32, 0x0a, 0x2e, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x09, 0x64, 0x61,
|
|
||||||
0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74,
|
|
||||||
0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72,
|
|
||||||
0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
|
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22,
|
|
||||||
0xb5, 0x02, 0x0a, 0x0e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65,
|
|
||||||
0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02,
|
|
||||||
0x69, 0x64, 0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x49,
|
|
||||||
0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67,
|
|
||||||
0x65, 0x72, 0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64,
|
|
||||||
0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64,
|
|
||||||
0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e,
|
|
||||||
0x32, 0x0e, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
|
||||||
0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, 0x0a, 0x11, 0x64, 0x65, 0x70, 0x61,
|
|
||||||
0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20,
|
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x10, 0x64,
|
|
||||||
0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12,
|
0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12,
|
||||||
0x39, 0x0a, 0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61,
|
0x6d, 0x0a, 0x20, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x70, 0x75, 0x6e, 0x63,
|
||||||
0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46,
|
0x74, 0x75, 0x61, 0x6c, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
||||||
0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74,
|
0x69, 0x65, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x52, 0x65, 0x70, 0x65,
|
||||||
0x69, 0x6f, 0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x70, 0x69,
|
0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69,
|
||||||
0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x1e,
|
||||||
0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75,
|
0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c,
|
||||||
0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x70, 0x69, 0x63,
|
0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x6a,
|
||||||
0x6b, 0x75, 0x70, 0x44, 0x61, 0x74, 0x65, 0x22, 0x8e, 0x04, 0x0a, 0x07, 0x42, 0x6f, 0x6f, 0x6b,
|
0x0a, 0x1f, 0x72, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x5f, 0x72, 0x65, 0x67, 0x75, 0x6c,
|
||||||
0x69, 0x6e, 0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
0x61, 0x72, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65,
|
||||||
0x02, 0x69, 0x64, 0x12, 0x1d, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20,
|
0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74,
|
||||||
0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76,
|
0x65, 0x64, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
|
||||||
0x65, 0x72, 0x12, 0x23, 0x0a, 0x09, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x18,
|
0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x48, 0x00, 0x52, 0x1d, 0x72, 0x65, 0x70,
|
||||||
0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x09, 0x70, 0x61,
|
0x65, 0x61, 0x74, 0x65, 0x64, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69,
|
||||||
0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x13, 0x70, 0x61, 0x73, 0x73, 0x65,
|
0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x42, 0x10, 0x0a, 0x0e, 0x61, 0x76,
|
||||||
0x6e, 0x67, 0x65, 0x72, 0x50, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x61, 0x74, 0x65, 0x18, 0x04,
|
0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x42, 0x06, 0x0a, 0x04,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
|
0x5f, 0x63, 0x61, 0x72, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x70, 0x72, 0x69, 0x63, 0x65, 0x22, 0x76,
|
||||||
0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70,
|
0x0a, 0x20, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74, 0x65, 0x64, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75,
|
||||||
0x52, 0x13, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x50, 0x69, 0x63, 0x6b, 0x75,
|
0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c,
|
||||||
0x70, 0x44, 0x61, 0x74, 0x65, 0x12, 0x44, 0x0a, 0x19, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67,
|
0x6f, 0x74, 0x12, 0x52, 0x0a, 0x17, 0x70, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x5f, 0x61,
|
||||||
0x65, 0x72, 0x5f, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x72, 0x6f, 0x75,
|
0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x01, 0x20,
|
||||||
0x74, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75,
|
0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76,
|
||||||
0x72, 0x65, 0x52, 0x17, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x44, 0x65, 0x70,
|
0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x16,
|
||||||
0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x48, 0x0a, 0x1b, 0x70,
|
0x70, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69,
|
||||||
0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61,
|
0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x72, 0x0a, 0x1f, 0x52, 0x65, 0x70, 0x65, 0x61, 0x74,
|
||||||
0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b,
|
0x65, 0x64, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
|
||||||
0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x19, 0x70, 0x61, 0x73, 0x73,
|
0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x4f, 0x0a, 0x16, 0x72, 0x65, 0x67,
|
||||||
0x65, 0x6e, 0x67, 0x65, 0x72, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e,
|
0x75, 0x6c, 0x61, 0x72, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
||||||
0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18,
|
0x69, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x52, 0x65, 0x67, 0x75,
|
||||||
0x07, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53,
|
0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53,
|
||||||
0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1a, 0x0a,
|
0x6c, 0x6f, 0x74, 0x52, 0x15, 0x72, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69,
|
||||||
0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x52,
|
0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0xee, 0x01, 0x0a, 0x0d, 0x44,
|
||||||
0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x69, 0x73,
|
0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2f, 0x0a, 0x0e,
|
||||||
0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x52, 0x08, 0x64, 0x69, 0x73,
|
0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x01,
|
||||||
0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1c, 0x0a, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a,
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x0d,
|
||||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x52, 0x05, 0x70, 0x72,
|
0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x23, 0x0a,
|
||||||
0x69, 0x63, 0x65, 0x12, 0x16, 0x0a, 0x03, 0x63, 0x61, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b,
|
0x0d, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x18, 0x02,
|
||||||
0x32, 0x04, 0x2e, 0x43, 0x61, 0x72, 0x52, 0x03, 0x63, 0x61, 0x72, 0x12, 0x3b, 0x0a, 0x0b, 0x70,
|
0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x61, 0x64, 0x69,
|
||||||
0x69, 0x63, 0x6b, 0x75, 0x70, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b,
|
0x75, 0x73, 0x12, 0x1d, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01,
|
||||||
0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65,
|
||||||
0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x70, 0x69,
|
0x72, 0x12, 0x33, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73,
|
||||||
0x63, 0x6b, 0x75, 0x70, 0x44, 0x61, 0x74, 0x65, 0x22, 0x31, 0x0a, 0x03, 0x43, 0x61, 0x72, 0x12,
|
0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
|
||||||
0x14, 0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05,
|
0x6e, 0x63, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e,
|
||||||
0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x18, 0x02,
|
0x63, 0x65, 0x73, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x03, 0x63, 0x61, 0x72, 0x18, 0x05, 0x20,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x22, 0x97, 0x01, 0x0a, 0x0b,
|
0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x43, 0x61, 0x72, 0x48, 0x01, 0x52, 0x03, 0x63, 0x61, 0x72,
|
||||||
0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x73,
|
0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e,
|
||||||
0x6d, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x6d,
|
0x63, 0x65, 0x73, 0x42, 0x06, 0x0a, 0x04, 0x5f, 0x63, 0x61, 0x72, 0x22, 0x82, 0x01, 0x0a, 0x18,
|
||||||
0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x73,
|
0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69,
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x61, 0x6e, 0x69, 0x6d, 0x61, 0x6c, 0x73, 0x12,
|
0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x65,
|
||||||
0x14, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x05,
|
0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||||
0x6d, 0x75, 0x73, 0x69, 0x63, 0x12, 0x1b, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x74, 0x61, 0x6c, 0x6b,
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||||
0x65, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, 0x69, 0x73, 0x54, 0x61, 0x6c, 0x6b,
|
0x6d, 0x70, 0x52, 0x04, 0x64, 0x61, 0x74, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72,
|
||||||
0x65, 0x72, 0x12, 0x21, 0x0a, 0x0c, 0x6c, 0x75, 0x67, 0x67, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69,
|
0x74, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61,
|
||||||
0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x6c, 0x75, 0x67, 0x67, 0x61, 0x67,
|
0x72, 0x74, 0x54, 0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d,
|
||||||
0x65, 0x53, 0x69, 0x7a, 0x65, 0x22, 0x5b, 0x0a, 0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1e,
|
0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65,
|
||||||
0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x50,
|
0x22, 0x7b, 0x0a, 0x17, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c,
|
||||||
0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x16,
|
0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x12, 0x28, 0x0a, 0x09, 0x64,
|
||||||
0x0a, 0x06, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x52, 0x06,
|
0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a,
|
||||||
0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
|
0x2e, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x52, 0x09, 0x64, 0x61, 0x79, 0x4f,
|
||||||
0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e,
|
0x66, 0x57, 0x65, 0x65, 0x6b, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54, 0x69,
|
||||||
0x63, 0x79, 0x22, 0xdd, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69,
|
0x6d, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x74, 0x61, 0x72, 0x74, 0x54,
|
||||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61,
|
0x69, 0x6d, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x18, 0x03,
|
||||||
0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x65, 0x6e, 0x64, 0x54, 0x69, 0x6d, 0x65, 0x22, 0xb5, 0x02,
|
||||||
0x73, 0x12, 0x1d, 0x0a, 0x0a, 0x66, 0x69, 0x72, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18,
|
0x0a, 0x0e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65,
|
0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64,
|
||||||
0x12, 0x1b, 0x0a, 0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20,
|
0x12, 0x20, 0x0a, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x49, 0x64, 0x18,
|
||||||
0x01, 0x28, 0x09, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a,
|
0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72,
|
||||||
0x05, 0x67, 0x72, 0x61, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x52, 0x05, 0x67, 0x72,
|
0x49, 0x64, 0x12, 0x1a, 0x0a, 0x08, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x18, 0x03,
|
||||||
0x61, 0x64, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x06,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x49, 0x64, 0x12, 0x26,
|
||||||
0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x12, 0x16, 0x0a,
|
0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e,
|
||||||
0x06, 0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x67,
|
0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06,
|
||||||
0x65, 0x6e, 0x64, 0x65, 0x72, 0x12, 0x2b, 0x0a, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65,
|
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x35, 0x0a, 0x11, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74,
|
||||||
0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28, 0x08,
|
0x75, 0x72, 0x65, 0x5f, 0x61, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28,
|
||||||
0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69,
|
0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x10, 0x64, 0x65, 0x70,
|
||||||
0x74, 0x79, 0x2a, 0x4a, 0x0a, 0x09, 0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x12,
|
0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x39, 0x0a,
|
||||||
0x07, 0x0a, 0x03, 0x4d, 0x4f, 0x4e, 0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x55, 0x45, 0x10,
|
0x13, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x61, 0x64, 0x64,
|
||||||
0x01, 0x12, 0x07, 0x0a, 0x03, 0x57, 0x45, 0x44, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x48,
|
0x72, 0x65, 0x73, 0x73, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61,
|
||||||
0x55, 0x10, 0x04, 0x12, 0x07, 0x0a, 0x03, 0x46, 0x52, 0x49, 0x10, 0x05, 0x12, 0x07, 0x0a, 0x03,
|
0x74, 0x75, 0x72, 0x65, 0x52, 0x12, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f,
|
||||||
0x53, 0x41, 0x54, 0x10, 0x06, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x55, 0x4e, 0x10, 0x07, 0x2a, 0x2e,
|
0x6e, 0x41, 0x64, 0x64, 0x72, 0x65, 0x73, 0x73, 0x12, 0x3b, 0x0a, 0x0b, 0x70, 0x69, 0x63, 0x6b,
|
||||||
0x0a, 0x09, 0x50, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46,
|
0x75, 0x70, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||||
0x52, 0x45, 0x45, 0x10, 0x00, 0x12, 0x0a, 0x0a, 0x06, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x47, 0x10,
|
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||||
0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55, 0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x2a, 0xb2,
|
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x70, 0x69, 0x63, 0x6b, 0x75,
|
||||||
0x01, 0x0a, 0x0d, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
0x70, 0x44, 0x61, 0x74, 0x65, 0x22, 0xbf, 0x04, 0x0a, 0x07, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e,
|
||||||
0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4e, 0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12,
|
0x67, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69,
|
||||||
0x1f, 0x0a, 0x1b, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x44, 0x52, 0x49, 0x56, 0x45,
|
0x64, 0x12, 0x1d, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x18, 0x02, 0x20, 0x01, 0x28,
|
||||||
0x52, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01,
|
0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
|
||||||
0x12, 0x22, 0x0a, 0x1e, 0x57, 0x41, 0x49, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x41, 0x53, 0x53,
|
0x12, 0x23, 0x0a, 0x09, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x03, 0x20,
|
||||||
0x45, 0x4e, 0x47, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x41, 0x54, 0x49,
|
0x01, 0x28, 0x0b, 0x32, 0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x09, 0x70, 0x61, 0x73, 0x73,
|
||||||
0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45,
|
0x65, 0x6e, 0x67, 0x65, 0x72, 0x12, 0x4c, 0x0a, 0x13, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67,
|
||||||
0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44,
|
0x65, 0x72, 0x50, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x44, 0x61, 0x74, 0x65, 0x18, 0x04, 0x20, 0x01,
|
||||||
0x10, 0x04, 0x12, 0x20, 0x0a, 0x1c, 0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x5f,
|
0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||||
0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e, 0x47, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49,
|
0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x13,
|
||||||
0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0d, 0x0a, 0x09, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45,
|
0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x50, 0x69, 0x63, 0x6b, 0x75, 0x70, 0x44,
|
||||||
0x44, 0x10, 0x06, 0x2a, 0x25, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12,
|
0x61, 0x74, 0x65, 0x12, 0x44, 0x0a, 0x19, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72,
|
||||||
0x0a, 0x0a, 0x06, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x70,
|
0x5f, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65,
|
||||||
0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x10, 0x01, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69,
|
0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65,
|
||||||
0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70,
|
0x52, 0x17, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x44, 0x65, 0x70, 0x61, 0x72,
|
||||||
0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x69,
|
0x74, 0x75, 0x72, 0x65, 0x52, 0x6f, 0x75, 0x74, 0x65, 0x12, 0x48, 0x0a, 0x1b, 0x70, 0x61, 0x73,
|
||||||
0x64, 0x61, 0x72, 0x69, 0x74, 0x79, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73,
|
0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x5f, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69,
|
||||||
0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74,
|
0x6f, 0x6e, 0x5f, 0x72, 0x6f, 0x75, 0x74, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08,
|
||||||
0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x19, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e,
|
||||||
|
0x67, 0x65, 0x72, 0x44, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x6f,
|
||||||
|
0x75, 0x74, 0x65, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x07, 0x20,
|
||||||
|
0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61,
|
||||||
|
0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1f, 0x0a, 0x08, 0x64,
|
||||||
|
0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x03, 0x48, 0x00, 0x52,
|
||||||
|
0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08,
|
||||||
|
0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x18, 0x09, 0x20, 0x01, 0x28, 0x03, 0x48, 0x01,
|
||||||
|
0x52, 0x08, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1c, 0x0a,
|
||||||
|
0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x06, 0x2e, 0x50,
|
||||||
|
0x72, 0x69, 0x63, 0x65, 0x52, 0x05, 0x70, 0x72, 0x69, 0x63, 0x65, 0x12, 0x1b, 0x0a, 0x03, 0x63,
|
||||||
|
0x61, 0x72, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x04, 0x2e, 0x43, 0x61, 0x72, 0x48, 0x02,
|
||||||
|
0x52, 0x03, 0x63, 0x61, 0x72, 0x88, 0x01, 0x01, 0x12, 0x3b, 0x0a, 0x0b, 0x70, 0x69, 0x63, 0x6b,
|
||||||
|
0x75, 0x70, 0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e,
|
||||||
|
0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e,
|
||||||
|
0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0a, 0x70, 0x69, 0x63, 0x6b, 0x75,
|
||||||
|
0x70, 0x44, 0x61, 0x74, 0x65, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69,
|
||||||
|
0x6f, 0x6e, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x42,
|
||||||
|
0x06, 0x0a, 0x04, 0x5f, 0x63, 0x61, 0x72, 0x22, 0x4f, 0x0a, 0x03, 0x43, 0x61, 0x72, 0x12, 0x19,
|
||||||
|
0x0a, 0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
|
||||||
|
0x05, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x62, 0x72, 0x61,
|
||||||
|
0x6e, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x01, 0x52, 0x05, 0x62, 0x72, 0x61, 0x6e,
|
||||||
|
0x64, 0x88, 0x01, 0x01, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x42, 0x08,
|
||||||
|
0x0a, 0x06, 0x5f, 0x62, 0x72, 0x61, 0x6e, 0x64, 0x22, 0xf1, 0x01, 0x0a, 0x0b, 0x50, 0x72, 0x65,
|
||||||
|
0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x73, 0x6d, 0x6f, 0x6b,
|
||||||
|
0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x48, 0x00, 0x52, 0x07, 0x73, 0x6d, 0x6f,
|
||||||
|
0x6b, 0x69, 0x6e, 0x67, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x61, 0x6e, 0x69, 0x6d, 0x61,
|
||||||
|
0x6c, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x48, 0x01, 0x52, 0x07, 0x61, 0x6e, 0x69, 0x6d,
|
||||||
|
0x61, 0x6c, 0x73, 0x88, 0x01, 0x01, 0x12, 0x19, 0x0a, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x18,
|
||||||
|
0x03, 0x20, 0x01, 0x28, 0x08, 0x48, 0x02, 0x52, 0x05, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x88, 0x01,
|
||||||
|
0x01, 0x12, 0x20, 0x0a, 0x09, 0x69, 0x73, 0x5f, 0x74, 0x61, 0x6c, 0x6b, 0x65, 0x72, 0x18, 0x04,
|
||||||
|
0x20, 0x01, 0x28, 0x08, 0x48, 0x03, 0x52, 0x08, 0x69, 0x73, 0x54, 0x61, 0x6c, 0x6b, 0x65, 0x72,
|
||||||
|
0x88, 0x01, 0x01, 0x12, 0x26, 0x0a, 0x0c, 0x6c, 0x75, 0x67, 0x67, 0x61, 0x67, 0x65, 0x5f, 0x73,
|
||||||
|
0x69, 0x7a, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x04, 0x52, 0x0b, 0x6c, 0x75, 0x67,
|
||||||
|
0x67, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f,
|
||||||
|
0x73, 0x6d, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x61, 0x6e, 0x69, 0x6d,
|
||||||
|
0x61, 0x6c, 0x73, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x6d, 0x75, 0x73, 0x69, 0x63, 0x42, 0x0c, 0x0a,
|
||||||
|
0x0a, 0x5f, 0x69, 0x73, 0x5f, 0x74, 0x61, 0x6c, 0x6b, 0x65, 0x72, 0x42, 0x0f, 0x0a, 0x0d, 0x5f,
|
||||||
|
0x6c, 0x75, 0x67, 0x67, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65, 0x22, 0x8b, 0x01, 0x0a,
|
||||||
|
0x05, 0x50, 0x72, 0x69, 0x63, 0x65, 0x12, 0x23, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x0e, 0x32, 0x0a, 0x2e, 0x50, 0x72, 0x69, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65,
|
||||||
|
0x48, 0x00, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x61,
|
||||||
|
0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x01, 0x48, 0x01, 0x52, 0x06, 0x61,
|
||||||
|
0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x88, 0x01, 0x01, 0x12, 0x1f, 0x0a, 0x08, 0x63, 0x75, 0x72, 0x72,
|
||||||
|
0x65, 0x6e, 0x63, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x02, 0x52, 0x08, 0x63, 0x75,
|
||||||
|
0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x88, 0x01, 0x01, 0x42, 0x07, 0x0a, 0x05, 0x5f, 0x74, 0x79,
|
||||||
|
0x70, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f, 0x61, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x42, 0x0b, 0x0a,
|
||||||
|
0x09, 0x5f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x63, 0x79, 0x22, 0xcf, 0x02, 0x0a, 0x04, 0x55,
|
||||||
|
0x73, 0x65, 0x72, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||||
|
0x02, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x18, 0x02, 0x20, 0x01,
|
||||||
|
0x28, 0x09, 0x52, 0x05, 0x61, 0x6c, 0x69, 0x61, 0x73, 0x12, 0x22, 0x0a, 0x0a, 0x66, 0x69, 0x72,
|
||||||
|
0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
|
||||||
|
0x09, 0x66, 0x69, 0x72, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12, 0x20, 0x0a,
|
||||||
|
0x09, 0x6c, 0x61, 0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
|
||||||
|
0x48, 0x01, 0x52, 0x08, 0x6c, 0x61, 0x73, 0x74, 0x4e, 0x61, 0x6d, 0x65, 0x88, 0x01, 0x01, 0x12,
|
||||||
|
0x19, 0x0a, 0x05, 0x67, 0x72, 0x61, 0x64, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x03, 0x48, 0x02,
|
||||||
|
0x52, 0x05, 0x67, 0x72, 0x61, 0x64, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1d, 0x0a, 0x07, 0x70, 0x69,
|
||||||
|
0x63, 0x74, 0x75, 0x72, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x48, 0x03, 0x52, 0x07, 0x70,
|
||||||
|
0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x88, 0x01, 0x01, 0x12, 0x1b, 0x0a, 0x06, 0x67, 0x65, 0x6e,
|
||||||
|
0x64, 0x65, 0x72, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x48, 0x04, 0x52, 0x06, 0x67, 0x65, 0x6e,
|
||||||
|
0x64, 0x65, 0x72, 0x88, 0x01, 0x01, 0x12, 0x30, 0x0a, 0x11, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69,
|
||||||
|
0x65, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x18, 0x08, 0x20, 0x01, 0x28,
|
||||||
|
0x08, 0x48, 0x05, 0x52, 0x10, 0x76, 0x65, 0x72, 0x69, 0x66, 0x69, 0x65, 0x64, 0x49, 0x64, 0x65,
|
||||||
|
0x6e, 0x74, 0x69, 0x74, 0x79, 0x88, 0x01, 0x01, 0x42, 0x0d, 0x0a, 0x0b, 0x5f, 0x66, 0x69, 0x72,
|
||||||
|
0x73, 0x74, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x6c, 0x61, 0x73, 0x74,
|
||||||
|
0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x42, 0x08, 0x0a, 0x06, 0x5f, 0x67, 0x72, 0x61, 0x64, 0x65, 0x42,
|
||||||
|
0x0a, 0x0a, 0x08, 0x5f, 0x70, 0x69, 0x63, 0x74, 0x75, 0x72, 0x65, 0x42, 0x09, 0x0a, 0x07, 0x5f,
|
||||||
|
0x67, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x42, 0x14, 0x0a, 0x12, 0x5f, 0x76, 0x65, 0x72, 0x69, 0x66,
|
||||||
|
0x69, 0x65, 0x64, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x2a, 0x4a, 0x0a, 0x09,
|
||||||
|
0x44, 0x61, 0x79, 0x4f, 0x66, 0x57, 0x65, 0x65, 0x6b, 0x12, 0x07, 0x0a, 0x03, 0x4d, 0x4f, 0x4e,
|
||||||
|
0x10, 0x00, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x55, 0x45, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x57,
|
||||||
|
0x45, 0x44, 0x10, 0x03, 0x12, 0x07, 0x0a, 0x03, 0x54, 0x48, 0x55, 0x10, 0x04, 0x12, 0x07, 0x0a,
|
||||||
|
0x03, 0x46, 0x52, 0x49, 0x10, 0x05, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x41, 0x54, 0x10, 0x06, 0x12,
|
||||||
|
0x07, 0x0a, 0x03, 0x53, 0x55, 0x4e, 0x10, 0x07, 0x2a, 0x2e, 0x0a, 0x09, 0x50, 0x72, 0x69, 0x63,
|
||||||
|
0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x08, 0x0a, 0x04, 0x46, 0x52, 0x45, 0x45, 0x10, 0x00, 0x12,
|
||||||
|
0x0a, 0x0a, 0x06, 0x50, 0x41, 0x59, 0x49, 0x4e, 0x47, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x55,
|
||||||
|
0x4e, 0x4b, 0x4e, 0x4f, 0x57, 0x4e, 0x10, 0x02, 0x2a, 0xb2, 0x01, 0x0a, 0x0d, 0x42, 0x6f, 0x6f,
|
||||||
|
0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x0d, 0x0a, 0x09, 0x49, 0x4e,
|
||||||
|
0x49, 0x54, 0x49, 0x41, 0x54, 0x45, 0x44, 0x10, 0x00, 0x12, 0x1f, 0x0a, 0x1b, 0x57, 0x41, 0x49,
|
||||||
|
0x54, 0x49, 0x4e, 0x47, 0x5f, 0x44, 0x52, 0x49, 0x56, 0x45, 0x52, 0x5f, 0x43, 0x4f, 0x4e, 0x46,
|
||||||
|
0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x01, 0x12, 0x22, 0x0a, 0x1e, 0x57, 0x41,
|
||||||
|
0x49, 0x54, 0x49, 0x4e, 0x47, 0x5f, 0x50, 0x41, 0x53, 0x53, 0x45, 0x4e, 0x47, 0x45, 0x52, 0x5f,
|
||||||
|
0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x02, 0x12, 0x0d,
|
||||||
|
0x0a, 0x09, 0x43, 0x4f, 0x4e, 0x46, 0x49, 0x52, 0x4d, 0x45, 0x44, 0x10, 0x03, 0x12, 0x0d, 0x0a,
|
||||||
|
0x09, 0x43, 0x41, 0x4e, 0x43, 0x45, 0x4c, 0x4c, 0x45, 0x44, 0x10, 0x04, 0x12, 0x20, 0x0a, 0x1c,
|
||||||
|
0x43, 0x4f, 0x4d, 0x50, 0x4c, 0x45, 0x54, 0x45, 0x44, 0x5f, 0x50, 0x45, 0x4e, 0x44, 0x49, 0x4e,
|
||||||
|
0x47, 0x5f, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x49, 0x4f, 0x4e, 0x10, 0x05, 0x12, 0x0d,
|
||||||
|
0x0a, 0x09, 0x56, 0x41, 0x4c, 0x49, 0x44, 0x41, 0x54, 0x45, 0x44, 0x10, 0x06, 0x2a, 0x25, 0x0a,
|
||||||
|
0x08, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x0a, 0x0a, 0x06, 0x64, 0x72, 0x69,
|
||||||
|
0x76, 0x65, 0x72, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67,
|
||||||
|
0x65, 0x72, 0x10, 0x01, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70,
|
||||||
|
0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61,
|
||||||
|
0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x72, 0x69, 0x74, 0x79,
|
||||||
|
0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73,
|
||||||
|
0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f,
|
||||||
|
0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -1686,6 +1712,12 @@ func file_solidarity_api_types_proto_init() {
|
||||||
(*DriverJourney_RepeatedPunctualAvailabilities)(nil),
|
(*DriverJourney_RepeatedPunctualAvailabilities)(nil),
|
||||||
(*DriverJourney_RepeatedRegularAvailabilities)(nil),
|
(*DriverJourney_RepeatedRegularAvailabilities)(nil),
|
||||||
}
|
}
|
||||||
|
file_solidarity_api_types_proto_msgTypes[4].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_types_proto_msgTypes[8].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_types_proto_msgTypes[9].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_types_proto_msgTypes[10].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_types_proto_msgTypes[11].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_types_proto_msgTypes[12].OneofWrappers = []interface{}{}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
|
|
|
@ -12,9 +12,9 @@ message Feature {
|
||||||
|
|
||||||
message DriverJourney {
|
message DriverJourney {
|
||||||
User user = 1;
|
User user = 1;
|
||||||
Car car = 2;
|
optional Car car = 2;
|
||||||
google.protobuf.Timestamp driver_departure_Date = 3;
|
google.protobuf.Timestamp driver_departure_Date = 3;
|
||||||
Price price = 4;
|
optional Price price = 4;
|
||||||
string driver_departure_Address = 5;
|
string driver_departure_Address = 5;
|
||||||
oneof availabilities {
|
oneof availabilities {
|
||||||
RepeatedPunctualAvailabilitySlot repeated_punctual_availabilities = 6;
|
RepeatedPunctualAvailabilitySlot repeated_punctual_availabilities = 6;
|
||||||
|
@ -33,8 +33,8 @@ message DriverRequest{
|
||||||
Feature driver_address = 1;
|
Feature driver_address = 1;
|
||||||
int32 driver_radius = 2;
|
int32 driver_radius = 2;
|
||||||
User driver = 3;
|
User driver = 3;
|
||||||
Preferences preferences = 4;
|
optional Preferences preferences = 4;
|
||||||
Car car = 5;
|
optional Car car = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PunctualAvailabilitySlot {
|
message PunctualAvailabilitySlot {
|
||||||
|
@ -76,25 +76,25 @@ message Booking {
|
||||||
Feature passenger_departure_route = 5;
|
Feature passenger_departure_route = 5;
|
||||||
Feature passenger_destination_route = 6;
|
Feature passenger_destination_route = 6;
|
||||||
BookingStatus status = 7;
|
BookingStatus status = 7;
|
||||||
int64 duration = 8;
|
optional int64 duration = 8;
|
||||||
int64 distance = 9;
|
optional int64 distance = 9;
|
||||||
Price price = 10;
|
Price price = 10;
|
||||||
Car car = 11;
|
optional Car car = 11;
|
||||||
google.protobuf.Timestamp pickup_date = 12;
|
google.protobuf.Timestamp pickup_date = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
message Car {
|
message Car {
|
||||||
string model = 1;
|
optional string model = 1;
|
||||||
string brand = 2;
|
optional string brand = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Preferences {
|
message Preferences {
|
||||||
bool smoking = 1;
|
optional bool smoking = 1;
|
||||||
bool animals = 2;
|
optional bool animals = 2;
|
||||||
bool music = 3;
|
optional bool music = 3;
|
||||||
bool is_talker = 4;
|
optional bool is_talker = 4;
|
||||||
int64 luggage_size = 5;
|
optional int64 luggage_size = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,20 +105,20 @@ enum PriceType {
|
||||||
}
|
}
|
||||||
|
|
||||||
message Price {
|
message Price {
|
||||||
PriceType type = 1;
|
optional PriceType type = 1;
|
||||||
double amount = 2;
|
optional double amount = 2;
|
||||||
string currency = 3;
|
optional string currency = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message User {
|
message User {
|
||||||
string id = 1;
|
string id = 1;
|
||||||
string alias = 2;
|
string alias = 2;
|
||||||
string first_name = 3;
|
optional string first_name = 3;
|
||||||
string last_name = 4;
|
optional string last_name = 4;
|
||||||
int64 grade = 5;
|
optional int64 grade = 5;
|
||||||
string picture = 6;
|
optional string picture = 6;
|
||||||
string gender = 7;
|
optional string gender = 7;
|
||||||
bool verified_identity = 8;
|
optional bool verified_identity = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum BookingStatus {
|
enum BookingStatus {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// protoc-gen-go v1.27.1
|
// protoc-gen-go v1.30.0
|
||||||
// protoc v3.12.4
|
// protoc v3.12.4
|
||||||
// source: solidarity-api.proto
|
// source: solidarity-api.proto
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ type PassengerTripRequest struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Passenger *User `protobuf:"bytes,1,opt,name=passenger,proto3" json:"passenger,omitempty"`
|
Passenger *User `protobuf:"bytes,1,opt,name=passenger,proto3" json:"passenger,omitempty"`
|
||||||
Preferences *Preferences `protobuf:"bytes,2,opt,name=preferences,proto3" json:"preferences,omitempty"`
|
Preferences *Preferences `protobuf:"bytes,2,opt,name=preferences,proto3,oneof" json:"preferences,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PassengerTripRequest) Reset() {
|
func (x *PassengerTripRequest) Reset() {
|
||||||
|
@ -192,7 +192,7 @@ type PassengerTripResponse struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
Message *string `protobuf:"bytes,2,opt,name=message,proto3,oneof" json:"message,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PassengerTripResponse) Reset() {
|
func (x *PassengerTripResponse) Reset() {
|
||||||
|
@ -235,8 +235,8 @@ func (x *PassengerTripResponse) GetSuccess() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *PassengerTripResponse) GetMessage() string {
|
func (x *PassengerTripResponse) GetMessage() string {
|
||||||
if x != nil {
|
if x != nil && x.Message != nil {
|
||||||
return x.Message
|
return *x.Message
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ type DriverAvailabilitiesResponse struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
Message *string `protobuf:"bytes,2,opt,name=message,proto3,oneof" json:"message,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DriverAvailabilitiesResponse) Reset() {
|
func (x *DriverAvailabilitiesResponse) Reset() {
|
||||||
|
@ -290,8 +290,8 @@ func (x *DriverAvailabilitiesResponse) GetSuccess() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *DriverAvailabilitiesResponse) GetMessage() string {
|
func (x *DriverAvailabilitiesResponse) GetMessage() string {
|
||||||
if x != nil {
|
if x != nil && x.Message != nil {
|
||||||
return x.Message
|
return *x.Message
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -397,7 +397,7 @@ type UpdateBookingRequest struct {
|
||||||
|
|
||||||
BookingId string `protobuf:"bytes,1,opt,name=booking_id,json=bookingId,proto3" json:"booking_id,omitempty"`
|
BookingId string `protobuf:"bytes,1,opt,name=booking_id,json=bookingId,proto3" json:"booking_id,omitempty"`
|
||||||
Status BookingStatus `protobuf:"varint,2,opt,name=status,proto3,enum=BookingStatus" json:"status,omitempty"`
|
Status BookingStatus `protobuf:"varint,2,opt,name=status,proto3,enum=BookingStatus" json:"status,omitempty"`
|
||||||
Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"`
|
Message *string `protobuf:"bytes,3,opt,name=message,proto3,oneof" json:"message,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdateBookingRequest) Reset() {
|
func (x *UpdateBookingRequest) Reset() {
|
||||||
|
@ -447,8 +447,8 @@ func (x *UpdateBookingRequest) GetStatus() BookingStatus {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdateBookingRequest) GetMessage() string {
|
func (x *UpdateBookingRequest) GetMessage() string {
|
||||||
if x != nil {
|
if x != nil && x.Message != nil {
|
||||||
return x.Message
|
return *x.Message
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -459,7 +459,7 @@ type UpdateBookingResponse struct {
|
||||||
unknownFields protoimpl.UnknownFields
|
unknownFields protoimpl.UnknownFields
|
||||||
|
|
||||||
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
Success bool `protobuf:"varint,1,opt,name=success,proto3" json:"success,omitempty"`
|
||||||
Message string `protobuf:"bytes,2,opt,name=message,proto3" json:"message,omitempty"`
|
Message *string `protobuf:"bytes,2,opt,name=message,proto3,oneof" json:"message,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdateBookingResponse) Reset() {
|
func (x *UpdateBookingResponse) Reset() {
|
||||||
|
@ -502,8 +502,8 @@ func (x *UpdateBookingResponse) GetSuccess() bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (x *UpdateBookingResponse) GetMessage() string {
|
func (x *UpdateBookingResponse) GetMessage() string {
|
||||||
if x != nil {
|
if x != nil && x.Message != nil {
|
||||||
return x.Message
|
return *x.Message
|
||||||
}
|
}
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
@ -822,141 +822,147 @@ var file_solidarity_api_proto_rawDesc = []byte{
|
||||||
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
|
0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,
|
||||||
0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x72,
|
0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1a, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x72,
|
||||||
0x69, 0x74, 0x79, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72,
|
0x69, 0x74, 0x79, 0x2d, 0x61, 0x70, 0x69, 0x2d, 0x74, 0x79, 0x70, 0x65, 0x73, 0x2e, 0x70, 0x72,
|
||||||
0x6f, 0x74, 0x6f, 0x22, 0x6b, 0x0a, 0x14, 0x50, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72,
|
0x6f, 0x74, 0x6f, 0x22, 0x80, 0x01, 0x0a, 0x14, 0x50, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65,
|
||||||
0x54, 0x72, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x09, 0x70,
|
0x72, 0x54, 0x72, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x23, 0x0a, 0x09,
|
||||||
0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x05,
|
0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||||
0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x09, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72,
|
0x05, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x09, 0x70, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65,
|
||||||
0x12, 0x2e, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x18,
|
0x72, 0x12, 0x33, 0x0a, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73,
|
||||||
0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0c, 0x2e, 0x50, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65,
|
||||||
0x63, 0x65, 0x73, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e, 0x63, 0x65, 0x73,
|
0x6e, 0x63, 0x65, 0x73, 0x48, 0x00, 0x52, 0x0b, 0x70, 0x72, 0x65, 0x66, 0x65, 0x72, 0x65, 0x6e,
|
||||||
0x22, 0xa3, 0x01, 0x0a, 0x1b, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x67, 0x75, 0x6c,
|
0x63, 0x65, 0x73, 0x88, 0x01, 0x01, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x70, 0x72, 0x65, 0x66, 0x65,
|
||||||
0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73,
|
0x72, 0x65, 0x6e, 0x63, 0x65, 0x73, 0x22, 0xa3, 0x01, 0x0a, 0x1b, 0x44, 0x72, 0x69, 0x76, 0x65,
|
||||||
0x12, 0x35, 0x0a, 0x0e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65,
|
0x72, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69,
|
||||||
0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65,
|
0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x0e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
|
||||||
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
|
0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a, 0x15, 0x64, 0x72, 0x69, 0x76, 0x65,
|
0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d,
|
||||||
0x72, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73,
|
0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4d, 0x0a,
|
||||||
0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72,
|
0x15, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69,
|
||||||
0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74,
|
0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x18, 0x2e, 0x52,
|
||||||
0x52, 0x14, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69,
|
|
||||||
0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0xa5, 0x01, 0x0a, 0x1c, 0x44, 0x72, 0x69, 0x76, 0x65,
|
|
||||||
0x72, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
|
|
||||||
0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x35, 0x0a, 0x0e, 0x64, 0x72, 0x69, 0x76, 0x65,
|
|
||||||
0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
|
||||||
0x0e, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52,
|
|
||||||
0x0d, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x4e,
|
|
||||||
0x0a, 0x15, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x61, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
|
|
||||||
0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e,
|
|
||||||
0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69,
|
|
||||||
0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x14, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72,
|
|
||||||
0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0x4b,
|
|
||||||
0x0a, 0x15, 0x50, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x54, 0x72, 0x69, 0x70, 0x52,
|
|
||||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65,
|
|
||||||
0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73,
|
|
||||||
0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01,
|
|
||||||
0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x52, 0x0a, 0x1c, 0x44,
|
|
||||||
0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74,
|
|
||||||
0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73,
|
|
||||||
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75,
|
|
||||||
0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22,
|
|
||||||
0x41, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67,
|
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x29, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69,
|
|
||||||
0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0f, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69,
|
|
||||||
0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69,
|
|
||||||
0x6e, 0x67, 0x22, 0x3b, 0x0a, 0x15, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b,
|
|
||||||
0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x62,
|
|
||||||
0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42,
|
|
||||||
0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x22,
|
|
||||||
0x77, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67,
|
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6b, 0x69,
|
|
||||||
0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x6f,
|
|
||||||
0x6b, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73,
|
|
||||||
0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67,
|
|
||||||
0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x18,
|
|
||||||
0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52,
|
|
||||||
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x4b, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61,
|
|
||||||
0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
|
||||||
0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01,
|
|
||||||
0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x6d,
|
|
||||||
0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65,
|
|
||||||
0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x32, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b,
|
|
||||||
0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f,
|
|
||||||
0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09,
|
|
||||||
0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x12, 0x47, 0x65, 0x74,
|
|
||||||
0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12,
|
|
||||||
0x22, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
|
||||||
0x32, 0x08, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6b,
|
|
||||||
0x69, 0x6e, 0x67, 0x22, 0x7c, 0x0a, 0x1a, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e,
|
|
||||||
0x67, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
|
||||||
0x74, 0x12, 0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
|
||||||
0x0e, 0x32, 0x0e, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75,
|
|
||||||
0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x04, 0x74, 0x79, 0x70,
|
|
||||||
0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79,
|
|
||||||
0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72,
|
|
||||||
0x5f, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49,
|
|
||||||
0x64, 0x22, 0x82, 0x01, 0x0a, 0x15, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72,
|
|
||||||
0x6e, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x09, 0x64,
|
|
||||||
0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08,
|
|
||||||
0x2e, 0x46, 0x65, 0x61, 0x74, 0x75, 0x72, 0x65, 0x52, 0x09, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74,
|
|
||||||
0x75, 0x72, 0x65, 0x12, 0x41, 0x0a, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65,
|
|
||||||
0x5f, 0x64, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f,
|
|
||||||
0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69,
|
|
||||||
0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x52, 0x0d, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75,
|
|
||||||
0x72, 0x65, 0x44, 0x61, 0x74, 0x65, 0x22, 0x51, 0x0a, 0x16, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72,
|
|
||||||
0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
|
||||||
0x12, 0x37, 0x0a, 0x0f, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x6a, 0x6f, 0x75, 0x72, 0x6e,
|
|
||||||
0x65, 0x79, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x72, 0x69, 0x76,
|
|
||||||
0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x52, 0x0e, 0x64, 0x72, 0x69, 0x76, 0x65,
|
|
||||||
0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x73, 0x22, 0x41, 0x0a, 0x1b, 0x47, 0x65, 0x74,
|
|
||||||
0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6b,
|
|
||||||
0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6f, 0x6f, 0x6b,
|
|
||||||
0x69, 0x6e, 0x67, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x32, 0xf2, 0x04, 0x0a,
|
|
||||||
0x11, 0x53, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69,
|
|
||||||
0x63, 0x65, 0x12, 0x5f, 0x0a, 0x1e, 0x53, 0x65, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52,
|
|
||||||
0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
||||||
0x74, 0x69, 0x65, 0x73, 0x12, 0x1c, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x67,
|
0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x14, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76,
|
||||||
0x75, 0x6c, 0x61, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69,
|
0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x22, 0xa5, 0x01, 0x0a,
|
||||||
0x65, 0x73, 0x1a, 0x1d, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c,
|
0x1c, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41,
|
||||||
0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x35, 0x0a,
|
||||||
0x65, 0x22, 0x00, 0x12, 0x61, 0x0a, 0x1f, 0x53, 0x65, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72,
|
0x0e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18,
|
||||||
0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69,
|
0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65,
|
||||||
0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x50,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x0d, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x71,
|
||||||
0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c,
|
0x75, 0x65, 0x73, 0x74, 0x12, 0x4e, 0x0a, 0x15, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x61,
|
||||||
0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x1d, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76,
|
0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x18, 0x02, 0x20,
|
||||||
0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70,
|
0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75, 0x61, 0x6c, 0x41, 0x76,
|
||||||
0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
|
0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x53, 0x6c, 0x6f, 0x74, 0x52, 0x14,
|
||||||
0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x15, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,
|
0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
||||||
0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16,
|
0x74, 0x69, 0x65, 0x73, 0x22, 0x5c, 0x0a, 0x15, 0x50, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65,
|
||||||
0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65,
|
0x72, 0x54, 0x72, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a,
|
||||||
0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61,
|
0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07,
|
||||||
0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x15, 0x2e, 0x55, 0x70, 0x64, 0x61,
|
0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
||||||
|
0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
||||||
|
0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
||||||
|
0x67, 0x65, 0x22, 0x63, 0x0a, 0x1c, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76, 0x61, 0x69,
|
||||||
|
0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||||
|
0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20,
|
||||||
|
0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07,
|
||||||
|
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52,
|
||||||
|
0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f,
|
||||||
|
0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x41, 0x0a, 0x14, 0x43, 0x72, 0x65, 0x61, 0x74,
|
||||||
|
0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,
|
||||||
|
0x29, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b,
|
||||||
|
0x32, 0x0f, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||||
|
0x74, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x3b, 0x0a, 0x15, 0x43, 0x72,
|
||||||
|
0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
|
0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01,
|
||||||
|
0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x07,
|
||||||
|
0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x88, 0x01, 0x0a, 0x14, 0x55, 0x70, 0x64, 0x61,
|
||||||
0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
0x1a, 0x16, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67,
|
0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x69, 0x64, 0x18, 0x01,
|
||||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0a, 0x47, 0x65,
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x49, 0x64, 0x12,
|
||||||
0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x12, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f,
|
0x26, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32,
|
||||||
0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x47,
|
0x0e, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52,
|
||||||
0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
||||||
0x65, 0x22, 0x00, 0x12, 0x52, 0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e,
|
0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73,
|
||||||
0x67, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x47, 0x65, 0x74,
|
0x61, 0x67, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61,
|
||||||
0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73,
|
0x67, 0x65, 0x22, 0x5c, 0x0a, 0x15, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f,
|
0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x73,
|
||||||
0x6b, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73,
|
0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x73, 0x75,
|
||||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x44, 0x72, 0x69, 0x76, 0x65,
|
0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x1d, 0x0a, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||||
0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x73, 0x12, 0x16, 0x2e, 0x44, 0x72, 0x69, 0x76,
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x07, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67,
|
||||||
0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
0x65, 0x88, 0x01, 0x01, 0x42, 0x0a, 0x0a, 0x08, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
|
||||||
0x74, 0x1a, 0x17, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65,
|
0x22, 0x32, 0x0a, 0x11, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65,
|
||||||
0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x10,
|
0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67,
|
||||||
0x53, 0x65, 0x74, 0x50, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x54, 0x72, 0x69, 0x70,
|
0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x62, 0x6f, 0x6f, 0x6b, 0x69,
|
||||||
0x12, 0x15, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x54, 0x72, 0x69, 0x70,
|
0x6e, 0x67, 0x49, 0x64, 0x22, 0x38, 0x0a, 0x12, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69,
|
||||||
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x65, 0x6e,
|
0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x62, 0x6f,
|
||||||
0x67, 0x65, 0x72, 0x54, 0x72, 0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6f,
|
||||||
0x00, 0x42, 0x45, 0x5a, 0x43, 0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e,
|
0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x22, 0x7c,
|
||||||
0x69, 0x6f, 0x2f, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f,
|
0x0a, 0x1a, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x79, 0x53,
|
||||||
0x72, 0x6d, 0x2f, 0x73, 0x6f, 0x6c, 0x69, 0x64, 0x61, 0x72, 0x69, 0x74, 0x79, 0x2d, 0x73, 0x65,
|
0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x06,
|
||||||
0x72, 0x76, 0x69, 0x63, 0x65, 0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x67, 0x72,
|
0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x0e, 0x2e, 0x42,
|
||||||
0x70, 0x63, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74,
|
||||||
|
0x61, 0x74, 0x75, 0x73, 0x12, 0x1d, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x02, 0x20, 0x01,
|
||||||
|
0x28, 0x0e, 0x32, 0x09, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74,
|
||||||
|
0x79, 0x70, 0x65, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x03,
|
||||||
|
0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0x82, 0x01, 0x0a,
|
||||||
|
0x15, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x73, 0x52,
|
||||||
|
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x26, 0x0a, 0x09, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74,
|
||||||
|
0x75, 0x72, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x46, 0x65, 0x61, 0x74,
|
||||||
|
0x75, 0x72, 0x65, 0x52, 0x09, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x12, 0x41,
|
||||||
|
0x0a, 0x0e, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x64, 0x61, 0x74, 0x65,
|
||||||
|
0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
|
||||||
|
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61,
|
||||||
|
0x6d, 0x70, 0x52, 0x0d, 0x64, 0x65, 0x70, 0x61, 0x72, 0x74, 0x75, 0x72, 0x65, 0x44, 0x61, 0x74,
|
||||||
|
0x65, 0x22, 0x51, 0x0a, 0x16, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e,
|
||||||
|
0x65, 0x79, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x37, 0x0a, 0x0f, 0x64,
|
||||||
|
0x72, 0x69, 0x76, 0x65, 0x72, 0x5f, 0x6a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x73, 0x18, 0x01,
|
||||||
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75,
|
||||||
|
0x72, 0x6e, 0x65, 0x79, 0x52, 0x0e, 0x64, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72,
|
||||||
|
0x6e, 0x65, 0x79, 0x73, 0x22, 0x41, 0x0a, 0x1b, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69,
|
||||||
|
0x6e, 0x67, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
|
0x6e, 0x73, 0x65, 0x12, 0x22, 0x0a, 0x07, 0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x18, 0x01,
|
||||||
|
0x20, 0x03, 0x28, 0x0b, 0x32, 0x08, 0x2e, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x07,
|
||||||
|
0x62, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x32, 0xf2, 0x04, 0x0a, 0x11, 0x53, 0x6f, 0x6c, 0x69,
|
||||||
|
0x64, 0x61, 0x72, 0x69, 0x74, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x5f, 0x0a,
|
||||||
|
0x1e, 0x53, 0x65, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61,
|
||||||
|
0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x12,
|
||||||
|
0x1c, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x52, 0x65, 0x67, 0x75, 0x6c, 0x61, 0x72, 0x41,
|
||||||
|
0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x1a, 0x1d, 0x2e,
|
||||||
|
0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69,
|
||||||
|
0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x61,
|
||||||
|
0x0a, 0x1f, 0x53, 0x65, 0x74, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x50, 0x75, 0x6e, 0x63, 0x74,
|
||||||
|
0x75, 0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65,
|
||||||
|
0x73, 0x12, 0x1d, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x50, 0x75, 0x6e, 0x63, 0x74, 0x75,
|
||||||
|
0x61, 0x6c, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73,
|
||||||
|
0x1a, 0x1d, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62,
|
||||||
|
0x69, 0x6c, 0x69, 0x74, 0x69, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||||
|
0x00, 0x12, 0x40, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69,
|
||||||
|
0x6e, 0x67, 0x12, 0x15, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69,
|
||||||
|
0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x43, 0x72, 0x65, 0x61,
|
||||||
|
0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||||
|
0x65, 0x22, 0x00, 0x12, 0x40, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f,
|
||||||
|
0x6b, 0x69, 0x6e, 0x67, 0x12, 0x15, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f,
|
||||||
|
0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x55, 0x70,
|
||||||
|
0x64, 0x61, 0x74, 0x65, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||||
|
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x37, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b,
|
||||||
|
0x69, 0x6e, 0x67, 0x12, 0x12, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67,
|
||||||
|
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x13, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f,
|
||||||
|
0x6b, 0x69, 0x6e, 0x67, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x52,
|
||||||
|
0x0a, 0x13, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x73, 0x42, 0x79, 0x53,
|
||||||
|
0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x1b, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69,
|
||||||
|
0x6e, 0x67, 0x73, 0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
|
0x73, 0x74, 0x1a, 0x1c, 0x2e, 0x47, 0x65, 0x74, 0x42, 0x6f, 0x6f, 0x6b, 0x69, 0x6e, 0x67, 0x73,
|
||||||
|
0x42, 0x79, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
|
0x22, 0x00, 0x12, 0x43, 0x0a, 0x0e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72,
|
||||||
|
0x6e, 0x65, 0x79, 0x73, 0x12, 0x16, 0x2e, 0x44, 0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75,
|
||||||
|
0x72, 0x6e, 0x65, 0x79, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x17, 0x2e, 0x44,
|
||||||
|
0x72, 0x69, 0x76, 0x65, 0x72, 0x4a, 0x6f, 0x75, 0x72, 0x6e, 0x65, 0x79, 0x73, 0x52, 0x65, 0x73,
|
||||||
|
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x43, 0x0a, 0x10, 0x53, 0x65, 0x74, 0x50, 0x61,
|
||||||
|
0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x54, 0x72, 0x69, 0x70, 0x12, 0x15, 0x2e, 0x50, 0x61,
|
||||||
|
0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x54, 0x72, 0x69, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65,
|
||||||
|
0x73, 0x74, 0x1a, 0x16, 0x2e, 0x50, 0x61, 0x73, 0x73, 0x65, 0x6e, 0x67, 0x65, 0x72, 0x54, 0x72,
|
||||||
|
0x69, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x45, 0x5a, 0x43,
|
||||||
|
0x67, 0x69, 0x74, 0x2e, 0x63, 0x6f, 0x6f, 0x70, 0x67, 0x6f, 0x2e, 0x69, 0x6f, 0x2f, 0x63, 0x6f,
|
||||||
|
0x6f, 0x70, 0x67, 0x6f, 0x2d, 0x70, 0x6c, 0x61, 0x74, 0x66, 0x6f, 0x72, 0x6d, 0x2f, 0x73, 0x6f,
|
||||||
|
0x6c, 0x69, 0x64, 0x61, 0x72, 0x69, 0x74, 0x79, 0x2d, 0x73, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||||
|
0x2f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x2f, 0x67, 0x72, 0x70, 0x63, 0x2f, 0x70, 0x72,
|
||||||
|
0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -1229,6 +1235,11 @@ func file_solidarity_api_proto_init() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
file_solidarity_api_proto_msgTypes[0].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_proto_msgTypes[3].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_proto_msgTypes[4].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_proto_msgTypes[7].OneofWrappers = []interface{}{}
|
||||||
|
file_solidarity_api_proto_msgTypes[8].OneofWrappers = []interface{}{}
|
||||||
type x struct{}
|
type x struct{}
|
||||||
out := protoimpl.TypeBuilder{
|
out := protoimpl.TypeBuilder{
|
||||||
File: protoimpl.DescBuilder{
|
File: protoimpl.DescBuilder{
|
||||||
|
|
|
@ -17,7 +17,7 @@ service SolidarityService {
|
||||||
|
|
||||||
message PassengerTripRequest{
|
message PassengerTripRequest{
|
||||||
User passenger = 1;
|
User passenger = 1;
|
||||||
Preferences preferences = 2;
|
optional Preferences preferences = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DriverRegularAvailabilities{
|
message DriverRegularAvailabilities{
|
||||||
|
@ -33,12 +33,12 @@ message DriverPunctualAvailabilities{
|
||||||
|
|
||||||
message PassengerTripResponse {
|
message PassengerTripResponse {
|
||||||
bool success = 1;
|
bool success = 1;
|
||||||
string message = 2;
|
optional string message = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message DriverAvailabilitiesResponse {
|
message DriverAvailabilitiesResponse {
|
||||||
bool success = 1;
|
bool success = 1;
|
||||||
string message = 2;
|
optional string message = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateBookingRequest {
|
message CreateBookingRequest {
|
||||||
|
@ -51,12 +51,12 @@ message CreateBookingResponse {
|
||||||
message UpdateBookingRequest {
|
message UpdateBookingRequest {
|
||||||
string booking_id = 1;
|
string booking_id = 1;
|
||||||
BookingStatus status = 2;
|
BookingStatus status = 2;
|
||||||
string message = 3;
|
optional string message = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UpdateBookingResponse {
|
message UpdateBookingResponse {
|
||||||
bool success = 1;
|
bool success = 1;
|
||||||
string message = 2;
|
optional string message = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message GetBookingRequest {
|
message GetBookingRequest {
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||||
// versions:
|
// versions:
|
||||||
// - protoc-gen-go-grpc v1.5.1
|
// - protoc-gen-go-grpc v1.3.0
|
||||||
// - protoc v3.12.4
|
// - protoc v3.12.4
|
||||||
// source: solidarity-api.proto
|
// source: solidarity-api.proto
|
||||||
|
|
||||||
|
@ -15,8 +15,8 @@ import (
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
// is compatible with the grpc package it is being compiled against.
|
// is compatible with the grpc package it is being compiled against.
|
||||||
// Requires gRPC-Go v1.64.0 or later.
|
// Requires gRPC-Go v1.32.0 or later.
|
||||||
const _ = grpc.SupportPackageIsVersion9
|
const _ = grpc.SupportPackageIsVersion7
|
||||||
|
|
||||||
const (
|
const (
|
||||||
SolidarityService_SetDriverRegularAvailabilities_FullMethodName = "/SolidarityService/SetDriverRegularAvailabilities"
|
SolidarityService_SetDriverRegularAvailabilities_FullMethodName = "/SolidarityService/SetDriverRegularAvailabilities"
|
||||||
|
@ -52,9 +52,8 @@ func NewSolidarityServiceClient(cc grpc.ClientConnInterface) SolidarityServiceCl
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *solidarityServiceClient) SetDriverRegularAvailabilities(ctx context.Context, in *DriverRegularAvailabilities, opts ...grpc.CallOption) (*DriverAvailabilitiesResponse, error) {
|
func (c *solidarityServiceClient) SetDriverRegularAvailabilities(ctx context.Context, in *DriverRegularAvailabilities, opts ...grpc.CallOption) (*DriverAvailabilitiesResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(DriverAvailabilitiesResponse)
|
out := new(DriverAvailabilitiesResponse)
|
||||||
err := c.cc.Invoke(ctx, SolidarityService_SetDriverRegularAvailabilities_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, SolidarityService_SetDriverRegularAvailabilities_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -62,9 +61,8 @@ func (c *solidarityServiceClient) SetDriverRegularAvailabilities(ctx context.Con
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *solidarityServiceClient) SetDriverPunctualAvailabilities(ctx context.Context, in *DriverPunctualAvailabilities, opts ...grpc.CallOption) (*DriverAvailabilitiesResponse, error) {
|
func (c *solidarityServiceClient) SetDriverPunctualAvailabilities(ctx context.Context, in *DriverPunctualAvailabilities, opts ...grpc.CallOption) (*DriverAvailabilitiesResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(DriverAvailabilitiesResponse)
|
out := new(DriverAvailabilitiesResponse)
|
||||||
err := c.cc.Invoke(ctx, SolidarityService_SetDriverPunctualAvailabilities_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, SolidarityService_SetDriverPunctualAvailabilities_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -72,9 +70,8 @@ func (c *solidarityServiceClient) SetDriverPunctualAvailabilities(ctx context.Co
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *solidarityServiceClient) CreateBooking(ctx context.Context, in *CreateBookingRequest, opts ...grpc.CallOption) (*CreateBookingResponse, error) {
|
func (c *solidarityServiceClient) CreateBooking(ctx context.Context, in *CreateBookingRequest, opts ...grpc.CallOption) (*CreateBookingResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(CreateBookingResponse)
|
out := new(CreateBookingResponse)
|
||||||
err := c.cc.Invoke(ctx, SolidarityService_CreateBooking_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, SolidarityService_CreateBooking_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -82,9 +79,8 @@ func (c *solidarityServiceClient) CreateBooking(ctx context.Context, in *CreateB
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *solidarityServiceClient) UpdateBooking(ctx context.Context, in *UpdateBookingRequest, opts ...grpc.CallOption) (*UpdateBookingResponse, error) {
|
func (c *solidarityServiceClient) UpdateBooking(ctx context.Context, in *UpdateBookingRequest, opts ...grpc.CallOption) (*UpdateBookingResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(UpdateBookingResponse)
|
out := new(UpdateBookingResponse)
|
||||||
err := c.cc.Invoke(ctx, SolidarityService_UpdateBooking_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, SolidarityService_UpdateBooking_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -92,9 +88,8 @@ func (c *solidarityServiceClient) UpdateBooking(ctx context.Context, in *UpdateB
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *solidarityServiceClient) GetBooking(ctx context.Context, in *GetBookingRequest, opts ...grpc.CallOption) (*GetBookingResponse, error) {
|
func (c *solidarityServiceClient) GetBooking(ctx context.Context, in *GetBookingRequest, opts ...grpc.CallOption) (*GetBookingResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(GetBookingResponse)
|
out := new(GetBookingResponse)
|
||||||
err := c.cc.Invoke(ctx, SolidarityService_GetBooking_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, SolidarityService_GetBooking_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -102,9 +97,8 @@ func (c *solidarityServiceClient) GetBooking(ctx context.Context, in *GetBooking
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *solidarityServiceClient) GetBookingsByStatus(ctx context.Context, in *GetBookingsByStatusRequest, opts ...grpc.CallOption) (*GetBookingsByStatusResponse, error) {
|
func (c *solidarityServiceClient) GetBookingsByStatus(ctx context.Context, in *GetBookingsByStatusRequest, opts ...grpc.CallOption) (*GetBookingsByStatusResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(GetBookingsByStatusResponse)
|
out := new(GetBookingsByStatusResponse)
|
||||||
err := c.cc.Invoke(ctx, SolidarityService_GetBookingsByStatus_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, SolidarityService_GetBookingsByStatus_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -112,9 +106,8 @@ func (c *solidarityServiceClient) GetBookingsByStatus(ctx context.Context, in *G
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *solidarityServiceClient) DriverJourneys(ctx context.Context, in *DriverJourneysRequest, opts ...grpc.CallOption) (*DriverJourneysResponse, error) {
|
func (c *solidarityServiceClient) DriverJourneys(ctx context.Context, in *DriverJourneysRequest, opts ...grpc.CallOption) (*DriverJourneysResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(DriverJourneysResponse)
|
out := new(DriverJourneysResponse)
|
||||||
err := c.cc.Invoke(ctx, SolidarityService_DriverJourneys_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, SolidarityService_DriverJourneys_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -122,9 +115,8 @@ func (c *solidarityServiceClient) DriverJourneys(ctx context.Context, in *Driver
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *solidarityServiceClient) SetPassengerTrip(ctx context.Context, in *PassengerTripRequest, opts ...grpc.CallOption) (*PassengerTripResponse, error) {
|
func (c *solidarityServiceClient) SetPassengerTrip(ctx context.Context, in *PassengerTripRequest, opts ...grpc.CallOption) (*PassengerTripResponse, error) {
|
||||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
|
||||||
out := new(PassengerTripResponse)
|
out := new(PassengerTripResponse)
|
||||||
err := c.cc.Invoke(ctx, SolidarityService_SetPassengerTrip_FullMethodName, in, out, cOpts...)
|
err := c.cc.Invoke(ctx, SolidarityService_SetPassengerTrip_FullMethodName, in, out, opts...)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
@ -133,7 +125,7 @@ func (c *solidarityServiceClient) SetPassengerTrip(ctx context.Context, in *Pass
|
||||||
|
|
||||||
// SolidarityServiceServer is the server API for SolidarityService service.
|
// SolidarityServiceServer is the server API for SolidarityService service.
|
||||||
// All implementations must embed UnimplementedSolidarityServiceServer
|
// All implementations must embed UnimplementedSolidarityServiceServer
|
||||||
// for forward compatibility.
|
// for forward compatibility
|
||||||
type SolidarityServiceServer interface {
|
type SolidarityServiceServer interface {
|
||||||
SetDriverRegularAvailabilities(context.Context, *DriverRegularAvailabilities) (*DriverAvailabilitiesResponse, error)
|
SetDriverRegularAvailabilities(context.Context, *DriverRegularAvailabilities) (*DriverAvailabilitiesResponse, error)
|
||||||
SetDriverPunctualAvailabilities(context.Context, *DriverPunctualAvailabilities) (*DriverAvailabilitiesResponse, error)
|
SetDriverPunctualAvailabilities(context.Context, *DriverPunctualAvailabilities) (*DriverAvailabilitiesResponse, error)
|
||||||
|
@ -146,12 +138,9 @@ type SolidarityServiceServer interface {
|
||||||
mustEmbedUnimplementedSolidarityServiceServer()
|
mustEmbedUnimplementedSolidarityServiceServer()
|
||||||
}
|
}
|
||||||
|
|
||||||
// UnimplementedSolidarityServiceServer must be embedded to have
|
// UnimplementedSolidarityServiceServer must be embedded to have forward compatible implementations.
|
||||||
// forward compatible implementations.
|
type UnimplementedSolidarityServiceServer struct {
|
||||||
//
|
}
|
||||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
|
||||||
// pointer dereference when methods are called.
|
|
||||||
type UnimplementedSolidarityServiceServer struct{}
|
|
||||||
|
|
||||||
func (UnimplementedSolidarityServiceServer) SetDriverRegularAvailabilities(context.Context, *DriverRegularAvailabilities) (*DriverAvailabilitiesResponse, error) {
|
func (UnimplementedSolidarityServiceServer) SetDriverRegularAvailabilities(context.Context, *DriverRegularAvailabilities) (*DriverAvailabilitiesResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method SetDriverRegularAvailabilities not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method SetDriverRegularAvailabilities not implemented")
|
||||||
|
@ -178,7 +167,6 @@ func (UnimplementedSolidarityServiceServer) SetPassengerTrip(context.Context, *P
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method SetPassengerTrip not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method SetPassengerTrip not implemented")
|
||||||
}
|
}
|
||||||
func (UnimplementedSolidarityServiceServer) mustEmbedUnimplementedSolidarityServiceServer() {}
|
func (UnimplementedSolidarityServiceServer) mustEmbedUnimplementedSolidarityServiceServer() {}
|
||||||
func (UnimplementedSolidarityServiceServer) testEmbeddedByValue() {}
|
|
||||||
|
|
||||||
// UnsafeSolidarityServiceServer may be embedded to opt out of forward compatibility for this service.
|
// UnsafeSolidarityServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||||
// Use of this interface is not recommended, as added methods to SolidarityServiceServer will
|
// Use of this interface is not recommended, as added methods to SolidarityServiceServer will
|
||||||
|
@ -188,13 +176,6 @@ type UnsafeSolidarityServiceServer interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
func RegisterSolidarityServiceServer(s grpc.ServiceRegistrar, srv SolidarityServiceServer) {
|
func RegisterSolidarityServiceServer(s grpc.ServiceRegistrar, srv SolidarityServiceServer) {
|
||||||
// If the following call pancis, it indicates UnimplementedSolidarityServiceServer was
|
|
||||||
// embedded by pointer and is nil. This will cause panics if an
|
|
||||||
// unimplemented method is ever invoked, so we test this at initialization
|
|
||||||
// time to prevent it from happening at runtime later due to I/O.
|
|
||||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
|
||||||
t.testEmbeddedByValue()
|
|
||||||
}
|
|
||||||
s.RegisterService(&SolidarityService_ServiceDesc, srv)
|
s.RegisterService(&SolidarityService_ServiceDesc, srv)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,48 +2,32 @@ package grpcserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"strings"
|
|
||||||
|
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/models"
|
|
||||||
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) GetAccountInfo(ctx context.Context,
|
func (s SilvermobiGRPCService) GetAccountInfo(ctx context.Context, req *grpcproto.AccountInfoRequest) (res *grpcproto.AccountInfoResponse, err error) {
|
||||||
req *grpcproto.AccountInfoRequest) (res *grpcproto.AccountInfoResponse, err error) {
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
|
if !ok {
|
||||||
var (
|
|
||||||
md metadata.MD
|
|
||||||
account *models.Account
|
|
||||||
authHeader []string
|
|
||||||
ok bool
|
|
||||||
)
|
|
||||||
|
|
||||||
if md, ok = metadata.FromIncomingContext(ctx); !ok {
|
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
||||||
}
|
}
|
||||||
|
authHeader, ok := md["authorization"]
|
||||||
authHeader, ok = md["authorization"]
|
|
||||||
|
|
||||||
if !ok || len(authHeader) == 0 {
|
if !ok || len(authHeader) == 0 {
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
||||||
|
|
||||||
id := ExtractIdFromToken(tokenString)
|
id := ExtractIdFromToken(tokenString)
|
||||||
|
account, err := s.Handler.GetAccountInfos(context.Background(), id)
|
||||||
if account, err = s.Handler.GetAccountInfos(context.Background(), id); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("ID", account.ID).
|
Str("ID", account.ID).
|
||||||
Msg("GetAccountInfo")
|
Msg("GetAccountInfo")
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
return &grpcproto.AccountInfoResponse{
|
return &grpcproto.AccountInfoResponse{
|
||||||
FirstName: account.FirstName,
|
FirstName: account.FirstName,
|
||||||
LastName: account.LastName,
|
LastName: account.LastName,
|
||||||
|
|
|
@ -8,15 +8,13 @@ import (
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) AuthLogin(ctx context.Context,
|
func (s SilvermobiGRPCService) AuthLogin(ctx context.Context, req *grpcproto.AuthLoginRequest) (res *grpcproto.AuthLoginResponse, err error) {
|
||||||
req *grpcproto.AuthLoginRequest) (res *grpcproto.AuthLoginResponse, err error) {
|
|
||||||
var jwt string
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("username", req.Username).
|
Str("username", req.Username).
|
||||||
Msg("AuthLogin")
|
Msg("AuthLogin")
|
||||||
|
|
||||||
if jwt, err = s.Handler.Login(ctx, req.Username, req.Password); err != nil {
|
jwt, err := s.Handler.Login(ctx, req.Username, req.Password)
|
||||||
|
if err != nil {
|
||||||
log.Error().
|
log.Error().
|
||||||
Err(err).
|
Err(err).
|
||||||
Str("username", req.Username).
|
Str("username", req.Username).
|
||||||
|
@ -30,16 +28,13 @@ func (s SilvermobiGRPCService) AuthLogin(ctx context.Context,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) AuthRegister(ctx context.Context,
|
func (s SilvermobiGRPCService) AuthRegister(ctx context.Context, req *grpcproto.AuthRegisterRequest) (res *grpcproto.AuthRegisterResponse, err error) {
|
||||||
req *grpcproto.AuthRegisterRequest) (res *grpcproto.AuthRegisterResponse, err error) {
|
|
||||||
var jwt string
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("username", req.Email).
|
Str("username", req.Email).
|
||||||
Msg("AuthRegister")
|
Msg("AuthRegister")
|
||||||
|
|
||||||
if jwt, err = s.Handler.Register(ctx, req.Email, req.Password,
|
jwt, err := s.Handler.Register(ctx, req.Email, req.Password, req.Email, req.PhoneNumber, req.FirstName, req.LastName)
|
||||||
req.Email, req.PhoneNumber, req.FirstName, req.LastName); err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("AuthRegister failed")
|
log.Error().Err(err).Msg("AuthRegister failed")
|
||||||
return nil, errors.New("could not register user")
|
return nil, errors.New("could not register user")
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,57 +2,44 @@ package grpcserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"strings"
|
|
||||||
|
|
||||||
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) PutFirebaseToken(ctx context.Context,
|
func (s SilvermobiGRPCService) PutFirebaseToken(ctx context.Context, req *grpcproto.FirebaseTokenRequest) (resp *grpcproto.FirebaseTokenResponse, err error) {
|
||||||
req *grpcproto.FirebaseTokenRequest) (resp *grpcproto.FirebaseTokenResponse, err error) {
|
|
||||||
|
|
||||||
var (
|
|
||||||
ok bool
|
|
||||||
md metadata.MD
|
|
||||||
authHeader []string
|
|
||||||
)
|
|
||||||
|
|
||||||
if req.Token == "" || req.DevicePlatform == "" {
|
if req.Token == "" || req.DevicePlatform == "" {
|
||||||
return &grpcproto.FirebaseTokenResponse{
|
return &grpcproto.FirebaseTokenResponse{
|
||||||
Result: false,
|
Result: false,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
if md, ok = metadata.FromIncomingContext(ctx); !ok {
|
if !ok {
|
||||||
return &grpcproto.FirebaseTokenResponse{
|
return &grpcproto.FirebaseTokenResponse{
|
||||||
Result: false,
|
Result: false,
|
||||||
}, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
}, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
||||||
}
|
}
|
||||||
|
authHeader, ok := md["authorization"]
|
||||||
authHeader, ok = md["authorization"]
|
|
||||||
|
|
||||||
if !ok || len(authHeader) == 0 {
|
if !ok || len(authHeader) == 0 {
|
||||||
return &grpcproto.FirebaseTokenResponse{
|
return &grpcproto.FirebaseTokenResponse{
|
||||||
Result: false,
|
Result: false,
|
||||||
}, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
}, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
||||||
|
|
||||||
id := ExtractIdFromToken(tokenString)
|
id := ExtractIdFromToken(tokenString)
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("User ID", id).
|
Str("User ID", id).
|
||||||
Msg("PutFirebaseToken")
|
Msg("PutFirebaseToken")
|
||||||
|
err = s.Handler.PutFirebase(context.Background(), id, req.Token, req.DevicePlatform)
|
||||||
if err = s.Handler.PutFirebase(context.Background(), id, req.Token, req.DevicePlatform); err != nil {
|
if err != nil {
|
||||||
return &grpcproto.FirebaseTokenResponse{
|
return &grpcproto.FirebaseTokenResponse{
|
||||||
Result: false,
|
Result: false,
|
||||||
}, status.Errorf(codes.Unknown, "Database error")
|
}, status.Errorf(codes.Unknown, "Database error")
|
||||||
}
|
}
|
||||||
|
|
||||||
return &grpcproto.FirebaseTokenResponse{
|
return &grpcproto.FirebaseTokenResponse{
|
||||||
Result: true,
|
Result: true,
|
||||||
}, nil
|
}, nil
|
||||||
|
|
|
@ -2,30 +2,26 @@ package grpcserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) ForgetAccount(ctx context.Context,
|
func (s SilvermobiGRPCService) ForgetAccount(ctx context.Context, req *grpcproto.ForgetAccountRequest) (res *grpcproto.ForgetAccountResponse, err error) {
|
||||||
req *grpcproto.ForgetAccountRequest) (res *grpcproto.ForgetAccountResponse, err error) {
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("username", req.Username).
|
Str("username", req.Username).
|
||||||
Str("namespace", req.Namespace).
|
Str("namespace", req.Namespace).
|
||||||
Msg("ForgetAccount")
|
Msg("ForgetAccount")
|
||||||
|
response, access_code := s.Handler.ForgetAccount(ctx, req.Username, req.Namespace)
|
||||||
response, accessCode := s.Handler.ForgetAccount(ctx, req.Username, req.Namespace)
|
|
||||||
|
|
||||||
if response == true {
|
if response == true {
|
||||||
return &grpcproto.ForgetAccountResponse{
|
return &grpcproto.ForgetAccountResponse{
|
||||||
Response: true,
|
Response: true,
|
||||||
AccessCode: accessCode,
|
AccessCode: access_code,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
} else {
|
||||||
return &grpcproto.ForgetAccountResponse{
|
return &grpcproto.ForgetAccountResponse{
|
||||||
Response: false,
|
Response: false,
|
||||||
AccessCode: "",
|
AccessCode: "",
|
||||||
}, nil
|
}, nil
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,46 +2,47 @@ package grpcserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||||
"git.coopgo.io/coopgo-platform/routing-service"
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
"github.com/paulmach/orb/geojson"
|
"github.com/paulmach/orb/geojson"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"io"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) GeoAutocomplete(ctx context.Context,
|
func (s SilvermobiGRPCService) GeoAutocomplete(ctx context.Context, in *grpcproto.GeoAutocompleteRequest) (resp *grpcproto.GeoAutocompleteResponse, err error) {
|
||||||
in *grpcproto.GeoAutocompleteRequest) (resp *grpcproto.GeoAutocompleteResponse, err error) {
|
|
||||||
|
|
||||||
var (
|
|
||||||
results *geojson.FeatureCollection
|
|
||||||
rawFc []byte
|
|
||||||
)
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("text", in.Text).
|
Str("text", in.Text).
|
||||||
Msg("GeoAutocompleteRequest")
|
Msg("GeoAutocompleteRequest")
|
||||||
|
requestid := uuid.NewString()
|
||||||
|
log.Debug().Str("requestid", requestid).Msg("GRPC GeoAutocomplete start")
|
||||||
|
|
||||||
requestID := uuid.NewString()
|
if err == io.EOF {
|
||||||
|
log.Debug().Str("requestid", requestid).Msg("GRPC GeoAutocomplete EOF")
|
||||||
log.Debug().Str("requestID", requestID).Msg("GRPC GeoAutocomplete start")
|
|
||||||
|
|
||||||
if results, err = s.Handler.GeoAutocomplete(in.Text); err != nil {
|
|
||||||
log.Error().Str("requestID", requestID).Err(err).Msg("GRPC GeoAutocomplete geocoding error")
|
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if rawFc, err = results.MarshalJSON(); err != nil {
|
if err != nil {
|
||||||
log.Error().Str("requestID", requestID).Err(err).Msg("GRPC GeoAutocomplete " +
|
log.Error().Str("requestid", requestid).Err(err).Msg("GRPC GeoAutocomplete other error")
|
||||||
"protocol buffer conversion error")
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
results, err := s.Handler.GeoAutocomplete(in.Text, in.Lat, in.Lon)
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Str("requestid", requestid).Err(err).Msg("GRPC GeoAutocomplete geocoding error")
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
rawfc, err := results.MarshalJSON()
|
||||||
|
if err != nil {
|
||||||
|
log.Error().Str("requestid", requestid).Err(err).Msg("GRPC GeoAutocomplete protocol buffer conversion error")
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp = &grpcproto.GeoAutocompleteResponse{
|
resp = &grpcproto.GeoAutocompleteResponse{
|
||||||
FeatureCollection: &grpcproto.GeoAutocompleteResponse_FeatureCollectionRaw{
|
FeatureCollection: &grpcproto.GeoAutocompleteResponse_FeatureCollectionRaw{
|
||||||
FeatureCollectionRaw: string(rawFc),
|
FeatureCollectionRaw: string(rawfc),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,58 +50,50 @@ func (s SilvermobiGRPCService) GeoAutocomplete(ctx context.Context,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) GeoRoute(ctx context.Context,
|
func (s SilvermobiGRPCService) GeoRoute(ctx context.Context, req *grpcproto.GeoRouteRequest) (*grpcproto.GeoRouteResponse, error) {
|
||||||
req *grpcproto.GeoRouteRequest) (*grpcproto.GeoRouteResponse, error) {
|
locations_raw, ok := req.Locations.(*grpcproto.GeoRouteRequest_LocationsRaw)
|
||||||
locationsRaw, ok := req.Locations.(*grpcproto.GeoRouteRequest_LocationsRaw)
|
|
||||||
|
|
||||||
var route *routing.Route
|
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "could not read departure")
|
return nil, status.Errorf(codes.InvalidArgument, "could not read departure")
|
||||||
}
|
}
|
||||||
|
|
||||||
locations, err := geojson.UnmarshalFeatureCollection([]byte(locationsRaw.LocationsRaw))
|
locations, err := geojson.UnmarshalFeatureCollection([]byte(locations_raw.LocationsRaw))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Error(codes.Internal, err.Error())
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if route, err = s.Handler.GeoRoute(*locations); err != nil {
|
route, err := s.Handler.GeoRoute(*locations)
|
||||||
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &grpcproto.GeoRouteResponse{
|
return &grpcproto.GeoRouteResponse{
|
||||||
Polyline: route.Summary.Polyline,
|
Polyline: route.Polyline.String(),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) GeoRouteWithReturn(ctx context.Context,
|
func (s SilvermobiGRPCService) GeoRouteWithReturn(ctx context.Context, req *grpcproto.GeoRouteWithReturnRequest) (*grpcproto.GeoRouteWithReturnResponse, error) {
|
||||||
req *grpcproto.GeoRouteWithReturnRequest) (*grpcproto.GeoRouteWithReturnResponse, error) {
|
locations_raw, ok := req.Locations.(*grpcproto.GeoRouteWithReturnRequest_LocationsRaw)
|
||||||
|
|
||||||
var (
|
|
||||||
route, returnRoute *routing.Route
|
|
||||||
)
|
|
||||||
|
|
||||||
locationsRaw, ok := req.Locations.(*grpcproto.GeoRouteWithReturnRequest_LocationsRaw)
|
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "could not read departure")
|
return nil, status.Errorf(codes.InvalidArgument, "could not read departure")
|
||||||
}
|
}
|
||||||
|
|
||||||
locations, err := geojson.UnmarshalFeatureCollection([]byte(locationsRaw.LocationsRaw))
|
locations, err := geojson.UnmarshalFeatureCollection([]byte(locations_raw.LocationsRaw))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, status.Error(codes.Internal, err.Error())
|
return nil, status.Error(codes.Internal, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if route, err = s.Handler.GeoRoute(*locations); err != nil {
|
route, err := s.Handler.GeoRoute(*locations)
|
||||||
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if returnRoute, err = s.Handler.GeoReturnRoute(*locations); err != nil {
|
return_route, err := s.Handler.GeoReturnRoute(*locations)
|
||||||
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &grpcproto.GeoRouteWithReturnResponse{
|
return &grpcproto.GeoRouteWithReturnResponse{
|
||||||
Polyline: route.Summary.Polyline,
|
Polyline: route.Polyline.String(),
|
||||||
ReturnPolyline: returnRoute.Summary.Polyline,
|
ReturnPolyline: return_route.Polyline.String(),
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,38 +4,28 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"encoding/base64"
|
"encoding/base64"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"strings"
|
"fmt"
|
||||||
"time"
|
|
||||||
|
|
||||||
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/metadata"
|
"google.golang.org/grpc/metadata"
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"strings"
|
||||||
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) SetPhoneNumber(ctx context.Context,
|
func (s SilvermobiGRPCService) SetPhoneNumber(ctx context.Context, req *grpcproto.SetPhoneNumberRequest) (res *grpcproto.SetPhoneNumberResponse, err error) {
|
||||||
req *grpcproto.SetPhoneNumberRequest) (res *grpcproto.SetPhoneNumberResponse, err error) {
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
|
if !ok {
|
||||||
var (
|
|
||||||
md metadata.MD
|
|
||||||
authHeader []string
|
|
||||||
ok bool
|
|
||||||
)
|
|
||||||
|
|
||||||
if md, ok = metadata.FromIncomingContext(ctx); !ok {
|
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
||||||
}
|
}
|
||||||
|
|
||||||
authHeader, ok = md["authorization"]
|
authHeader, ok := md["authorization"]
|
||||||
if !ok || len(authHeader) == 0 {
|
if !ok || len(authHeader) == 0 {
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
||||||
|
|
||||||
id := ExtractIdFromToken(tokenString)
|
id := ExtractIdFromToken(tokenString)
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("User ID", id).
|
Str("User ID", id).
|
||||||
Msg("SetPhoneNumber")
|
Msg("SetPhoneNumber")
|
||||||
|
@ -50,33 +40,20 @@ func (s SilvermobiGRPCService) SetPhoneNumber(ctx context.Context,
|
||||||
return &grpcproto.SetPhoneNumberResponse{Ok: true}, nil
|
return &grpcproto.SetPhoneNumberResponse{Ok: true}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) VerifyPhoneNumber(ctx context.Context,
|
func (s SilvermobiGRPCService) VerifyPhoneNumber(ctx context.Context, req *grpcproto.VerifyPhoneNumberRequest) (res *grpcproto.VerifyPhoneNumberResponse, err error) {
|
||||||
req *grpcproto.VerifyPhoneNumberRequest) (res *grpcproto.VerifyPhoneNumberResponse, err error) {
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
|
if !ok {
|
||||||
var (
|
|
||||||
md metadata.MD
|
|
||||||
authHeader []string
|
|
||||||
ok bool
|
|
||||||
)
|
|
||||||
|
|
||||||
if md, ok = metadata.FromIncomingContext(ctx); !ok {
|
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
||||||
}
|
}
|
||||||
|
authHeader, ok := md["authorization"]
|
||||||
authHeader, ok = md["authorization"]
|
|
||||||
|
|
||||||
if !ok || len(authHeader) == 0 {
|
if !ok || len(authHeader) == 0 {
|
||||||
return nil, status.Errorf(codes.Unauthenticated,
|
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
||||||
"Missing authorization header")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
||||||
|
|
||||||
id := ExtractIdFromToken(tokenString)
|
id := ExtractIdFromToken(tokenString)
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("User ID", id).
|
Str("User ID", id).
|
||||||
Msg("VerifyPhoneNumber")
|
Msg("VerifyPhoneNumber")
|
||||||
|
|
||||||
if err = s.Handler.VerifyPhoneNumber(
|
if err = s.Handler.VerifyPhoneNumber(
|
||||||
context.Background(),
|
context.Background(),
|
||||||
id,
|
id,
|
||||||
|
@ -89,31 +66,21 @@ func (s SilvermobiGRPCService) VerifyPhoneNumber(ctx context.Context,
|
||||||
return &grpcproto.VerifyPhoneNumberResponse{Ok: true}, nil
|
return &grpcproto.VerifyPhoneNumberResponse{Ok: true}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) SetBirthDate(ctx context.Context,
|
func (s SilvermobiGRPCService) SetBirthDate(ctx context.Context, req *grpcproto.BirthDateRequest) (res *grpcproto.BirthDateResponse, err error) {
|
||||||
req *grpcproto.BirthDateRequest) (res *grpcproto.BirthDateResponse, err error) {
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
|
if !ok {
|
||||||
var (
|
|
||||||
md metadata.MD
|
|
||||||
authHeader []string
|
|
||||||
ok bool
|
|
||||||
)
|
|
||||||
|
|
||||||
if md, ok = metadata.FromIncomingContext(ctx); !ok {
|
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
||||||
}
|
}
|
||||||
|
|
||||||
authHeader, ok = md["authorization"]
|
authHeader, ok := md["authorization"]
|
||||||
if !ok || len(authHeader) == 0 {
|
if !ok || len(authHeader) == 0 {
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
||||||
id := ExtractIdFromToken(tokenString)
|
id := ExtractIdFromToken(tokenString)
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("User ID", id).
|
Str("User ID", id).
|
||||||
Msg("SetBirthDate")
|
Msg("SetBirthDate")
|
||||||
|
|
||||||
birthdate := time.Unix(req.Birthdate.Seconds, int64(req.Birthdate.Nanos)).UTC()
|
birthdate := time.Unix(req.Birthdate.Seconds, int64(req.Birthdate.Nanos)).UTC()
|
||||||
birthdateString := birthdate.Format("2006-01-02T15:04:05Z")
|
birthdateString := birthdate.Format("2006-01-02T15:04:05Z")
|
||||||
if err = s.Handler.UpdateBirthDate(ctx, id, birthdateString); err != nil {
|
if err = s.Handler.UpdateBirthDate(ctx, id, birthdateString); err != nil {
|
||||||
|
@ -125,85 +92,55 @@ func (s SilvermobiGRPCService) SetBirthDate(ctx context.Context,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) SetAccountType(ctx context.Context,
|
func (s SilvermobiGRPCService) SetAccountType(ctx context.Context, req *grpcproto.AccountTypeRequest) (res *grpcproto.AccountTypeResponse, err error) {
|
||||||
req *grpcproto.AccountTypeRequest) (res *grpcproto.AccountTypeResponse, err error) {
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
|
if !ok {
|
||||||
var (
|
|
||||||
md metadata.MD
|
|
||||||
authHeader []string
|
|
||||||
ok bool
|
|
||||||
)
|
|
||||||
|
|
||||||
if md, ok = metadata.FromIncomingContext(ctx); !ok {
|
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
||||||
}
|
}
|
||||||
|
authHeader, ok := md["authorization"]
|
||||||
authHeader, ok = md["authorization"]
|
|
||||||
if !ok || len(authHeader) == 0 {
|
if !ok || len(authHeader) == 0 {
|
||||||
return nil, status.Errorf(codes.Unauthenticated,
|
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
||||||
"Missing authorization header")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
||||||
|
|
||||||
id := ExtractIdFromToken(tokenString)
|
id := ExtractIdFromToken(tokenString)
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("User ID", id).
|
Str("User ID", id).
|
||||||
Msg("SetAccountType")
|
Msg("SetAccountType")
|
||||||
|
|
||||||
if req.GetType() != grpcproto.AccountTypeRequest_PASSENGER && req.GetType() != grpcproto.AccountTypeRequest_DRIVER {
|
if req.GetType() != grpcproto.AccountTypeRequest_PASSENGER && req.GetType() != grpcproto.AccountTypeRequest_DRIVER {
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "Type should be PASSENGER or DRIVER")
|
return nil, status.Errorf(codes.InvalidArgument, "Type should be PASSENGER or DRIVER")
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = s.Handler.SetAccountType(ctx, id, req.GetType().String()); err != nil {
|
if err = s.Handler.SetAccountType(ctx, id, req.GetType().String()); err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &grpcproto.AccountTypeResponse{
|
return &grpcproto.AccountTypeResponse{
|
||||||
Ok: true,
|
Ok: true,
|
||||||
}, nil
|
}, nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) GetAccountType(ctx context.Context,
|
func (s SilvermobiGRPCService) GetAccountType(ctx context.Context, req *grpcproto.AccountTypeRequest) (res *grpcproto.AccountTypeResponse, err error) {
|
||||||
req *grpcproto.AccountTypeRequest) (res *grpcproto.AccountTypeResponse, err error) {
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
|
if !ok {
|
||||||
var (
|
|
||||||
md metadata.MD
|
|
||||||
authHeader []string
|
|
||||||
ok bool
|
|
||||||
accountType string
|
|
||||||
responseType grpcproto.AccountTypeResponse_AccountType
|
|
||||||
)
|
|
||||||
|
|
||||||
if md, ok = metadata.FromIncomingContext(ctx); !ok {
|
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
||||||
}
|
}
|
||||||
|
authHeader, ok := md["authorization"]
|
||||||
authHeader, ok = md["authorization"]
|
|
||||||
|
|
||||||
if !ok || len(authHeader) == 0 {
|
if !ok || len(authHeader) == 0 {
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
||||||
|
|
||||||
id := ExtractIdFromToken(tokenString)
|
id := ExtractIdFromToken(tokenString)
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("User ID", id).
|
Str("User ID", id).
|
||||||
Msg("GetAccountType")
|
Msg("GetAccountType")
|
||||||
|
if req.Request != true || !req.Request {
|
||||||
if req.Request == false || !req.Request {
|
|
||||||
return nil, status.Errorf(codes.InvalidArgument, "request arg should be true")
|
return nil, status.Errorf(codes.InvalidArgument, "request arg should be true")
|
||||||
}
|
}
|
||||||
|
account_type, err := s.Handler.GetAccountType(ctx, id)
|
||||||
if accountType, err = s.Handler.GetAccountType(ctx, id); err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
var responseType grpcproto.AccountTypeResponse_AccountType
|
||||||
switch accountType {
|
switch account_type {
|
||||||
case "PASSENGER":
|
case "PASSENGER":
|
||||||
responseType = grpcproto.AccountTypeResponse_PASSENGER
|
responseType = grpcproto.AccountTypeResponse_PASSENGER
|
||||||
case "DRIVER":
|
case "DRIVER":
|
||||||
|
@ -220,66 +157,45 @@ func (s SilvermobiGRPCService) GetAccountType(ctx context.Context,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) GetValidation(ctx context.Context,
|
func (s SilvermobiGRPCService) GetValidation(ctx context.Context, req *grpcproto.ValidationRequest) (res *grpcproto.ValidationResponse, err error) {
|
||||||
req *grpcproto.ValidationRequest) (res *grpcproto.ValidationResponse, err error) {
|
md, ok := metadata.FromIncomingContext(ctx)
|
||||||
|
if !ok {
|
||||||
var (
|
|
||||||
md metadata.MD
|
|
||||||
authHeader []string
|
|
||||||
ok, phoneValidation, birthValidation, typeValidation bool
|
|
||||||
)
|
|
||||||
|
|
||||||
if md, ok = metadata.FromIncomingContext(ctx); ok {
|
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing metadata")
|
||||||
}
|
}
|
||||||
|
authHeader, ok := md["authorization"]
|
||||||
authHeader, ok = md["authorization"]
|
|
||||||
|
|
||||||
if !ok || len(authHeader) == 0 {
|
if !ok || len(authHeader) == 0 {
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
return nil, status.Errorf(codes.Unauthenticated, "Missing authorization header")
|
||||||
}
|
}
|
||||||
|
|
||||||
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
tokenString := strings.TrimPrefix(authHeader[0], "Bearer ")
|
||||||
|
|
||||||
id := ExtractIdFromToken(tokenString)
|
id := ExtractIdFromToken(tokenString)
|
||||||
|
fmt.Println(id)
|
||||||
if phoneValidation, birthValidation, typeValidation, err = s.Handler.CheckValidation(ctx, id); err != nil {
|
phone_validation, birth_validation, type_validation, err := s.Handler.CheckValidation(ctx, id)
|
||||||
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &grpcproto.ValidationResponse{
|
return &grpcproto.ValidationResponse{
|
||||||
Phone: phoneValidation,
|
Phone: phone_validation,
|
||||||
Birthdate: birthValidation,
|
Birthdate: birth_validation,
|
||||||
Type: typeValidation,
|
Type: type_validation,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ExtractIdFromToken(tokenString string) string {
|
func ExtractIdFromToken(tokenString string) string {
|
||||||
var (
|
|
||||||
err error
|
|
||||||
payloadBytes []byte
|
|
||||||
payloadMap map[string]interface{}
|
|
||||||
id string
|
|
||||||
ok bool
|
|
||||||
)
|
|
||||||
|
|
||||||
parts := strings.Split(tokenString, ".")
|
parts := strings.Split(tokenString, ".")
|
||||||
|
|
||||||
if len(parts) != 3 {
|
if len(parts) != 3 {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
payloadBytes, err := base64.RawStdEncoding.DecodeString(parts[1])
|
||||||
if payloadBytes, err = base64.RawStdEncoding.DecodeString(parts[1]); err != nil {
|
if err != nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
var payloadMap map[string]interface{}
|
||||||
if err = json.Unmarshal(payloadBytes, &payloadMap); err != nil {
|
if err := json.Unmarshal(payloadBytes, &payloadMap); err != nil {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
id, ok := payloadMap["sub"].(string)
|
||||||
if id, ok = payloadMap["sub"].(string); !ok {
|
if !ok {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return id
|
return id
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,20 +2,19 @@ package grpcserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"net"
|
"fmt"
|
||||||
|
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/handler"
|
"git.coopgo.io/coopgo-apps/silvermobi/handler"
|
||||||
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||||
"github.com/golang-jwt/jwt/v4"
|
"github.com/golang-jwt/jwt/v4"
|
||||||
grpcmiddleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware"
|
||||||
grpcauth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
|
grpc_auth "github.com/grpc-ecosystem/go-grpc-middleware/auth"
|
||||||
grpcctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags"
|
grpc_ctxtags "github.com/grpc-ecosystem/go-grpc-middleware/tags"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/codes"
|
"google.golang.org/grpc/codes"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
|
||||||
"google.golang.org/grpc/status"
|
"google.golang.org/grpc/status"
|
||||||
|
"net"
|
||||||
)
|
)
|
||||||
|
|
||||||
type contextKey string
|
type contextKey string
|
||||||
|
@ -43,78 +42,62 @@ func NoAuth(method string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func UnaryAuthServerInterceptor(authFunc grpcauth.AuthFunc) grpc.UnaryServerInterceptor {
|
func UnaryAuthServerInterceptor(authFunc grpc_auth.AuthFunc) grpc.UnaryServerInterceptor {
|
||||||
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {
|
||||||
|
|
||||||
var (
|
|
||||||
newCtx context.Context
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
|
|
||||||
print(info.FullMethod)
|
print(info.FullMethod)
|
||||||
|
|
||||||
if NoAuth(info.FullMethod) {
|
if NoAuth(info.FullMethod) {
|
||||||
return handler(ctx, req)
|
return handler(ctx, req)
|
||||||
}
|
}
|
||||||
|
var newCtx context.Context
|
||||||
if newCtx, err = authFunc(ctx); err != nil {
|
var err error
|
||||||
|
newCtx, err = authFunc(ctx)
|
||||||
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return handler(newCtx, req)
|
return handler(newCtx, req)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func StreamAuthServerInterceptor(authFunc grpcauth.AuthFunc) grpc.StreamServerInterceptor {
|
func StreamAuthServerInterceptor(authFunc grpc_auth.AuthFunc) grpc.StreamServerInterceptor {
|
||||||
return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo,
|
return func(srv interface{}, stream grpc.ServerStream, info *grpc.StreamServerInfo, handler grpc.StreamHandler) error {
|
||||||
handler grpc.StreamHandler) error {
|
|
||||||
|
|
||||||
var (
|
|
||||||
newCtx context.Context
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
|
|
||||||
if NoAuth(info.FullMethod) {
|
if NoAuth(info.FullMethod) {
|
||||||
wrapped := grpcmiddleware.WrapServerStream(stream)
|
wrapped := grpc_middleware.WrapServerStream(stream)
|
||||||
wrapped.WrappedContext = stream.Context()
|
wrapped.WrappedContext = stream.Context()
|
||||||
|
|
||||||
return handler(srv, wrapped)
|
return handler(srv, wrapped)
|
||||||
}
|
}
|
||||||
|
var newCtx context.Context
|
||||||
if newCtx, err = authFunc(stream.Context()); err != nil {
|
var err error
|
||||||
|
newCtx, err = authFunc(stream.Context())
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
wrapped := grpc_middleware.WrapServerStream(stream)
|
||||||
wrapped := grpcmiddleware.WrapServerStream(stream)
|
|
||||||
wrapped.WrappedContext = newCtx
|
wrapped.WrappedContext = newCtx
|
||||||
|
|
||||||
return handler(srv, wrapped)
|
return handler(srv, wrapped)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type SilvermobiGRPCService struct {
|
type SilvermobiGRPCService struct {
|
||||||
Config *viper.Viper
|
Config *viper.Viper
|
||||||
Handler *handler.SilverMobiHandler
|
Handler *handler.SilvermobiHandler
|
||||||
grpcproto.UnimplementedSilvermobiGRPCServer
|
grpcproto.UnimplementedSilvermobiGRPCServer
|
||||||
}
|
}
|
||||||
|
|
||||||
type SolidarityService struct {
|
type SolidarityService struct {
|
||||||
Config *viper.Viper
|
Config *viper.Viper
|
||||||
Handler *handler.SilverMobiHandler
|
Handler *handler.SilvermobiHandler
|
||||||
SolidarityClient grpcproto.SolidarityServiceClient
|
SolidarityClient grpcproto.SolidarityServiceClient
|
||||||
grpcproto.UnimplementedSolidarityServiceServer
|
grpcproto.UnimplementedSolidarityServiceServer // Add this client
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSolidarityService(cfg *viper.Viper, handler *handler.SilverMobiHandler) SolidarityService {
|
func NewSolidarityService(cfg *viper.Viper, handler *handler.SilvermobiHandler) SolidarityService {
|
||||||
solidarityServiceAddress := cfg.GetString("solidarity_service.address")
|
solidarityServiceAddress := cfg.GetString("solidarity_service.address")
|
||||||
|
conn, err := grpc.Dial(solidarityServiceAddress, grpc.WithInsecure())
|
||||||
conn, err := grpc.NewClient(solidarityServiceAddress, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err)
|
log.Fatal().Err(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
solidarityClient := grpcproto.NewSolidarityServiceClient(conn)
|
solidarityClient := grpcproto.NewSolidarityServiceClient(conn)
|
||||||
|
|
||||||
return SolidarityService{
|
return SolidarityService{
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
Handler: handler,
|
Handler: handler,
|
||||||
|
@ -122,70 +105,63 @@ func NewSolidarityService(cfg *viper.Viper, handler *handler.SilverMobiHandler)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewSilvermobiGRPCService(cfg *viper.Viper, handler *handler.SilverMobiHandler) SilvermobiGRPCService {
|
func NewSilvermobiGRPCService(cfg *viper.Viper, handler *handler.SilvermobiHandler) SilvermobiGRPCService {
|
||||||
return SilvermobiGRPCService{
|
return SilvermobiGRPCService{
|
||||||
Config: cfg,
|
Config: cfg,
|
||||||
Handler: handler,
|
Handler: handler,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func Run(done chan error, cfg *viper.Viper, handler *handler.SilverMobiHandler) {
|
func Run(done chan error, cfg *viper.Viper, handler *handler.SilvermobiHandler) {
|
||||||
var (
|
var (
|
||||||
address = cfg.GetString("services.external.grpc.ip") + ":" + cfg.GetString("services.external.grpc.port")
|
address = cfg.GetString("services.external.grpc.ip") + ":" + cfg.GetString("services.external.grpc.port")
|
||||||
jwtSecret = cfg.GetString("identification.local.jwt_secret")
|
jwt_secret = cfg.GetString("identification.local.jwt_secret")
|
||||||
)
|
)
|
||||||
|
|
||||||
log.Info().Msg("GRPC server on " + address)
|
log.Info().Msg("GRPC server on " + address)
|
||||||
|
|
||||||
server := grpc.NewServer(
|
server := grpc.NewServer(
|
||||||
grpc.StreamInterceptor(grpcmiddleware.ChainStreamServer(
|
grpc.StreamInterceptor(grpc_middleware.ChainStreamServer(
|
||||||
grpcctxtags.StreamServerInterceptor(),
|
grpc_ctxtags.StreamServerInterceptor(),
|
||||||
StreamAuthServerInterceptor(GRPCAuthFunc(jwtSecret)),
|
StreamAuthServerInterceptor(GRPCAuthFunc(jwt_secret)),
|
||||||
)),
|
)),
|
||||||
grpc.UnaryInterceptor(grpcmiddleware.ChainUnaryServer(
|
grpc.UnaryInterceptor(grpc_middleware.ChainUnaryServer(
|
||||||
grpcctxtags.UnaryServerInterceptor(),
|
grpc_ctxtags.UnaryServerInterceptor(),
|
||||||
UnaryAuthServerInterceptor(GRPCAuthFunc(jwtSecret)),
|
UnaryAuthServerInterceptor(GRPCAuthFunc(jwt_secret)),
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
|
|
||||||
solidarityService := NewSolidarityService(cfg, handler)
|
solidarity_service := NewSolidarityService(cfg, handler)
|
||||||
|
|
||||||
silvermobiService := NewSilvermobiGRPCService(cfg, handler)
|
silvermobi_service := NewSilvermobiGRPCService(cfg, handler)
|
||||||
grpcproto.RegisterSilvermobiGRPCServer(server, silvermobiService)
|
grpcproto.RegisterSilvermobiGRPCServer(server, silvermobi_service)
|
||||||
grpcproto.RegisterSolidarityServiceServer(server, &solidarityService)
|
grpcproto.RegisterSolidarityServiceServer(server, &solidarity_service)
|
||||||
l, err := net.Listen("tcp", address)
|
l, err := net.Listen("tcp", address)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err)
|
log.Fatal().Err(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = server.Serve(l); err != nil {
|
if err := server.Serve(l); err != nil {
|
||||||
log.Error().Err(err).Msg("gRPC service ended")
|
log.Error().Err(err).Msg("gRPC service ended")
|
||||||
done <- err
|
done <- err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func GRPCAuthFunc(jwtKey string) grpcauth.AuthFunc {
|
func GRPCAuthFunc(jwtKey string) grpc_auth.AuthFunc {
|
||||||
return func(ctx context.Context) (context.Context, error) {
|
return func(ctx context.Context) (context.Context, error) {
|
||||||
|
tokenString, err := grpc_auth.AuthFromMD(ctx, "bearer")
|
||||||
var token *jwt.Token
|
|
||||||
|
|
||||||
tokenString, err := grpcauth.AuthFromMD(ctx, "bearer")
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
claims := jwt.MapClaims{}
|
claims := jwt.MapClaims{}
|
||||||
|
token, err := jwt.ParseWithClaims(tokenString, claims, func(token *jwt.Token) (interface{}, error) {
|
||||||
token, err = jwt.ParseWithClaims(tokenString, claims, func(token *jwt.Token) (interface{}, error) {
|
|
||||||
return []byte(jwtKey), nil
|
return []byte(jwtKey), nil
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil || !token.Valid {
|
if err != nil || !token.Valid {
|
||||||
|
fmt.Println(err)
|
||||||
return nil, status.Errorf(codes.Unauthenticated, "Invalid or expired token")
|
return nil, status.Errorf(codes.Unauthenticated, "Invalid or expired token")
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx = context.WithValue(ctx, contextKeyUser, claims["sub"].(string))
|
ctx = context.WithValue(ctx, contextKeyUser, claims["sub"].(string))
|
||||||
|
|
||||||
return ctx, nil
|
return ctx, nil
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,106 +2,76 @@ package grpcserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"fmt"
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
"git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s *SolidarityService) SetDriverRegularAvailabilities(ctx context.Context,
|
func (s *SolidarityService) SetDriverRegularAvailabilities(ctx context.Context, req *proto.DriverRegularAvailabilities) (resp *proto.DriverAvailabilitiesResponse, err error) {
|
||||||
req *proto.DriverRegularAvailabilities) (resp *proto.DriverAvailabilitiesResponse, err error) {
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("Driver ID", req.DriverRequest.Driver.Id).
|
Str("Driver ID", req.DriverRequest.Driver.Id).
|
||||||
Msg("SetDriverRegularAvailabilities")
|
Msg("SetDriverRegularAvailabilities")
|
||||||
resp, err = s.SolidarityClient.SetDriverRegularAvailabilities(ctx, req)
|
resp, err = s.SolidarityClient.SetDriverRegularAvailabilities(ctx, req)
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SolidarityService) SetDriverPunctualAvailabilities(ctx context.Context,
|
func (s *SolidarityService) SetDriverPunctualAvailabilities(ctx context.Context, req *proto.DriverPunctualAvailabilities) (resp *proto.DriverAvailabilitiesResponse, err error) {
|
||||||
req *proto.DriverPunctualAvailabilities) (resp *proto.DriverAvailabilitiesResponse, err error) {
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("Driver ID", req.DriverRequest.Driver.Id).
|
Str("Driver ID", req.DriverRequest.Driver.Id).
|
||||||
Msg("SetDriverRegularAvailabilities")
|
Msg("SetDriverRegularAvailabilities")
|
||||||
resp, err = s.SolidarityClient.SetDriverPunctualAvailabilities(ctx, req)
|
resp, err = s.SolidarityClient.SetDriverPunctualAvailabilities(ctx, req)
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SolidarityService) CreateBooking(ctx context.Context,
|
func (s *SolidarityService) CreateBooking(ctx context.Context, req *proto.CreateBookingRequest) (resp *proto.CreateBookingResponse, err error) {
|
||||||
req *proto.CreateBookingRequest) (resp *proto.CreateBookingResponse, err error) {
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("Booking ID", req.Booking.Id).
|
Str("Booking ID", req.Booking.Id).
|
||||||
Msg("CreateBooking")
|
Msg("CreateBooking")
|
||||||
|
resp, err = s.SolidarityClient.CreateBooking(ctx, req)
|
||||||
if resp, err = s.SolidarityClient.CreateBooking(ctx, req); err != nil {
|
if err == nil {
|
||||||
return nil, err
|
_ = s.Handler.SendNotification(req.Booking.DriverId, "Silvermobi", "Vous avez reçu une demande de trajet. \n Pour plus de détails, veuillez consulter l'interface \"Mes Trajets\" dans l'application SilverMobi.")
|
||||||
|
err = s.Handler.SendEmail(req.Booking.DriverId, "Silvermobi", "Vous avez reçu une demande de trajet. \n Pour plus de détails, veuillez consulter l'interface \"Mes Trajets\" dans l'application SilverMobi.")
|
||||||
|
fmt.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if err = s.Handler.SendNotification(req.Booking.DriverId,
|
|
||||||
"Silvermobi", "Vous avez reçu une demande de trajet. "+
|
|
||||||
"\n Pour plus de détails, veuillez consulter"+
|
|
||||||
" l'interface \"Mes Trajets\" dans l'application SilverMobi."); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
if err = s.Handler.SendEmail(req.Booking.DriverId, "Silvermobi",
|
|
||||||
"Vous avez reçu une demande de trajet. \n Pour plus de détails, "+
|
|
||||||
"veuillez consulter l'interface \"Mes Trajets\" dans l'application SilverMobi."); err != nil {
|
|
||||||
return nil, err
|
|
||||||
}
|
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SolidarityService) UpdateBooking(ctx context.Context,
|
func (s *SolidarityService) UpdateBooking(ctx context.Context, req *proto.UpdateBookingRequest) (resp *proto.UpdateBookingResponse, err error) {
|
||||||
req *proto.UpdateBookingRequest) (resp *proto.UpdateBookingResponse, err error) {
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("Booking ID", req.BookingId).
|
Str("Booking ID", req.BookingId).
|
||||||
Msg("UpdateBooking")
|
Msg("UpdateBooking")
|
||||||
resp, err = s.SolidarityClient.UpdateBooking(ctx, req)
|
resp, err = s.SolidarityClient.UpdateBooking(ctx, req)
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SolidarityService) GetBooking(ctx context.Context,
|
func (s *SolidarityService) GetBooking(ctx context.Context, req *proto.GetBookingRequest) (resp *proto.GetBookingResponse, err error) {
|
||||||
req *proto.GetBookingRequest) (resp *proto.GetBookingResponse, err error) {
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("Booking ID", req.BookingId).
|
Str("Booking ID", req.BookingId).
|
||||||
Msg("GetBooking")
|
Msg("GetBooking")
|
||||||
resp, err = s.SolidarityClient.GetBooking(ctx, req)
|
resp, err = s.SolidarityClient.GetBooking(ctx, req)
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SolidarityService) GetBookingsByStatus(ctx context.Context,
|
func (s *SolidarityService) GetBookingsByStatus(ctx context.Context, req *proto.GetBookingsByStatusRequest) (resp *proto.GetBookingsByStatusResponse, err error) {
|
||||||
req *proto.GetBookingsByStatusRequest) (resp *proto.GetBookingsByStatusResponse, err error) {
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("User ID", req.UserId).
|
Str("User ID", req.UserId).
|
||||||
Msg("GetBookingByStatus")
|
Msg("GetBookingByStatus")
|
||||||
resp, err = s.SolidarityClient.GetBookingsByStatus(ctx, req)
|
resp, err = s.SolidarityClient.GetBookingsByStatus(ctx, req)
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SolidarityService) DriverJourneys(ctx context.Context,
|
func (s *SolidarityService) DriverJourneys(ctx context.Context, req *proto.DriverJourneysRequest) (resp *proto.DriverJourneysResponse, err error) {
|
||||||
req *proto.DriverJourneysRequest) (resp *proto.DriverJourneysResponse, err error) {
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("Address", req.Departure.Address).
|
Str("Address", req.Departure.Address).
|
||||||
Msg("DriverJourneys")
|
Msg("DriverJourneys")
|
||||||
resp, err = s.SolidarityClient.DriverJourneys(ctx, req)
|
resp, err = s.SolidarityClient.DriverJourneys(ctx, req)
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *SolidarityService) SetPassengerTrip(ctx context.Context,
|
func (s *SolidarityService) SetPassengerTrip(ctx context.Context, req *proto.PassengerTripRequest) (resp *proto.PassengerTripResponse, err error) {
|
||||||
req *proto.PassengerTripRequest) (resp *proto.PassengerTripResponse, err error) {
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("Passenger ID", req.Passenger.Id).
|
Str("Passenger ID", req.Passenger.Id).
|
||||||
Msg("SetPassengerTrip")
|
Msg("SetPassengerTrip")
|
||||||
resp, err = s.SolidarityClient.SetPassengerTrip(ctx, req)
|
resp, err = s.SolidarityClient.SetPassengerTrip(ctx, req)
|
||||||
|
|
||||||
return resp, err
|
return resp, err
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,27 +2,22 @@ package grpcserver
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
grpcproto "git.coopgo.io/coopgo-apps/silvermobi/servers/grpcapi/proto"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (s SilvermobiGRPCService) UpdatePassword(ctx context.Context,
|
func (s SilvermobiGRPCService) UpdatePassword(ctx context.Context, req *grpcproto.UpdatePasswordRequest) (res *grpcproto.UpdatePasswordResponse, err error) {
|
||||||
req *grpcproto.UpdatePasswordRequest) (res *grpcproto.UpdatePasswordResponse, err error) {
|
|
||||||
|
|
||||||
log.Info().
|
log.Info().
|
||||||
Str("username", req.Email).
|
Str("username", req.Email).
|
||||||
Msg("Update Password")
|
Msg("Update Password")
|
||||||
|
|
||||||
result := s.Handler.UpdatePassword(ctx, req.Email, req.Password)
|
result := s.Handler.UpdatePassword(ctx, req.Email, req.Password)
|
||||||
if result {
|
if result == true {
|
||||||
return &grpcproto.UpdatePasswordResponse{
|
return &grpcproto.UpdatePasswordResponse{
|
||||||
Response: true,
|
Response: true,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
} else {
|
||||||
|
|
||||||
return &grpcproto.UpdatePasswordResponse{
|
return &grpcproto.UpdatePasswordResponse{
|
||||||
Response: false,
|
Response: false,
|
||||||
}, nil
|
}, nil
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,10 @@ package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"git.coopgo.io/coopgo-apps/silvermobi/models"
|
"git.coopgo.io/coopgo-apps/silvermobi/models"
|
||||||
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
mobilityaccounts "git.coopgo.io/coopgo-platform/mobility-accounts/grpcapi"
|
||||||
ma "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
|
ma "git.coopgo.io/coopgo-platform/mobility-accounts/storage"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
|
||||||
"google.golang.org/protobuf/types/known/structpb"
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -16,8 +14,7 @@ type MobilityAccountService struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewMobilityAccountService(mobilityAccountsDial string) (MobilityAccountService, error) {
|
func NewMobilityAccountService(mobilityAccountsDial string) (MobilityAccountService, error) {
|
||||||
mobilityAccountsConn, err := grpc.NewClient(mobilityAccountsDial,
|
mobilityAccountsConn, err := grpc.Dial(mobilityAccountsDial, grpc.WithInsecure())
|
||||||
grpc.WithTransportCredentials(insecure.NewCredentials()))
|
|
||||||
|
|
||||||
client := mobilityaccounts.NewMobilityAccountsClient(mobilityAccountsConn)
|
client := mobilityaccounts.NewMobilityAccountsClient(mobilityAccountsConn)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -45,7 +42,6 @@ func (s MobilityAccountService) Login(ctx context.Context, username, password, n
|
||||||
|
|
||||||
func (s MobilityAccountService) UpdateAccountData(ctx context.Context, id string, data map[string]any) error {
|
func (s MobilityAccountService) UpdateAccountData(ctx context.Context, id string, data map[string]any) error {
|
||||||
d, err := structpb.NewStruct(data)
|
d, err := structpb.NewStruct(data)
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -67,17 +63,14 @@ func (s MobilityAccountService) UpdatePassword(ctx context.Context, id string, p
|
||||||
Id: id,
|
Id: id,
|
||||||
Password: password,
|
Password: password,
|
||||||
})
|
})
|
||||||
|
if err == nil {
|
||||||
if err != nil {
|
return true
|
||||||
|
} else {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s MobilityAccountService) GetAccountUsername(ctx context.Context,
|
func (s MobilityAccountService) GetAccountUsername(ctx context.Context, username string, namespace string) (*models.Account, error) {
|
||||||
username string, namespace string) (*models.Account, error) {
|
|
||||||
|
|
||||||
resp, err := s.Client.GetAccountUsername(ctx, &mobilityaccounts.GetAccountUsernameRequest{
|
resp, err := s.Client.GetAccountUsername(ctx, &mobilityaccounts.GetAccountUsernameRequest{
|
||||||
Username: username,
|
Username: username,
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
@ -85,22 +78,17 @@ func (s MobilityAccountService) GetAccountUsername(ctx context.Context,
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.ToAccountModel(resp.Account.ToStorageType()), nil
|
return s.ToAccountModel(resp.Account.ToStorageType()), nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s MobilityAccountService) Register(ctx context.Context, username string, password string,
|
func (s MobilityAccountService) Register(ctx context.Context, username string, password string, email string, phone_number string, data map[string]any, namespace string) (*models.Account, error) {
|
||||||
email string, phoneNumber string, data map[string]any, namespace string) (*models.Account, error) {
|
|
||||||
|
|
||||||
var resp *mobilityaccounts.RegisterResponse
|
|
||||||
|
|
||||||
account := &ma.Account{
|
account := &ma.Account{
|
||||||
Authentication: ma.AccountAuth{
|
Authentication: ma.AccountAuth{
|
||||||
Local: ma.LocalAuth{
|
Local: ma.LocalAuth{
|
||||||
Username: username,
|
Username: username,
|
||||||
Password: password,
|
Password: password,
|
||||||
Email: email,
|
Email: email,
|
||||||
PhoneNumber: phoneNumber,
|
PhoneNumber: phone_number,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
Namespace: namespace,
|
Namespace: namespace,
|
||||||
|
@ -112,26 +100,28 @@ func (s MobilityAccountService) Register(ctx context.Context, username string, p
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if resp, err = s.Client.Register(ctx, &mobilityaccounts.RegisterRequest{
|
resp, err := s.Client.Register(ctx, &mobilityaccounts.RegisterRequest{
|
||||||
Account: acc,
|
Account: acc,
|
||||||
}); err != nil {
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return s.ToAccountModel(resp.Account.ToStorageType()), nil
|
return s.ToAccountModel(resp.Account.ToStorageType()), nil
|
||||||
}
|
}
|
||||||
func (s MobilityAccountService) UpdatePhoneNumber(ctx context.Context, accountID string, phoneNumber string,
|
func (s MobilityAccountService) UpdatePhoneNumber(ctx context.Context, accountid string, phone_number string, verified bool, verification_code string) error {
|
||||||
verified bool, verificationCode string) error {
|
_, err := s.Client.UpdatePhoneNumber(
|
||||||
|
|
||||||
if _, err := s.Client.UpdatePhoneNumber(
|
|
||||||
ctx,
|
ctx,
|
||||||
&mobilityaccounts.UpdatePhoneNumberRequest{
|
&mobilityaccounts.UpdatePhoneNumberRequest{
|
||||||
Id: accountID,
|
Id: accountid,
|
||||||
PhoneNumber: phoneNumber,
|
PhoneNumber: phone_number,
|
||||||
Verified: verified,
|
Verified: verified,
|
||||||
VerificationCode: verificationCode,
|
VerificationCode: verification_code,
|
||||||
},
|
},
|
||||||
); err != nil {
|
)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -139,30 +129,20 @@ func (s MobilityAccountService) UpdatePhoneNumber(ctx context.Context, accountID
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s MobilityAccountService) SetAccountType(ctx context.Context, id string, accountType string) error {
|
func (s MobilityAccountService) SetAccountType(ctx context.Context, id string, accountType string) error {
|
||||||
|
account, err := s.Client.GetAccount(ctx, &mobilityaccounts.GetAccountRequest{
|
||||||
var (
|
|
||||||
account *mobilityaccounts.GetAccountResponse
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
|
|
||||||
if account, err = s.Client.GetAccount(ctx, &mobilityaccounts.GetAccountRequest{
|
|
||||||
Id: id,
|
Id: id,
|
||||||
}); err != nil {
|
})
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
|
|
||||||
data["type"] = accountType
|
data["type"] = accountType
|
||||||
|
|
||||||
dataStruct := &structpb.Struct{
|
dataStruct := &structpb.Struct{
|
||||||
Fields: make(map[string]*structpb.Value),
|
Fields: make(map[string]*structpb.Value),
|
||||||
}
|
}
|
||||||
|
|
||||||
for key, value := range data {
|
for key, value := range data {
|
||||||
|
|
||||||
stringValue, ok := value.(string)
|
stringValue, ok := value.(string)
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -173,34 +153,22 @@ func (s MobilityAccountService) SetAccountType(ctx context.Context, id string, a
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
account.Account.Data = dataStruct
|
account.Account.Data = dataStruct
|
||||||
|
_, err = s.Client.UpdateData(ctx, &mobilityaccounts.UpdateDataRequest{
|
||||||
if _, err = s.Client.UpdateData(ctx, &mobilityaccounts.UpdateDataRequest{
|
|
||||||
Account: account.Account,
|
Account: account.Account,
|
||||||
}); err != nil {
|
})
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s MobilityAccountService) UpdateAccountBirthDate(ctx context.Context, id string,
|
func (s MobilityAccountService) UpdateAccountBirthDate(ctx context.Context, id string, namespace string, birthdate string) error {
|
||||||
namespace string, birthdate string) error {
|
account, err := s.Client.GetAccount(ctx, &mobilityaccounts.GetAccountRequest{
|
||||||
|
|
||||||
var (
|
|
||||||
account *mobilityaccounts.GetAccountResponse
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
|
|
||||||
if account, err = s.Client.GetAccount(ctx, &mobilityaccounts.GetAccountRequest{
|
|
||||||
Id: id,
|
Id: id,
|
||||||
}); err != nil {
|
})
|
||||||
return err
|
|
||||||
}
|
|
||||||
data := make(map[string]interface{})
|
data := make(map[string]interface{})
|
||||||
|
|
||||||
data["birthdate"] = birthdate
|
data["birthdate"] = birthdate
|
||||||
|
|
||||||
dataStruct := &structpb.Struct{
|
dataStruct := &structpb.Struct{
|
||||||
|
@ -209,7 +177,6 @@ func (s MobilityAccountService) UpdateAccountBirthDate(ctx context.Context, id s
|
||||||
|
|
||||||
for key, value := range data {
|
for key, value := range data {
|
||||||
stringValue, ok := value.(string)
|
stringValue, ok := value.(string)
|
||||||
|
|
||||||
if !ok {
|
if !ok {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
@ -220,56 +187,47 @@ func (s MobilityAccountService) UpdateAccountBirthDate(ctx context.Context, id s
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
account.Account.Data = dataStruct
|
account.Account.Data = dataStruct
|
||||||
|
_, err = s.Client.UpdateData(ctx, &mobilityaccounts.UpdateDataRequest{
|
||||||
if _, err = s.Client.UpdateData(ctx, &mobilityaccounts.UpdateDataRequest{
|
|
||||||
Account: account.Account,
|
Account: account.Account,
|
||||||
}); err != nil {
|
})
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s MobilityAccountService) ToAccountModel(account ma.Account) *models.Account {
|
func (s MobilityAccountService) ToAccountModel(account ma.Account) *models.Account {
|
||||||
|
first_name := account.Data["first_name"].(string)
|
||||||
var (
|
last_name := account.Data["last_name"].(string)
|
||||||
accountType, birthDate, phoneNumber, email string
|
birth_date, ok := account.Data["birthdate"].(string)
|
||||||
ok bool
|
if !ok {
|
||||||
)
|
birth_date = ""
|
||||||
|
|
||||||
firstName := account.Data["first_name"].(string)
|
|
||||||
lastName := account.Data["last_name"].(string)
|
|
||||||
|
|
||||||
if birthDate, ok = account.Data["birthdate"].(string); !ok {
|
|
||||||
birthDate = ""
|
|
||||||
}
|
}
|
||||||
|
accountType, ok := account.Data["type"].(string)
|
||||||
if accountType, ok = account.Data["type"].(string); !ok {
|
if !ok {
|
||||||
accountType = ""
|
accountType = ""
|
||||||
}
|
}
|
||||||
|
phone_number, ok := account.Data["phone_number"].(string)
|
||||||
if phoneNumber, ok = account.Data["phone_number"].(string); !ok {
|
if !ok {
|
||||||
phoneNumber = ""
|
phone_number = ""
|
||||||
}
|
}
|
||||||
|
email, ok := account.Data["email"].(string)
|
||||||
if email, ok = account.Data["email"].(string); !ok {
|
if !ok {
|
||||||
email = ""
|
email = ""
|
||||||
}
|
}
|
||||||
|
|
||||||
return &models.Account{
|
return &models.Account{
|
||||||
ID: account.ID,
|
ID: account.ID,
|
||||||
FirstName: firstName,
|
FirstName: first_name,
|
||||||
LastName: lastName,
|
LastName: last_name,
|
||||||
Email: email,
|
Email: email,
|
||||||
BirthDate: birthDate,
|
BirthDate: birth_date,
|
||||||
Type: accountType,
|
Type: accountType,
|
||||||
LocalCredentials: models.LocalCredentials{
|
LocalCredentials: models.LocalCredentials{
|
||||||
Email: account.Authentication.Local.Email,
|
Email: account.Authentication.Local.Email,
|
||||||
EmailVerified: account.Authentication.Local.EmailValidation.Validated,
|
EmailVerified: account.Authentication.Local.EmailValidation.Validated,
|
||||||
EmailValidationCode: account.Authentication.Local.EmailValidation.ValidationCode,
|
EmailValidationCode: account.Authentication.Local.EmailValidation.ValidationCode,
|
||||||
PhoneNumber: phoneNumber,
|
PhoneNumber: phone_number,
|
||||||
PhoneNumberVerified: account.Authentication.Local.PhoneNumberValidation.Validated,
|
PhoneNumberVerified: account.Authentication.Local.PhoneNumberValidation.Validated,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,12 +2,11 @@ package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
"google.golang.org/protobuf/types/known/structpb"
|
||||||
|
|
||||||
"github.com/appleboy/gorush/rpc/proto"
|
"github.com/appleboy/gorush/rpc/proto"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"google.golang.org/grpc"
|
"google.golang.org/grpc"
|
||||||
"google.golang.org/grpc/credentials/insecure"
|
|
||||||
"google.golang.org/protobuf/types/known/structpb"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
|
@ -37,8 +36,7 @@ type PushService struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewPushService(address string) (*PushService, error) {
|
func NewPushService(address string) (*PushService, error) {
|
||||||
conn, err := grpc.NewClient(address,
|
conn, err := grpc.Dial(address, grpc.WithInsecure())
|
||||||
grpc.WithTransportCredentials(insecure.NewCredentials()))
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -50,12 +48,6 @@ func NewPushService(address string) (*PushService, error) {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *PushService) Send(notification Notification) error {
|
func (s *PushService) Send(notification Notification) error {
|
||||||
|
|
||||||
var (
|
|
||||||
resp *proto.NotificationReply
|
|
||||||
err error
|
|
||||||
)
|
|
||||||
|
|
||||||
log.Debug().
|
log.Debug().
|
||||||
Int32("Platform", notification.Platform).
|
Int32("Platform", notification.Platform).
|
||||||
Strs("recipients", notification.Recipients).
|
Strs("recipients", notification.Recipients).
|
||||||
|
@ -63,7 +55,7 @@ func (s *PushService) Send(notification Notification) error {
|
||||||
Str("notification_title", notification.Title).
|
Str("notification_title", notification.Title).
|
||||||
Msg("Send notification")
|
Msg("Send notification")
|
||||||
|
|
||||||
if resp, err = s.Client.Send(context.Background(), &proto.NotificationRequest{
|
resp, err := s.Client.Send(context.Background(), &proto.NotificationRequest{
|
||||||
Data: notification.Data,
|
Data: notification.Data,
|
||||||
ID: notification.ID,
|
ID: notification.ID,
|
||||||
Platform: notification.Platform,
|
Platform: notification.Platform,
|
||||||
|
@ -75,7 +67,9 @@ func (s *PushService) Send(notification Notification) error {
|
||||||
Title: notification.Title,
|
Title: notification.Title,
|
||||||
Body: notification.Message,
|
Body: notification.Message,
|
||||||
},
|
},
|
||||||
}); err != nil {
|
})
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,58 +2,53 @@ package services
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"git.coopgo.io/coopgo-platform/geocode"
|
"git.coopgo.io/coopgo-platform/geocode"
|
||||||
"git.coopgo.io/coopgo-platform/routing-service"
|
routing "git.coopgo.io/coopgo-platform/routing-service"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ServiceHandler struct {
|
type ServicesHandler struct {
|
||||||
MobilityAccounts MobilityAccountService
|
MobilityAccounts MobilityAccountService
|
||||||
Push *PushService
|
Push *PushService
|
||||||
Geocoder geocode.Geocoder
|
Geocoder geocode.Geocoder
|
||||||
Routing routing.RoutingService
|
Routing routing.RoutingService
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewServicesHandler(cfg *viper.Viper) (*ServiceHandler, error) {
|
func NewServicesHandler(cfg *viper.Viper) (*ServicesHandler, error) {
|
||||||
var (
|
var (
|
||||||
mobilityAccountsDial = cfg.GetString("services.internal.mobility_accounts.dial")
|
mobilityAccountsDial = cfg.GetString("services.internal.mobility_accounts.dial")
|
||||||
pushDial = cfg.GetString("services.internal.push.dial")
|
pushDial = cfg.GetString("services.internal.push.dial")
|
||||||
geocoderType = cfg.GetString("geocoder.type")
|
geocoder_type = cfg.GetString("geocoder.type")
|
||||||
peliasBaseUrl = cfg.GetString("geocoder.pelias.base_url")
|
pelias_base_url = cfg.GetString("geocoder.pelias.base_url")
|
||||||
routingServiceType = cfg.GetString("routing.type")
|
routing_service_type = cfg.GetString("routing.type")
|
||||||
valhallaBaseUrl = cfg.GetString("routing.valhalla.base_url")
|
valhalla_base_url = cfg.GetString("routing.valhalla.base_url")
|
||||||
|
|
||||||
mobilityAccounts MobilityAccountService
|
|
||||||
push *PushService
|
|
||||||
geocoder geocode.Geocoder
|
|
||||||
routingsvc routing.RoutingService
|
|
||||||
err error
|
|
||||||
)
|
)
|
||||||
|
mobilityAccounts, err := NewMobilityAccountService(mobilityAccountsDial)
|
||||||
if mobilityAccounts, err = NewMobilityAccountService(mobilityAccountsDial); err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Could not connect to Mobility Accounts Service")
|
log.Fatal().Err(err).Msg("Could not connect to Mobility Accounts Service")
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
push, err := NewPushService(pushDial)
|
||||||
if push, err = NewPushService(pushDial); err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Could not connect to Push Notifications Service")
|
log.Fatal().Err(err).Msg("Could not connect to Push Notifications Service")
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
geocoder, err := geocode.NewGeocoder(geocoder_type, pelias_base_url)
|
||||||
if geocoder, err = geocode.NewGeocoder(geocoderType, peliasBaseUrl); err != nil {
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Could not initiate the Geocoder service")
|
log.Fatal().Err(err).Msg("Could not initiate the Geocoder service")
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
if routingsvc, err = routing.NewRoutingService(routingServiceType, valhallaBaseUrl); err != nil {
|
routing, err := routing.NewRoutingService(routing_service_type, valhalla_base_url)
|
||||||
|
if err != nil {
|
||||||
log.Fatal().Err(err).Msg("Could not initiate the routing service")
|
log.Fatal().Err(err).Msg("Could not initiate the routing service")
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &ServiceHandler{
|
return &ServicesHandler{
|
||||||
MobilityAccounts: mobilityAccounts,
|
MobilityAccounts: mobilityAccounts,
|
||||||
Push: push,
|
Push: push,
|
||||||
Geocoder: geocoder,
|
Geocoder: geocoder,
|
||||||
Routing: routingsvc,
|
Routing: routing,
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,12 @@ package storage
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strconv"
|
|
||||||
"strings"
|
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
_ "github.com/lib/pq"
|
_ "github.com/lib/pq"
|
||||||
"github.com/rs/zerolog/log"
|
"github.com/rs/zerolog/log"
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
|
"strconv"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type PostgresqlStorage struct {
|
type PostgresqlStorage struct {
|
||||||
|
@ -25,74 +24,65 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) {
|
||||||
user = cfg.GetString("storage.db.psql.user")
|
user = cfg.GetString("storage.db.psql.user")
|
||||||
password = cfg.GetString("storage.db.psql.password")
|
password = cfg.GetString("storage.db.psql.password")
|
||||||
dbname = cfg.GetString("storage.db.psql.dbname")
|
dbname = cfg.GetString("storage.db.psql.dbname")
|
||||||
sslMode = cfg.GetString("storage.db.psql.sslMode")
|
sslmode = cfg.GetString("storage.db.psql.sslmode")
|
||||||
pgSchema = cfg.GetString("storage.db.psql.schema")
|
pg_schema = cfg.GetString("storage.db.psql.schema")
|
||||||
pgtablesUsersFirebase = cfg.GetString("storage.db.psql.tables.users_firebase")
|
pgtables_users_firebase = cfg.GetString("storage.db.psql.tables.users_firebase")
|
||||||
)
|
)
|
||||||
|
|
||||||
portInt, _ := strconv.Atoi(port)
|
portInt, _ := strconv.Atoi(port)
|
||||||
|
psqlconn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslmode=%s", host, portInt, user, password, dbname, sslmode)
|
||||||
psqlConn := fmt.Sprintf("host=%s port=%d user=%s password=%s dbname=%s sslMode=%s",
|
db, err := sql.Open("postgres", psqlconn)
|
||||||
host, portInt, user, password, dbname, sslMode)
|
|
||||||
|
|
||||||
db, err := sql.Open("postgres", psqlConn)
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("opening connection to postgresql failed")
|
log.Error().Err(err).Msg("opening connection to postgresql failed")
|
||||||
return PostgresqlStorage{}, fmt.Errorf("connection to postgresql failed")
|
return PostgresqlStorage{}, fmt.Errorf("connection to postgresql failed")
|
||||||
}
|
}
|
||||||
|
err = db.Ping()
|
||||||
if err = db.Ping(); err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("ping to postgresql failed")
|
log.Error().Err(err).Msg("ping to postgresql failed")
|
||||||
return PostgresqlStorage{}, fmt.Errorf("connection to postgresql database failed")
|
return PostgresqlStorage{}, fmt.Errorf("connection to postgresql database failed")
|
||||||
}
|
}
|
||||||
|
|
||||||
return PostgresqlStorage{
|
return PostgresqlStorage{
|
||||||
DbConnection: db,
|
DbConnection: db,
|
||||||
Schema: pgSchema,
|
Schema: pg_schema,
|
||||||
Tables: map[string]string{
|
Tables: map[string]string{
|
||||||
"users_firebase": fmt.Sprintf("%s.%s", pgSchema, pgtablesUsersFirebase),
|
"users_firebase": fmt.Sprintf("%s.%s", pg_schema, pgtables_users_firebase),
|
||||||
},
|
},
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s PostgresqlStorage) CreateFirebaseToken(userId string, fcmToken string, devicePlatform string) (err error) {
|
func (s PostgresqlStorage) CreateFirebaseToken(user_id string, fcm_token string, device_platform string) (err error) {
|
||||||
|
_, err = uuid.Parse(user_id)
|
||||||
if _, err = uuid.Parse(userId); err != nil {
|
if err != nil {
|
||||||
log.Error().Err(err).Msg("Postgresql Storage CreateFirebaseToken invalid User ID")
|
log.Error().Err(err).Msg("Postgresql Storage CreateFirebaseToken invalid User ID")
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
if _, err = s.DbConnection.Exec(fmt.Sprintf("INSERT INTO %s "+
|
_, err = s.DbConnection.Exec(fmt.Sprintf("INSERT INTO %s (user_id , fcm_token , device_platform) VALUES($1,$2,$3)", s.Tables["users_firebase"]),
|
||||||
"(user_id , fcm_token , device_platform) VALUES($1,$2,$3)", s.Tables["users_firebase"]),
|
user_id,
|
||||||
userId,
|
fcm_token,
|
||||||
fcmToken,
|
device_platform)
|
||||||
devicePlatform); err != nil {
|
if err != nil {
|
||||||
if strings.Contains(err.Error(), "duplicate key") {
|
if strings.Contains(err.Error(), "duplicate key") {
|
||||||
_ = s.UpdateFirebaseToken(userId, devicePlatform, fcmToken)
|
_ = s.UpdateFirebaseToken(user_id, device_platform, fcm_token)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
func (s PostgresqlStorage) GetFirebaseToken(userId string) (fcm string, devicePlatform string, err error) {
|
func (s PostgresqlStorage) GetFirebaseToken(user_id string) (fcm string, device_platform string, err error) {
|
||||||
if err = s.DbConnection.QueryRow(fmt.Sprintf("SELECT fcm_token , "+
|
err = s.DbConnection.QueryRow(fmt.Sprintf("SELECT fcm_token , device_platform FROM %s WHERE user_id = $1", s.Tables["users_firebase"]), user_id).
|
||||||
"device_platform FROM %s WHERE user_id = $1", s.Tables["users_firebase"]), userId).
|
|
||||||
Scan(
|
Scan(
|
||||||
&fcm,
|
&fcm,
|
||||||
&devicePlatform,
|
&device_platform,
|
||||||
); err != nil {
|
)
|
||||||
|
if err != nil {
|
||||||
return "", "", err
|
return "", "", err
|
||||||
}
|
}
|
||||||
|
return fcm, device_platform, nil
|
||||||
return fcm, devicePlatform, nil
|
|
||||||
}
|
}
|
||||||
func (s PostgresqlStorage) UpdateFirebaseToken(userId string, fcmToken string, devicePlatform string) error {
|
func (s PostgresqlStorage) UpdateFirebaseToken(user_id string, fcm_token string, device_platform string) error {
|
||||||
query := fmt.Sprintf("UPDATE %s SET fcm_token ="+
|
query := fmt.Sprintf("UPDATE %s SET fcm_token = $1 device_platform = $2 WHERE user_id = $3", s.Tables["users_firebase"])
|
||||||
" $1 device_platform = $2 WHERE user_id = $3", s.Tables["users_firebase"])
|
_, err := s.DbConnection.Exec(query, fcm_token, device_platform, user_id)
|
||||||
|
if err != nil {
|
||||||
if _, err := s.DbConnection.Exec(query, fcmToken, devicePlatform, userId); err != nil {
|
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,25 +2,24 @@ package storage
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"github.com/spf13/viper"
|
"github.com/spf13/viper"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Storage interface {
|
type Storage interface {
|
||||||
CreateFirebaseToken(userId string, fcmToken string, devicePlatform string) (err error)
|
CreateFirebaseToken(user_id string, fcm_token string, device_platform string) (err error)
|
||||||
UpdateFirebaseToken(userId string, fcmToken string, devicePlatform string) error
|
UpdateFirebaseToken(user_id string, fcm_token string, device_platform string) error
|
||||||
GetFirebaseToken(userId string) (fcm string, devicePlatform string, err error)
|
GetFirebaseToken(user_id string) (fcm string, device_platform string, err error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewStorage(cfg *viper.Viper) (Storage, error) {
|
func NewStorage(cfg *viper.Viper) (Storage, error) {
|
||||||
var (
|
var (
|
||||||
storageType = cfg.GetString("storage.db.type")
|
storage_type = cfg.GetString("storage.db.type")
|
||||||
)
|
)
|
||||||
switch storageType {
|
switch storage_type {
|
||||||
case "psql":
|
case "psql":
|
||||||
s, err := NewPostgresqlStorage(cfg)
|
s, err := NewPostgresqlStorage(cfg)
|
||||||
return s, err
|
return s, err
|
||||||
default:
|
default:
|
||||||
return nil, fmt.Errorf("storage type %v is not supported", storageType)
|
return nil, fmt.Errorf("storage type %v is not supported", storage_type)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue