Compare commits
21 Commits
f5938d23df
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
38cb3c5ad9 | ||
|
|
b431d460bf | ||
|
|
4392f22783 | ||
|
|
5dbb3e23d4 | ||
|
|
feb4909a70 | ||
|
|
51068be38b | ||
|
|
678286b384 | ||
|
|
b7ac71741f | ||
| a95cd6eb55 | |||
| 30a3d18277 | |||
| 4b6de48764 | |||
| 9f0dd430e8 | |||
| 88e3bae685 | |||
| fe30c3fc12 | |||
| 575b8129b7 | |||
| 4718de6c80 | |||
| d465ef56c9 | |||
| 0ad6ce8762 | |||
| 6dc6774ea7 | |||
| 201e803c6a | |||
| e0b7d73e74 |
65
.gitea/workflows/build.yml
Normal file
65
.gitea/workflows/build.yml
Normal file
@@ -0,0 +1,65 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "*"
|
||||
branches:
|
||||
- main
|
||||
- dev
|
||||
|
||||
jobs:
|
||||
build_and_push:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install Docker
|
||||
run: |
|
||||
apt-get update
|
||||
apt-get install -y docker.io
|
||||
|
||||
- name: Checkout Repository
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set Kubernetes Context
|
||||
uses: azure/k8s-set-context@v4
|
||||
with:
|
||||
method: kubeconfig
|
||||
kubeconfig: ${{secrets.buildx_kubeconfig}}
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
with:
|
||||
driver: kubernetes
|
||||
driver-opts: |
|
||||
namespace=gitea
|
||||
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.coopgo.io
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker image
|
||||
id: metadata
|
||||
uses: docker/metadata-action@v3
|
||||
with:
|
||||
images: git.coopgo.io/${{gitea.repository}}
|
||||
tags: |
|
||||
type=ref,event=branch
|
||||
type=ref,event=tag
|
||||
type=ref,event=pr
|
||||
flavor: |
|
||||
latest=auto
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v5
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: |
|
||||
${{ steps.metadata.outputs.tags }}
|
||||
build-args: |
|
||||
ACCESS_TOKEN_USR=${{gitea.actor}}
|
||||
ACCESS_TOKEN_PWD=${{gitea.token}}
|
||||
660
LICENSE.md
Normal file
660
LICENSE.md
Normal file
@@ -0,0 +1,660 @@
|
||||
# GNU AFFERO GENERAL PUBLIC LICENSE
|
||||
|
||||
Version 3, 19 November 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc.
|
||||
<https://fsf.org/>
|
||||
|
||||
Everyone is permitted to copy and distribute verbatim copies of this
|
||||
license document, but changing it is not allowed.
|
||||
|
||||
## Preamble
|
||||
|
||||
The GNU Affero General Public License is a free, copyleft license for
|
||||
software and other kinds of works, specifically designed to ensure
|
||||
cooperation with the community in the case of network server software.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
our General Public Licenses are intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains
|
||||
free software for all its users.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
Developers that use our General Public Licenses protect your rights
|
||||
with two steps: (1) assert copyright on the software, and (2) offer
|
||||
you this License which gives you legal permission to copy, distribute
|
||||
and/or modify the software.
|
||||
|
||||
A secondary benefit of defending all users' freedom is that
|
||||
improvements made in alternate versions of the program, if they
|
||||
receive widespread use, become available for other developers to
|
||||
incorporate. Many developers of free software are heartened and
|
||||
encouraged by the resulting cooperation. However, in the case of
|
||||
software used on network servers, this result may fail to come about.
|
||||
The GNU General Public License permits making a modified version and
|
||||
letting the public access it on a server without ever releasing its
|
||||
source code to the public.
|
||||
|
||||
The GNU Affero General Public License is designed specifically to
|
||||
ensure that, in such cases, the modified source code becomes available
|
||||
to the community. It requires the operator of a network server to
|
||||
provide the source code of the modified version running there to the
|
||||
users of that server. Therefore, public use of a modified version, on
|
||||
a publicly accessible server, gives the public access to the source
|
||||
code of the modified version.
|
||||
|
||||
An older license, called the Affero General Public License and
|
||||
published by Affero, was designed to accomplish similar goals. This is
|
||||
a different license, not a version of the Affero GPL, but Affero has
|
||||
released a new version of the Affero GPL which permits relicensing
|
||||
under this license.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
## TERMS AND CONDITIONS
|
||||
|
||||
### 0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU Affero General Public
|
||||
License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds
|
||||
of works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of
|
||||
an exact copy. The resulting work is called a "modified version" of
|
||||
the earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user
|
||||
through a computer network, with no transfer of a copy, is not
|
||||
conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices" to
|
||||
the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
### 1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work for
|
||||
making modifications to it. "Object code" means any non-source form of
|
||||
a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users can
|
||||
regenerate automatically from other parts of the Corresponding Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that same
|
||||
work.
|
||||
|
||||
### 2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not convey,
|
||||
without conditions so long as your license otherwise remains in force.
|
||||
You may convey covered works to others for the sole purpose of having
|
||||
them make modifications exclusively for you, or provide you with
|
||||
facilities for running those works, provided that you comply with the
|
||||
terms of this License in conveying all material for which you do not
|
||||
control copyright. Those thus making or running the covered works for
|
||||
you must do so exclusively on your behalf, under your direction and
|
||||
control, on terms that prohibit them from making any copies of your
|
||||
copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under the
|
||||
conditions stated below. Sublicensing is not allowed; section 10 makes
|
||||
it unnecessary.
|
||||
|
||||
### 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such
|
||||
circumvention is effected by exercising rights under this License with
|
||||
respect to the covered work, and you disclaim any intention to limit
|
||||
operation or modification of the work as a means of enforcing, against
|
||||
the work's users, your or third parties' legal rights to forbid
|
||||
circumvention of technological measures.
|
||||
|
||||
### 4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
### 5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these
|
||||
conditions:
|
||||
|
||||
- a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
- b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under
|
||||
section 7. This requirement modifies the requirement in section 4
|
||||
to "keep intact all notices".
|
||||
- c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
- d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
### 6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms of
|
||||
sections 4 and 5, provided that you also convey the machine-readable
|
||||
Corresponding Source under the terms of this License, in one of these
|
||||
ways:
|
||||
|
||||
- a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
- b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the Corresponding
|
||||
Source from a network server at no charge.
|
||||
- c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
- d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
- e) Convey the object code using peer-to-peer transmission,
|
||||
provided you inform other peers where the object code and
|
||||
Corresponding Source of the work are being offered to the general
|
||||
public at no charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal,
|
||||
family, or household purposes, or (2) anything designed or sold for
|
||||
incorporation into a dwelling. In determining whether a product is a
|
||||
consumer product, doubtful cases shall be resolved in favor of
|
||||
coverage. For a particular product received by a particular user,
|
||||
"normally used" refers to a typical or common use of that class of
|
||||
product, regardless of the status of the particular user or of the way
|
||||
in which the particular user actually uses, or expects or is expected
|
||||
to use, the product. A product is a consumer product regardless of
|
||||
whether the product has substantial commercial, industrial or
|
||||
non-consumer uses, unless such uses represent the only significant
|
||||
mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to
|
||||
install and execute modified versions of a covered work in that User
|
||||
Product from a modified version of its Corresponding Source. The
|
||||
information must suffice to ensure that the continued functioning of
|
||||
the modified object code is in no case prevented or interfered with
|
||||
solely because modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or
|
||||
updates for a work that has been modified or installed by the
|
||||
recipient, or for the User Product in which it has been modified or
|
||||
installed. Access to a network may be denied when the modification
|
||||
itself materially and adversely affects the operation of the network
|
||||
or violates the rules and protocols for communication across the
|
||||
network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
### 7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders
|
||||
of that material) supplement the terms of this License with terms:
|
||||
|
||||
- a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
- b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
- c) Prohibiting misrepresentation of the origin of that material,
|
||||
or requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
- d) Limiting the use for publicity purposes of names of licensors
|
||||
or authors of the material; or
|
||||
- e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
- f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions
|
||||
of it) with contractual assumptions of liability to the recipient,
|
||||
for any liability that these contractual assumptions directly
|
||||
impose on those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions; the
|
||||
above requirements apply either way.
|
||||
|
||||
### 8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your license
|
||||
from a particular copyright holder is reinstated (a) provisionally,
|
||||
unless and until the copyright holder explicitly and finally
|
||||
terminates your license, and (b) permanently, if the copyright holder
|
||||
fails to notify you of the violation by some reasonable means prior to
|
||||
60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
### 9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or run
|
||||
a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
### 10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
### 11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims owned
|
||||
or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within the
|
||||
scope of its coverage, prohibits the exercise of, or is conditioned on
|
||||
the non-exercise of one or more of the rights that are specifically
|
||||
granted under this License. You may not convey a covered work if you
|
||||
are a party to an arrangement with a third party that is in the
|
||||
business of distributing software, under which you make payment to the
|
||||
third party based on the extent of your activity of conveying the
|
||||
work, and under which the third party grants, to any of the parties
|
||||
who would receive the covered work from you, a discriminatory patent
|
||||
license (a) in connection with copies of the covered work conveyed by
|
||||
you (or copies made from those copies), or (b) primarily for and in
|
||||
connection with specific products or compilations that contain the
|
||||
covered work, unless you entered into that arrangement, or that patent
|
||||
license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
### 12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under
|
||||
this License and any other pertinent obligations, then as a
|
||||
consequence you may not convey it at all. For example, if you agree to
|
||||
terms that obligate you to collect a royalty for further conveying
|
||||
from those to whom you convey the Program, the only way you could
|
||||
satisfy both those terms and this License would be to refrain entirely
|
||||
from conveying the Program.
|
||||
|
||||
### 13. Remote Network Interaction; Use with the GNU General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, if you modify the
|
||||
Program, your modified version must prominently offer all users
|
||||
interacting with it remotely through a computer network (if your
|
||||
version supports such interaction) an opportunity to receive the
|
||||
Corresponding Source of your version by providing access to the
|
||||
Corresponding Source from a network server at no charge, through some
|
||||
standard or customary means of facilitating copying of software. This
|
||||
Corresponding Source shall include the Corresponding Source for any
|
||||
work covered by version 3 of the GNU General Public License that is
|
||||
incorporated pursuant to the following paragraph.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the work with which it is combined will remain governed by version
|
||||
3 of the GNU General Public License.
|
||||
|
||||
### 14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions
|
||||
of the GNU Affero General Public License from time to time. Such new
|
||||
versions will be similar in spirit to the present version, but may
|
||||
differ in detail to address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies that a certain numbered version of the GNU Affero General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU Affero General Public License, you may choose any version ever
|
||||
published by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future versions
|
||||
of the GNU Affero General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
### 15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
|
||||
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
|
||||
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
|
||||
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
|
||||
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
|
||||
CORRECTION.
|
||||
|
||||
### 16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
|
||||
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
|
||||
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
|
||||
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
|
||||
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
|
||||
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
### 17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
## How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these
|
||||
terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest to
|
||||
attach them to the start of each source file to most effectively state
|
||||
the exclusion of warranty; and each file should have at least the
|
||||
"copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<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/>.
|
||||
BIN
carpool-service
Executable file
BIN
carpool-service
Executable file
Binary file not shown.
39
go.mod
39
go.mod
@@ -1,38 +1,41 @@
|
||||
module git.coopgo.io/coopgo-platform/carpool-service
|
||||
|
||||
go 1.18
|
||||
go 1.23.0
|
||||
|
||||
replace git.coopgo.io/coopgo-platform/routing-service => ../../coopgo-platform/routing-service/
|
||||
toolchain go1.24.5
|
||||
|
||||
replace git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss => ./interoperability/ocss/
|
||||
// replace git.coopgo.io/coopgo-platform/routing-service => ../../coopgo-platform/routing-service/
|
||||
|
||||
// replace git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss => ./interoperability/ocss/
|
||||
|
||||
require (
|
||||
github.com/google/uuid v1.3.0
|
||||
ariga.io/atlas v0.10.1
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20251008142525-4392f227836a
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20250304234521-faabcc54f536
|
||||
github.com/google/uuid v1.6.0
|
||||
github.com/lib/pq v1.10.9
|
||||
github.com/paulmach/orb v0.9.0
|
||||
github.com/rs/zerolog v1.29.0
|
||||
github.com/spf13/viper v1.15.0
|
||||
github.com/stretchr/objx v0.5.0
|
||||
github.com/stretchr/testify v1.8.2
|
||||
go.mongodb.org/mongo-driver v1.11.3
|
||||
google.golang.org/grpc v1.53.0
|
||||
google.golang.org/protobuf v1.30.0
|
||||
google.golang.org/grpc v1.75.1
|
||||
google.golang.org/protobuf v1.36.6
|
||||
)
|
||||
|
||||
require (
|
||||
ariga.io/atlas v0.10.1 // indirect
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20230329224518-bf6453b9639a // indirect
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329165521-1442647132b9 // indirect
|
||||
github.com/agext/levenshtein v1.2.1 // indirect
|
||||
github.com/apparentlymart/go-textseg/v13 v13.0.0 // indirect
|
||||
github.com/davecgh/go-spew v1.1.1 // indirect
|
||||
github.com/fsnotify/fsnotify v1.6.0 // indirect
|
||||
github.com/go-openapi/inflect v0.19.0 // indirect
|
||||
github.com/golang/protobuf v1.5.2 // indirect
|
||||
github.com/golang/snappy v0.0.1 // indirect
|
||||
github.com/google/go-cmp v0.5.9 // indirect
|
||||
github.com/google/go-cmp v0.7.0 // indirect
|
||||
github.com/gorilla/schema v1.2.0 // indirect
|
||||
github.com/hashicorp/hcl v1.0.0 // indirect
|
||||
github.com/hashicorp/hcl/v2 v2.10.0 // indirect
|
||||
github.com/klauspost/compress v1.13.6 // indirect
|
||||
github.com/lib/pq v1.10.9 // indirect
|
||||
github.com/magiconair/properties v1.8.7 // indirect
|
||||
github.com/mattn/go-colorable v0.1.12 // indirect
|
||||
github.com/mattn/go-isatty v0.0.14 // indirect
|
||||
@@ -46,8 +49,6 @@ require (
|
||||
github.com/spf13/cast v1.5.0 // indirect
|
||||
github.com/spf13/jwalterweatherman v1.1.0 // indirect
|
||||
github.com/spf13/pflag v1.0.5 // indirect
|
||||
github.com/stretchr/objx v0.5.0 // indirect
|
||||
github.com/stretchr/testify v1.8.2 // indirect
|
||||
github.com/subosito/gotenv v1.4.2 // indirect
|
||||
github.com/twpayne/go-polyline v1.1.1 // indirect
|
||||
github.com/xdg-go/pbkdf2 v1.0.0 // indirect
|
||||
@@ -55,11 +56,11 @@ require (
|
||||
github.com/xdg-go/stringprep v1.0.3 // indirect
|
||||
github.com/youmark/pkcs8 v0.0.0-20181117223130-1be2e3e5546d // indirect
|
||||
github.com/zclconf/go-cty v1.8.0 // indirect
|
||||
golang.org/x/crypto v0.7.0 // indirect
|
||||
golang.org/x/net v0.8.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.6.0 // indirect
|
||||
golang.org/x/text v0.8.0 // indirect
|
||||
golang.org/x/crypto v0.39.0 // indirect
|
||||
golang.org/x/net v0.41.0 // indirect
|
||||
golang.org/x/sync v0.15.0 // indirect
|
||||
golang.org/x/sys v0.33.0 // indirect
|
||||
golang.org/x/text v0.26.0 // indirect
|
||||
google.golang.org/genproto v0.0.0-20230110181048-76db0878b65f // indirect
|
||||
gopkg.in/ini.v1 v1.67.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
|
||||
87
go.sum
87
go.sum
@@ -38,22 +38,18 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
|
||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||
cloud.google.com/go/storage v1.14.0/go.mod h1:GrKmX003DSIwi9o29oFT7YDnHYwZoctc3fOKtUw0Xmo=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20230329105025-bbc682386a58 h1:BgNJLsOZc71pGH87GqFqVhxWXEUB04Vv39EcxhzjD+8=
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20230329105025-bbc682386a58/go.mod h1:sT9fl92Nb4K7rWsEeddGRbJKVi+84dnorDunIbnDYWk=
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20230329224518-bf6453b9639a h1:4n7WKFSAdI9fOnF5MowJq6pY2zSwDwnAoId5xUt0m9U=
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20230329224518-bf6453b9639a/go.mod h1:sT9fl92Nb4K7rWsEeddGRbJKVi+84dnorDunIbnDYWk=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329105109-a2dc346ed5b5 h1:7lhbgBk4oXTIK6T109IymgpoC2J4tHaU2O/rj/Y8M4s=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329105109-a2dc346ed5b5/go.mod h1:qKf4kan3/vJXVywIBHa4omSlxIOMYyR11xZrrE5v9D0=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329161053-d4ad6d1f4e33 h1:zm7lc0m0po6Tq/mjkJv7udnUEXZ+Z0swVO/anirbKmY=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329161053-d4ad6d1f4e33/go.mod h1:qKf4kan3/vJXVywIBHa4omSlxIOMYyR11xZrrE5v9D0=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329161338-761449b82889 h1:Ti1gDoERrCwXzVS1SVYskwkwu3qbPAVmh0MGB6igtPA=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329161338-761449b82889/go.mod h1:qKf4kan3/vJXVywIBHa4omSlxIOMYyR11xZrrE5v9D0=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329163129-d535e945ffe9 h1:Xz7r+xWvddSrhR+lmUOSI4x8WCovqQslj5bVA+ZFiyg=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329163129-d535e945ffe9/go.mod h1:qKf4kan3/vJXVywIBHa4omSlxIOMYyR11xZrrE5v9D0=
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20250313115904-6dc6774ea703 h1:+J2YX9Wc++c4js578NoVe1QVLkVRIf9xXgsAqd/oQ20=
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20250313115904-6dc6774ea703/go.mod h1:c9aJwNtY4PJuqAFYZ9afnx46UAZtWJ3P8ICZM02/DBA=
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20251008142525-4392f227836a h1:roBn3oQRQ/j5JBAP01wIs1UQvtm3tjui+D4EAa/Hfa4=
|
||||
git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss v0.0.0-20251008142525-4392f227836a/go.mod h1:c9aJwNtY4PJuqAFYZ9afnx46UAZtWJ3P8ICZM02/DBA=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329165521-1442647132b9 h1:GPvpqJasCouzXZbDH3GyfKV++TmjPydCpj4LDZXZmeA=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20230329165521-1442647132b9/go.mod h1:qKf4kan3/vJXVywIBHa4omSlxIOMYyR11xZrrE5v9D0=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20250304234521-faabcc54f536 h1:SllXX1VJXulfhNi+Pd0R9chksm8zO6gkWcTQ/uSMsdc=
|
||||
git.coopgo.io/coopgo-platform/routing-service v0.0.0-20250304234521-faabcc54f536/go.mod h1:Nh7o15LlV0OuO9zxvJIs9FlelpeAaLYkXtFdgIkFrgg=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
||||
github.com/DATA-DOG/go-sqlmock v1.5.0/go.mod h1:f/Ixk793poVmq4qj/V1dPUg2JEAKC73Q5eFN3EC/SaM=
|
||||
github.com/agext/levenshtein v1.2.1 h1:QmvMAjj2aEICytGiWzmxoE0x2KZvE0fvmqMOfy2tjT8=
|
||||
github.com/agext/levenshtein v1.2.1/go.mod h1:JEDfjyjHDjOF/1e4FlBE/PkbqA9OfWu2ki2W0IB5558=
|
||||
github.com/apparentlymart/go-dump v0.0.0-20180507223929-23540a00eaa3/go.mod h1:oL81AME2rN47vu18xqj1S1jPIPuN7afo62yKTNn3XMM=
|
||||
@@ -80,13 +76,19 @@ 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/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||
github.com/frankban/quicktest v1.14.3 h1:FJKSZTDHjyhriyC81FLQ0LY93eSai0ZyR/ZIkd3ZUKE=
|
||||
github.com/frankban/quicktest v1.14.3/go.mod h1:mgiwOwqx65TmIk1wJ6Q7wvnVMocbUorkibMOrVTHZps=
|
||||
github.com/fsnotify/fsnotify v1.6.0 h1:n+5WquG0fcWoWp6xPWfHdbskMCQaFnG6PfBrh1Ky4HY=
|
||||
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/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-gl/glfw/v3.3/glfw v0.0.0-20200222043503-6f7a984d4dc4/go.mod h1:tQ2UAYgL5IevRw8kRxooKSPJfGvJ9fJQFa0TUsXzTg8=
|
||||
github.com/go-logr/logr v1.4.3 h1:CjnDlHq8ikf6E492q6eKboGOC0T8CDaOvkHCIg8idEI=
|
||||
github.com/go-logr/logr v1.4.3/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
|
||||
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||
github.com/go-openapi/inflect v0.19.0 h1:9jCH9scKIbHeV9m12SmPilScz6krDxKRasNNSNPXu/4=
|
||||
github.com/go-openapi/inflect v0.19.0/go.mod h1:lHpZVlpIQqLyKwJ4N+YSc9hchQy/i12fJykb83CRBH4=
|
||||
github.com/go-test/deep v1.0.3 h1:ZrJSEWsXzPOxaZnFteGEfooLba+ju3FYIbOrS+rQd68=
|
||||
github.com/go-test/deep v1.0.3/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
|
||||
github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5xrFpKfA=
|
||||
github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q=
|
||||
@@ -117,8 +119,8 @@ github.com/golang/protobuf v1.4.1/go.mod h1:U8fpvMrcmy5pZrNK1lt4xCsGvpyWQ/VVv6QD
|
||||
github.com/golang/protobuf v1.4.2/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.4.3/go.mod h1:oDoupMAO8OvCJWAcko0GGGIgR6R6ocIYbsSw735rRwI=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw=
|
||||
github.com/golang/protobuf v1.5.2/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
|
||||
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
|
||||
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
|
||||
github.com/golang/snappy v0.0.1 h1:Qgr9rKW7uDUkrbSmQeiDsGa8SjGyCOGtuasMWwvp2P4=
|
||||
github.com/golang/snappy v0.0.1/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
|
||||
github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
|
||||
@@ -133,8 +135,8 @@ github.com/google/go-cmp v0.5.1/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/
|
||||
github.com/google/go-cmp v0.5.2/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.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
|
||||
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
|
||||
github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=
|
||||
github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU=
|
||||
github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
|
||||
github.com/google/martian/v3 v3.0.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
github.com/google/martian/v3 v3.1.0/go.mod h1:y5Zk1BBys9G+gd6Jrk0W3cC1+ELVxBWuIGO+w/tUAp0=
|
||||
@@ -150,8 +152,8 @@ github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLe
|
||||
github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
|
||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
||||
github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
|
||||
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
|
||||
@@ -174,9 +176,12 @@ github.com/klauspost/compress v1.13.6/go.mod h1:/3/Vjq9QcHkK5uEr5lBEmyoZ1iFhe47e
|
||||
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.3.0 h1:WgNl7dwNpEZ6jJ9k1snq4pZsg7DOEN8hP9Xw0Tsjwk0=
|
||||
github.com/kr/pretty v0.3.0/go.mod h1:640gp4NfQd8pI5XOwp5fnNeVWj67G7CFk/SaSQn7NBk=
|
||||
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.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
|
||||
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
|
||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348 h1:MtvEpTB6LX3vkb4ax0b5D2DHbNAUsen0Gx5wZoq3lV4=
|
||||
github.com/kylelemons/godebug v0.0.0-20170820004349-d65d576e9348/go.mod h1:B69LEHPfb2qLo0BaaOLcbitczOKLWTsrBG9LczfCD4k=
|
||||
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
|
||||
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
|
||||
@@ -205,9 +210,11 @@ 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/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||
github.com/rogpeppe/go-internal v1.6.1 h1:/FiVV8dS/e+YqF2JvO3yXRFbBLTIuSDkuC7aBOAvL+k=
|
||||
github.com/rogpeppe/go-internal v1.6.1/go.mod h1:xXDCJY+GAPziupqXw64V24skbSoqbTEfhy4qGm1nDQc=
|
||||
github.com/rs/xid v1.4.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg=
|
||||
github.com/rs/zerolog v1.29.0 h1:Zes4hju04hjbvkVkOhdl2HpZa+0PmVwigmo8XoORE5w=
|
||||
github.com/rs/zerolog v1.29.0/go.mod h1:NILgTygv/Uej1ra5XxGf82ZFSLk58MFGAUS2o6usyD0=
|
||||
github.com/sergi/go-diff v1.0.0 h1:Kpca3qRNrduNnOQeazBd0ysaKrUJiIuISHxogkT9RPQ=
|
||||
github.com/sergi/go-diff v1.0.0/go.mod h1:0CfEIISq7TuYL3j771MWULgwwjU+GofnZX9QAmXWZgo=
|
||||
github.com/spf13/afero v1.9.3 h1:41FoI0fD7OR7mGcKE/aOiLkGreyf8ifIOQmJANWogMk=
|
||||
github.com/spf13/afero v1.9.3/go.mod h1:iUV7ddyEEZPO5gA3zD4fJt6iStLlL+Lg4m2cihcDf8Y=
|
||||
@@ -233,7 +240,6 @@ github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
|
||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
@@ -271,6 +277,18 @@ go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.3/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.4/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||
go.opencensus.io v0.22.5/go.mod h1:5pWMHQbX5EPX2/62yrJeAkowc+lfs/XD7Uxpq3pI6kk=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
|
||||
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
|
||||
go.opentelemetry.io/otel v1.37.0 h1:9zhNfelUvx0KBfu/gb+ZgeAfAgtWrfHJZcAqFC228wQ=
|
||||
go.opentelemetry.io/otel v1.37.0/go.mod h1:ehE/umFRLnuLa/vSccNq9oS1ErUlkkK71gMcN34UG8I=
|
||||
go.opentelemetry.io/otel/metric v1.37.0 h1:mvwbQS5m0tbmqML4NqK+e3aDiO02vsf/WgbsdpcPoZE=
|
||||
go.opentelemetry.io/otel/metric v1.37.0/go.mod h1:04wGrZurHYKOc+RKeye86GwKiTb9FKm1WHtO+4EVr2E=
|
||||
go.opentelemetry.io/otel/sdk v1.37.0 h1:ItB0QUqnjesGRvNcmAcU0LyvkVyGJ2xftD29bWdDvKI=
|
||||
go.opentelemetry.io/otel/sdk v1.37.0/go.mod h1:VredYzxUvuo2q3WRcDnKDjbdvmO0sCzOvVAiY+yUkAg=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.37.0 h1:90lI228XrB9jCMuSdA0673aubgRobVZFhbjxHHspCPc=
|
||||
go.opentelemetry.io/otel/sdk/metric v1.37.0/go.mod h1:cNen4ZWfiD37l5NhS+Keb5RXVWZWpRE+9WyVCpbo5ps=
|
||||
go.opentelemetry.io/otel/trace v1.37.0 h1:HLdcFNbRQBE2imdSEgm/kwqmQj1Or1l/7bW6mxVK7z4=
|
||||
go.opentelemetry.io/otel/trace v1.37.0/go.mod h1:TlgrlQ+PtQO5XFerSPUYG0JSgGyryXewPGyayAWSBS0=
|
||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||
golang.org/x/crypto v0.0.0-20190426145343-a29dc8fdc734/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||
@@ -280,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-20211108221036-ceb1ce70b4fa/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||
golang.org/x/crypto v0.0.0-20220622213112-05595931fe9d/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4=
|
||||
golang.org/x/crypto v0.7.0 h1:AvwMYaRytfdeVt3u6mLaxYtErKYjxA2OXjJ1HHq6t3A=
|
||||
golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU=
|
||||
golang.org/x/crypto v0.39.0 h1:SHs+kF4LP+f+p14esP5jAoDpHU8Gu/v9lFRK6IT5imM=
|
||||
golang.org/x/crypto v0.39.0/go.mod h1:L+Xg3Wf6HoL4Bn4238Z6ft6KfEpN0tJGo53AAPC632U=
|
||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||
@@ -348,8 +366,8 @@ golang.org/x/net v0.0.0-20201209123823-ac852fbbde11/go.mod h1:m0MpNAwzfU5UDzcl9v
|
||||
golang.org/x/net v0.0.0-20201224014010-6772e930b67b/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||
golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||
golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
|
||||
golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
|
||||
golang.org/x/net v0.41.0 h1:vBTly1HeNPEn3wtREYfy4GZ/NECgw2Cnl+nK6Nz3uvw=
|
||||
golang.org/x/net v0.41.0/go.mod h1:B/K4NNqkfmg07DQYrbwvSluqCJOOXwUjeb/5lOisjbA=
|
||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
||||
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||
@@ -370,8 +388,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-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.1.0 h1:wsuoTGHzEhffawBOhz5CYhcrV4IdKZbEyZjBMuTp12o=
|
||||
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||
golang.org/x/sync v0.15.0 h1:KWH3jNZsfyT6xfAfKiz6MRNmd46ByHDYaZ7KSkCtdW8=
|
||||
golang.org/x/sync v0.15.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA=
|
||||
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-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||
@@ -411,8 +429,8 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc
|
||||
golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.0.0-20220908164124-27713097b956/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.33.0 h1:q3i8TbbEz+JRD9ywIRlyRAQbM0qF7hu24q3teo2hbuw=
|
||||
golang.org/x/sys v0.33.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k=
|
||||
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
|
||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||
@@ -423,8 +441,8 @@ golang.org/x/text v0.3.4/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||
golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
|
||||
golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
||||
golang.org/x/text v0.26.0 h1:P42AVeLghgTYr4+xUnTRKDMqpar+PtX7KWuNQL21L8M=
|
||||
golang.org/x/text v0.26.0/go.mod h1:QK15LZJUUQVJxhz7wXgxSy/CJaTFjd0G+YLonydOVQA=
|
||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||
@@ -481,6 +499,8 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T
|
||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
gonum.org/v1/gonum v0.16.0 h1:5+ul4Swaf3ESvrOnidPp4GZbzf0mxVQpDCYUQE7OJfk=
|
||||
gonum.org/v1/gonum v0.16.0/go.mod h1:fef3am4MQ93R2HHpKnLk4/Tbh/s0+wqD5nfa6Pnwy4E=
|
||||
google.golang.org/api v0.4.0/go.mod h1:8k5glujaEP+g9n7WNsDg8QP6cUVNI86fCNMcbazEtwE=
|
||||
google.golang.org/api v0.7.0/go.mod h1:WtwebWUNSVBH/HAw79HIFXZNqEvBhG+Ra+ax0hx3E3M=
|
||||
google.golang.org/api v0.8.0/go.mod h1:o4eAsZoiT+ibD93RtjEohWalFOjRDx6CVaqeizhEnKg=
|
||||
@@ -561,8 +581,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.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.53.0 h1:LAv2ds7cmFV/XTS3XG1NneeENYrXGmorPxsBbptIjNc=
|
||||
google.golang.org/grpc v1.53.0/go.mod h1:OnIrk0ipVdj4N5d9IUoFUx72/VlD7+jUsHwZgwSMQpw=
|
||||
google.golang.org/grpc v1.75.1 h1:/ODCNEuf9VghjgO3rqLcfg8fiOP0nSluljWFlDxELLI=
|
||||
google.golang.org/grpc v1.75.1/go.mod h1:JtPAzKiq4v1xcAB2hydNlWI2RnF85XXcV0mhKXr2ecQ=
|
||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||
@@ -574,10 +594,9 @@ google.golang.org/protobuf v1.23.1-0.20200526195155-81db48ad09cc/go.mod h1:EGpAD
|
||||
google.golang.org/protobuf v1.24.0/go.mod h1:r/3tXBNzIEhYS9I1OUVjXDlt8tc493IdKGjtUeSXeh4=
|
||||
google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY=
|
||||
google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
|
||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
|
||||
@@ -2,7 +2,6 @@ package handler
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"git.coopgo.io/coopgo-platform/carpool-service/internal"
|
||||
@@ -12,39 +11,58 @@ import (
|
||||
)
|
||||
|
||||
// Book handles the booking flow
|
||||
func (h *CarpoolServiceHandler) Book(booking ocss.Booking) (*internal.Booking, error) {
|
||||
func (h *CarpoolServiceHandler) Book(booking ocss.Booking, motivation *string) (*internal.Booking, error) {
|
||||
log.Debug().Any("booking", booking).Msg("handler - Book")
|
||||
log.Debug().Str("passengerPickupDate", booking.PassengerPickupDate.ToTime().Format(time.RFC3339)).Msg("handler - Book")
|
||||
log.Debug().Str("internal_operator_id", h.InternalOperatorID).Str("driver_operator", booking.Driver.Operator).Str("passenger_operator", booking.Passenger.Operator).Msg("operator comparison")
|
||||
futureBooking := internal.Booking{}
|
||||
roles := []string{}
|
||||
if booking.Driver.Operator == h.InternalOperatorID {
|
||||
roles = append(roles, "driver")
|
||||
log.Debug().Str("driver_journey_id", booking.DriverJourneyID).Msg("looking up driver route schedule")
|
||||
previous_search_result, err := h.Storage.GetRouteSchedule(booking.DriverJourneyID)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Str("driver_journey_id", booking.DriverJourneyID).Msg("could not get driver route schedule")
|
||||
}
|
||||
if err == nil {
|
||||
if previous_search_result.Route != nil {
|
||||
futureBooking.DriverRoute = previous_search_result.Route
|
||||
log.Debug().Msg("driver route added to booking")
|
||||
} else {
|
||||
log.Warn().Msg("driver route schedule found but route is nil")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if booking.Passenger.Operator == h.InternalOperatorID {
|
||||
roles = append(roles, "passenger")
|
||||
log.Debug().Str("passenger_journey_id", booking.PassengerJourneyID).Msg("looking up passenger route schedule")
|
||||
previous_search_result, err := h.Storage.GetRouteSchedule(booking.PassengerJourneyID)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("could not get previous result")
|
||||
log.Error().Err(err).Str("passenger_journey_id", booking.PassengerJourneyID).Msg("could not get passenger route schedule")
|
||||
}
|
||||
if err == nil {
|
||||
if previous_search_result.Route != nil {
|
||||
futureBooking.PassengerRoute = previous_search_result.Route
|
||||
log.Debug().Msg("passenger route added to booking")
|
||||
} else {
|
||||
log.Warn().Msg("passenger route schedule found but route is nil")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if len(roles) == 0 {
|
||||
return nil, fmt.Errorf("couldn't find the right operator id : \"%s\" should be set for driver or passenger", h.InternalOperatorID)
|
||||
roles = append(roles, "driver")
|
||||
// return nil, fmt.Errorf("couldn't find the right operator id : \"%s\" should be set for driver or passenger", h.InternalOperatorID)
|
||||
}
|
||||
|
||||
if _, err := uuid.Parse(booking.ID); err != nil {
|
||||
return nil, errors.New("bookingid is not a valid uuid")
|
||||
booking.ID = uuid.NewString()
|
||||
// return nil, errors.New("bookingid is not a valid uuid")
|
||||
}
|
||||
|
||||
futureBooking.Booking = booking
|
||||
futureBooking.Motivation = motivation
|
||||
|
||||
err := h.Storage.CreateBooking(futureBooking)
|
||||
if err != nil {
|
||||
@@ -91,6 +109,33 @@ func (h *CarpoolServiceHandler) GetUserBookings(user_id string, mindate *time.Ti
|
||||
return results, nil
|
||||
}
|
||||
|
||||
// GetBookings retrieves all the bookings between 2 dates
|
||||
func (h *CarpoolServiceHandler) GetBookings(mindate *time.Time, maxdate *time.Time) ([]internal.Booking, error) {
|
||||
bookings, err := h.Storage.GetAllBookings()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
results := []internal.Booking{}
|
||||
|
||||
for _, b := range bookings {
|
||||
if mindate != nil {
|
||||
if b.PassengerPickupDate.ToTime().Before(*mindate) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
if maxdate != nil {
|
||||
if b.PassengerPickupDate.ToTime().After(*maxdate) {
|
||||
continue
|
||||
}
|
||||
}
|
||||
results = append(results, b)
|
||||
}
|
||||
|
||||
return results, nil
|
||||
}
|
||||
|
||||
// UpdateBookingStatus sets a new status for a given booking id
|
||||
func (h *CarpoolServiceHandler) UpdateBookingStatus(id string, status ocss.BookingStatus) error {
|
||||
err := h.Storage.UpdateBookingStatus(id, status.String())
|
||||
if err != nil {
|
||||
|
||||
@@ -16,6 +16,7 @@ type CarpoolServiceHandler struct {
|
||||
InternalOperatorID string
|
||||
}
|
||||
|
||||
// NewCarpoolServiceHandler initiates the carpool service handler, implementing the COOPGO Carpool Service business logic
|
||||
func NewCarpoolServiceHandler(cfg *viper.Viper, storage storage.Storage, tilesHandler *tiles.TilesHandler, routing routing.RoutingService) (*CarpoolServiceHandler, error) {
|
||||
operator := cfg.GetString("interoperability.internal_operator_id")
|
||||
return &CarpoolServiceHandler{
|
||||
|
||||
@@ -58,8 +58,25 @@ func (h *CarpoolServiceHandler) CreateRegularRoutes(routes []*geojson.FeatureCol
|
||||
return nil
|
||||
}
|
||||
|
||||
func (h *CarpoolServiceHandler) GetUserRegularRoutes(userid string) ([]*geojson.FeatureCollection, error) {
|
||||
routes, err := h.Storage.GetUserRegularRoutes(userid)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error in storage - GetUserRegularRoutes")
|
||||
return nil, err
|
||||
}
|
||||
return routes, nil
|
||||
}
|
||||
|
||||
func (h *CarpoolServiceHandler) DeleteRegularRoutes(ids []string) (err error) {
|
||||
err = h.Storage.DeleteRegularRoutes(ids)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error deleteing regular routes")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
// GetUserPlanning returns the planned routes for a user between 2 dates. It transforms regular routes to multiple indivual planned route schedules
|
||||
func (h *CarpoolServiceHandler) GetUserPlanning(userid string, minDepartureDate time.Time, maxDepartureDate time.Time) (map[string][]internal.PlannedRouteSchedule, error) {
|
||||
func (h *CarpoolServiceHandler) GetUserPlanning(userid string, minDepartureDate time.Time, maxDepartureDate time.Time) (planned_schedules map[string][]internal.PlannedRouteSchedule, missing_planning bool, err error) {
|
||||
log.Debug().
|
||||
Str("user_id", userid).
|
||||
Time("min_departure_date", minDepartureDate).
|
||||
@@ -77,7 +94,11 @@ func (h *CarpoolServiceHandler) GetUserPlanning(userid string, minDepartureDate
|
||||
routes, err := h.Storage.GetUserRegularRoutes(userid)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error in storage - GetUserRegularRoutes")
|
||||
return nil, err
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
if len(routes) == 0 {
|
||||
return results, true, nil
|
||||
}
|
||||
|
||||
all_schedules := []internal.PlannedRouteSchedule{}
|
||||
@@ -87,7 +108,7 @@ func (h *CarpoolServiceHandler) GetUserPlanning(userid string, minDepartureDate
|
||||
schedules, err := rr.PlannedRouteSchedules(minDepartureDate, maxDepartureDate)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("PlannedRouteSchedules error")
|
||||
return nil, err
|
||||
return nil, false, err
|
||||
}
|
||||
|
||||
all_schedules = append(all_schedules, schedules...)
|
||||
@@ -107,11 +128,11 @@ func (h *CarpoolServiceHandler) GetUserPlanning(userid string, minDepartureDate
|
||||
err = h.Storage.StoreRouteSchedules(all_schedules)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("could not store route schedules")
|
||||
return nil, err
|
||||
return nil, false, err
|
||||
}
|
||||
}
|
||||
|
||||
return results, nil
|
||||
return results, false, nil
|
||||
}
|
||||
|
||||
// GetPlannedTrip returns a planned trip, given an ID. This should be called after getting the user planning from regular routes
|
||||
|
||||
@@ -7,12 +7,14 @@ import (
|
||||
"git.coopgo.io/coopgo-platform/carpool-service/internal"
|
||||
"git.coopgo.io/coopgo-platform/routing-service/encoding/polylines"
|
||||
"github.com/paulmach/orb"
|
||||
"github.com/paulmach/orb/geojson"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
// GetDriverJourneys searches for matching punctual planned driver journeys.
|
||||
func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival orb.Point, departureRadius *float64, arrivalRadius *float64, minDate time.Time, maxDate time.Time, count *int64) ([]internal.PlannedRouteSchedule, error) {
|
||||
|
||||
func (h *CarpoolServiceHandler) GetDriverJourneys(departureFeature *geojson.Feature, arrivalFeature *geojson.Feature, departureRadius *float64, arrivalRadius *float64, minDate time.Time, maxDate time.Time, count *int64) ([]internal.PlannedRouteSchedule, error) {
|
||||
departure := departureFeature.Point()
|
||||
arrival := arrivalFeature.Point()
|
||||
log.Debug().
|
||||
Any("departure", departure).
|
||||
Any("arrival", arrival).
|
||||
@@ -62,7 +64,7 @@ func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival o
|
||||
distanceFromArrival, indexArrival := geoutils.DistanceFromLineString(arrival, ls)
|
||||
|
||||
if indexArrival >= indexDeparture && distanceFromDeparture <= drad && distanceFromArrival <= arad {
|
||||
//routePoints := []orb.Point{r.Route.Features[0].Point(), departure, arrival, r.Route.Features[1].Point()}
|
||||
// routePoints := []orb.Point{r.Route.Features[0].Point(), departure, arrival, r.Route.Features[1].Point()}
|
||||
routePoints := []orb.Point{r.Route.Features[0].Point(), departure, arrival, r.Route.Features[1].Point()}
|
||||
log.Debug().Any("route points", routePoints).Msg("calculate multipoint route")
|
||||
itinerary, err := h.Routing.Route(routePoints)
|
||||
@@ -70,11 +72,14 @@ func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival o
|
||||
log.Error().Err(err).Msg("error getting route with viapoints")
|
||||
continue
|
||||
}
|
||||
|
||||
journeys = append(journeys, internal.PlannedRouteSchedule{
|
||||
ID: r.ID,
|
||||
Route: r.Route,
|
||||
DepartureDate: r.DepartureDate,
|
||||
Itinerary: itinerary,
|
||||
PassengerPickup: departureFeature,
|
||||
PassengerDrop: arrivalFeature,
|
||||
})
|
||||
counted = counted + 1
|
||||
if counted == *count {
|
||||
@@ -96,7 +101,6 @@ func (h *CarpoolServiceHandler) GetDriverJourneys(departure orb.Point, arrival o
|
||||
|
||||
// GetPassengerJourneys searches for matching punctual planned passenger journeys.
|
||||
func (h *CarpoolServiceHandler) GetPassengerJourneys(departure orb.Point, arrival orb.Point, departureRadius *float64, arrivalRadius *float64, minDate time.Time, maxDate time.Time, count *int64) ([]internal.PlannedRouteSchedule, error) {
|
||||
|
||||
log.Debug().
|
||||
Any("departure", departure).
|
||||
Any("arrival", arrival).
|
||||
|
||||
@@ -5,9 +5,11 @@ import (
|
||||
"github.com/paulmach/orb/geojson"
|
||||
)
|
||||
|
||||
// Booking is the internal struct to desribe a booking. It overrides ocss.Booking and adds driver and passenger routes
|
||||
type Booking struct {
|
||||
ocss.Booking `bson:",inline"`
|
||||
|
||||
DriverRoute *geojson.FeatureCollection `bson:"driver_route,omitempty"`
|
||||
PassengerRoute *geojson.FeatureCollection `bson:"passenger_route,omitempty"`
|
||||
Motivation *string `bson:"motivation,omitempty" json:"motivation,omitempty"`
|
||||
}
|
||||
|
||||
@@ -7,9 +7,13 @@ import (
|
||||
"github.com/paulmach/orb/geojson"
|
||||
)
|
||||
|
||||
// PlannedRouteSchedule describes a route at a specific date, or a journey
|
||||
// It can be used during journeys search to store journeys after they are processed from regular routes and tiles
|
||||
type PlannedRouteSchedule struct {
|
||||
ID string `bson:"_id" json:"id"`
|
||||
Route *geojson.FeatureCollection
|
||||
DepartureDate time.Time `bson:"departureDate"`
|
||||
Itinerary *routing.Route `bson:"itinerary,omitempty"`
|
||||
PassengerPickup *geojson.Feature `bson:"passengerPickup,omitempty" json:"passengerPickup,omitempty"`
|
||||
PassengerDrop *geojson.Feature `bson:"passengerDrop,omitempty" json:"passengerDrop,omitempty"`
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ import (
|
||||
"go.mongodb.org/mongo-driver/x/bsonx/bsoncore"
|
||||
)
|
||||
|
||||
// BookingStatuus describes the status of a booking
|
||||
type BookingStatus int64
|
||||
|
||||
const (
|
||||
@@ -46,6 +47,7 @@ var bookingStatustoString = map[BookingStatus]string{
|
||||
BookingValidated: "VALIDATED",
|
||||
}
|
||||
|
||||
// MarshalJSON transforms a booking status to its JSON representation
|
||||
func (s BookingStatus) MarshalJSON() ([]byte, error) {
|
||||
buffer := bytes.NewBufferString(`"`)
|
||||
buffer.WriteString(bookingStatustoString[s])
|
||||
@@ -53,10 +55,12 @@ func (s BookingStatus) MarshalJSON() ([]byte, error) {
|
||||
return buffer.Bytes(), nil
|
||||
}
|
||||
|
||||
// MarshalBSON transforms a booking status to its BSON representation for MongoDB storage
|
||||
func (s BookingStatus) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
||||
return bson.MarshalValue(bookingStatustoString[s])
|
||||
}
|
||||
|
||||
// UnmarshalJSON transforms JSON to a BookingStatus
|
||||
func (bs *BookingStatus) UnmarshalJSON(b []byte) error {
|
||||
var j string
|
||||
err := json.Unmarshal(b, &j)
|
||||
@@ -67,6 +71,7 @@ func (bs *BookingStatus) UnmarshalJSON(b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// UnmarshalBSONValue transforms BSON from MongoDB to a BookingStatus
|
||||
func (bs *BookingStatus) UnmarshalBSONValue(t bsontype.Type, b []byte) error {
|
||||
if t == bsontype.Null || len(b) == 0 {
|
||||
return nil
|
||||
@@ -79,6 +84,7 @@ func (bs *BookingStatus) UnmarshalBSONValue(t bsontype.Type, b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
// String returns the string corresponding to the BookingStatus
|
||||
func (bs *BookingStatus) String() string {
|
||||
if bs == nil {
|
||||
return ""
|
||||
@@ -86,10 +92,12 @@ func (bs *BookingStatus) String() string {
|
||||
return bookingStatustoString[*bs]
|
||||
}
|
||||
|
||||
// BookingStatusFromString creates a new BookingStatus from the given string
|
||||
func BookingStatusFromString(bs string) BookingStatus {
|
||||
return bookingStatustoID[bs]
|
||||
}
|
||||
|
||||
// Booking describes the booking parameters and status, in the context of a "Booking by API" OCSS flow
|
||||
type Booking struct {
|
||||
ID string `json:"id" bson:"_id"`
|
||||
Driver User `json:"driver"`
|
||||
@@ -109,4 +117,6 @@ type Booking struct {
|
||||
Car *Car `json:"car,omitempty" bson:"car,omitempty"`
|
||||
DriverJourneyID string `json:"driverJourneyId" bson:"driverJourneyId"`
|
||||
PassengerJourneyID string `json:"passengerJourneyId" bson:"passengerJourneyId"`
|
||||
DriverCompensationAmount *float64 `json:"driverCompensationAmount,omitempty" bson:"driverCompensationAmount,omitempty"`
|
||||
DriverCompensationCurrency *string `json:"driverCompensationCurrency,omitempty" bson:"driverCompensationCurrency,omitempty"`
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"go.mongodb.org/mongo-driver/bson/bsontype"
|
||||
)
|
||||
|
||||
// CarpoolBookingStatus describes he state of the booking event
|
||||
type CarpoolBookingStatus int64
|
||||
|
||||
const (
|
||||
|
||||
@@ -21,7 +21,7 @@ func (t JourneyScheduleType) MarshalJSON() ([]byte, error) {
|
||||
type JourneySchedule struct {
|
||||
ID *string `json:"id,omitempty"`
|
||||
PassengerPickupDate OCSSTime `json:"passengerPickupDate" bson:"passengerPickupDate"`
|
||||
//PassengerDepartureDate *OCSSTime `json:"passengerDepartureDate,omitempty"`
|
||||
// PassengerDepartureDate *OCSSTime `json:"passengerDepartureDate,omitempty"`
|
||||
DriverDepartureDate *OCSSTime `json:"driverDepartureDate,omitempty" bson:"driverDepartureDate,omitempty"`
|
||||
WebUrl *string `json:"webUrl,omitempty" bson:"webUrl,omitempty"`
|
||||
Type JourneyScheduleType `json:"type"`
|
||||
@@ -39,6 +39,6 @@ type PassengerJourney struct {
|
||||
PassengerTrip
|
||||
JourneySchedule
|
||||
|
||||
//TODO how to handle requested driverDepartureDate
|
||||
// TODO how to handle requested driverDepartureDate
|
||||
RequestedSteats *int64 `json:"requestedSeats,omitempty" bson:"requestedSeats,omitempty"`
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ import (
|
||||
type OCSSTime time.Time
|
||||
|
||||
func (t OCSSTime) MarshalJSON() ([]byte, error) {
|
||||
//do your serializing here
|
||||
// do your serializing here
|
||||
stamp := fmt.Sprintf("%v", time.Time(t).Unix())
|
||||
return []byte(stamp), nil
|
||||
}
|
||||
@@ -22,6 +22,14 @@ func (v OCSSTime) MarshalBSONValue() (bsontype.Type, []byte, error) {
|
||||
return bson.MarshalValue(time.Time(v))
|
||||
}
|
||||
|
||||
func (t *OCSSTime) ToTime() *time.Time {
|
||||
if t == nil {
|
||||
return nil
|
||||
}
|
||||
time := time.Time(*t)
|
||||
return &time
|
||||
}
|
||||
|
||||
func (t *OCSSTime) UnmarshalJSON(b []byte) error {
|
||||
var timestamp int64
|
||||
err := json.Unmarshal(b, ×tamp)
|
||||
@@ -39,7 +47,6 @@ func (t *OCSSTime) UnmarshalJSON(b []byte) error {
|
||||
}
|
||||
|
||||
func (t *OCSSTime) UnmarshalBSONValue(bt bsontype.Type, b []byte) error {
|
||||
|
||||
if bt == bsontype.Null || len(b) == 0 {
|
||||
return nil
|
||||
}
|
||||
@@ -52,11 +59,9 @@ func (t *OCSSTime) UnmarshalBSONValue(bt bsontype.Type, b []byte) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (t *OCSSTime) ToTime() *time.Time {
|
||||
if t == nil {
|
||||
return nil
|
||||
func (t *OCSSTime) Format(format string) string {
|
||||
if format == "" {
|
||||
return ""
|
||||
}
|
||||
|
||||
time := time.Time(*t)
|
||||
return &time
|
||||
return t.ToTime().Format(format)
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -154,6 +154,9 @@ message CarpoolServiceBooking {
|
||||
optional CarpoolFeatureCollection driver_route = 30;
|
||||
optional CarpoolFeatureCollection passenger_route = 31;
|
||||
optional google.protobuf.Timestamp driverDepartureDate = 32;
|
||||
optional double driver_compensation_amount = 33;
|
||||
optional string driver_compensation_currency = 34;
|
||||
optional string motivation = 35;
|
||||
}
|
||||
|
||||
message CarpoolServicePreferences {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -10,18 +10,20 @@ service CarpoolService {
|
||||
// rpc XXXX(Request) returns (Response) {}
|
||||
rpc CreateRegularRoutes(CreateRegularRoutesRequest) returns (CreateRegularRoutesResponse) {}
|
||||
rpc DeleteRegularRoutes(DeleteRegularRoutesRequest) returns (DeleteRegularRoutesResponse) {}
|
||||
rpc GetRegularRoutes(GetRegularRoutesRequest) returns (GetRegularRoutesResponse) {}
|
||||
rpc GetUserPlanning(GetUserPlanningRequest) returns (GetUserPlanningResponse) {}
|
||||
rpc GetPlannedTrip(GetPlannedTripRequest) returns (GetPlannedTripResponse) {}
|
||||
rpc GetUserBookings(GetUserBookingsRequest) returns (GetUserBookingsResponse) {}
|
||||
rpc GetCarpoolBookings(GetCarpoolBookingsRequest) returns (GetCarpoolBookingsResponse) {}
|
||||
|
||||
// OCSS interactions
|
||||
rpc DriverJourneys(DriverJourneysRequest) returns (DriverJourneysResponse) {}
|
||||
rpc PassengerJourneys(PassengerJourneysRequest) returns (PassengerJourneysResponse) {}
|
||||
rpc DriverRegularTrips(DriverRegularTripsRequest) returns (DriverRegularTripsResponse) {}
|
||||
rpc PassengerRegularTrips(PassengerRegularTripsRequest) returns (PassengerRegularTripsResponse) {}
|
||||
rpc CreateBooking(CreateBookingRequest) returns (CreateBookingResponse) {}
|
||||
rpc UpdateBooking(UpdateBookingRequest) returns (UpdateBookingResponse) {}
|
||||
rpc GetBooking(GetBookingRequest) returns (GetBookingResponse) {}
|
||||
rpc CreateBooking(CreateCarpoolBookingRequest) returns (CreateCarpoolBookingResponse) {}
|
||||
rpc UpdateBooking(UpdateCarpoolBookingRequest) returns (UpdateCarpoolBookingResponse) {}
|
||||
rpc GetBooking(GetCarpoolBookingRequest) returns (GetCarpoolBookingResponse) {}
|
||||
}
|
||||
|
||||
// Internal trips and journeys management messages
|
||||
@@ -37,6 +39,14 @@ message DeleteRegularRoutesRequest {
|
||||
|
||||
message DeleteRegularRoutesResponse {}
|
||||
|
||||
message GetRegularRoutesRequest {
|
||||
string user_id = 1;
|
||||
}
|
||||
|
||||
message GetRegularRoutesResponse {
|
||||
repeated CarpoolFeatureCollection routes = 1;
|
||||
}
|
||||
|
||||
message GetUserPlanningRequest {
|
||||
string user_id = 1;
|
||||
google.protobuf.Timestamp min_departure_date = 2;
|
||||
@@ -45,6 +55,7 @@ message GetUserPlanningRequest {
|
||||
|
||||
message GetUserPlanningResponse {
|
||||
map<string, CarpoolRoutesCollection> routes_by_dates = 1;
|
||||
bool missing_planning = 2;
|
||||
}
|
||||
|
||||
message GetPlannedTripRequest {
|
||||
@@ -65,6 +76,15 @@ message GetUserBookingsResponse {
|
||||
repeated CarpoolServiceBooking bookings = 1;
|
||||
}
|
||||
|
||||
message GetCarpoolBookingsRequest {
|
||||
optional google.protobuf.Timestamp min_date = 2;
|
||||
optional google.protobuf.Timestamp max_date = 3;
|
||||
}
|
||||
|
||||
message GetCarpoolBookingsResponse {
|
||||
repeated CarpoolServiceBooking bookings = 1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
// OCSS-like interaction messages
|
||||
@@ -78,6 +98,8 @@ message DriverJourneysRequest {
|
||||
optional double departure_radius = 7;
|
||||
optional double arrival_radius = 8;
|
||||
optional int64 count = 9;
|
||||
optional string departure_address = 10;
|
||||
optional string arrival_address = 11;
|
||||
}
|
||||
|
||||
message DriverJourneysResponse {
|
||||
@@ -138,26 +160,26 @@ message PassengerRegularTripsResponse {
|
||||
repeated CarpoolServiceDriverRegularTrip driver_regular_trips = 1;
|
||||
}
|
||||
|
||||
message CreateBookingRequest {
|
||||
message CreateCarpoolBookingRequest {
|
||||
CarpoolServiceBooking booking = 1;
|
||||
}
|
||||
|
||||
message CreateBookingResponse {
|
||||
message CreateCarpoolBookingResponse {
|
||||
CarpoolServiceBooking booking = 1;
|
||||
}
|
||||
|
||||
message UpdateBookingRequest {
|
||||
message UpdateCarpoolBookingRequest {
|
||||
string booking_id = 1;
|
||||
CarpoolServiceBookingStatus status = 2;
|
||||
string message = 3;
|
||||
}
|
||||
|
||||
message UpdateBookingResponse {}
|
||||
message UpdateCarpoolBookingResponse {}
|
||||
|
||||
message GetBookingRequest {
|
||||
message GetCarpoolBookingRequest {
|
||||
string booking_id = 1;
|
||||
}
|
||||
|
||||
message GetBookingResponse {
|
||||
message GetCarpoolBookingResponse {
|
||||
CarpoolServiceBooking booking = 1;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v3.19.4
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc v6.31.1
|
||||
// source: carpool-service.proto
|
||||
|
||||
package proto
|
||||
@@ -15,8 +15,25 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
CarpoolService_CreateRegularRoutes_FullMethodName = "/CarpoolService/CreateRegularRoutes"
|
||||
CarpoolService_DeleteRegularRoutes_FullMethodName = "/CarpoolService/DeleteRegularRoutes"
|
||||
CarpoolService_GetRegularRoutes_FullMethodName = "/CarpoolService/GetRegularRoutes"
|
||||
CarpoolService_GetUserPlanning_FullMethodName = "/CarpoolService/GetUserPlanning"
|
||||
CarpoolService_GetPlannedTrip_FullMethodName = "/CarpoolService/GetPlannedTrip"
|
||||
CarpoolService_GetUserBookings_FullMethodName = "/CarpoolService/GetUserBookings"
|
||||
CarpoolService_GetCarpoolBookings_FullMethodName = "/CarpoolService/GetCarpoolBookings"
|
||||
CarpoolService_DriverJourneys_FullMethodName = "/CarpoolService/DriverJourneys"
|
||||
CarpoolService_PassengerJourneys_FullMethodName = "/CarpoolService/PassengerJourneys"
|
||||
CarpoolService_DriverRegularTrips_FullMethodName = "/CarpoolService/DriverRegularTrips"
|
||||
CarpoolService_PassengerRegularTrips_FullMethodName = "/CarpoolService/PassengerRegularTrips"
|
||||
CarpoolService_CreateBooking_FullMethodName = "/CarpoolService/CreateBooking"
|
||||
CarpoolService_UpdateBooking_FullMethodName = "/CarpoolService/UpdateBooking"
|
||||
CarpoolService_GetBooking_FullMethodName = "/CarpoolService/GetBooking"
|
||||
)
|
||||
|
||||
// CarpoolServiceClient is the client API for CarpoolService service.
|
||||
//
|
||||
@@ -26,17 +43,19 @@ type CarpoolServiceClient interface {
|
||||
// rpc XXXX(Request) returns (Response) {}
|
||||
CreateRegularRoutes(ctx context.Context, in *CreateRegularRoutesRequest, opts ...grpc.CallOption) (*CreateRegularRoutesResponse, error)
|
||||
DeleteRegularRoutes(ctx context.Context, in *DeleteRegularRoutesRequest, opts ...grpc.CallOption) (*DeleteRegularRoutesResponse, error)
|
||||
GetRegularRoutes(ctx context.Context, in *GetRegularRoutesRequest, opts ...grpc.CallOption) (*GetRegularRoutesResponse, error)
|
||||
GetUserPlanning(ctx context.Context, in *GetUserPlanningRequest, opts ...grpc.CallOption) (*GetUserPlanningResponse, error)
|
||||
GetPlannedTrip(ctx context.Context, in *GetPlannedTripRequest, opts ...grpc.CallOption) (*GetPlannedTripResponse, error)
|
||||
GetUserBookings(ctx context.Context, in *GetUserBookingsRequest, opts ...grpc.CallOption) (*GetUserBookingsResponse, error)
|
||||
GetCarpoolBookings(ctx context.Context, in *GetCarpoolBookingsRequest, opts ...grpc.CallOption) (*GetCarpoolBookingsResponse, error)
|
||||
// OCSS interactions
|
||||
DriverJourneys(ctx context.Context, in *DriverJourneysRequest, opts ...grpc.CallOption) (*DriverJourneysResponse, error)
|
||||
PassengerJourneys(ctx context.Context, in *PassengerJourneysRequest, opts ...grpc.CallOption) (*PassengerJourneysResponse, error)
|
||||
DriverRegularTrips(ctx context.Context, in *DriverRegularTripsRequest, opts ...grpc.CallOption) (*DriverRegularTripsResponse, error)
|
||||
PassengerRegularTrips(ctx context.Context, in *PassengerRegularTripsRequest, opts ...grpc.CallOption) (*PassengerRegularTripsResponse, error)
|
||||
CreateBooking(ctx context.Context, in *CreateBookingRequest, opts ...grpc.CallOption) (*CreateBookingResponse, error)
|
||||
UpdateBooking(ctx context.Context, in *UpdateBookingRequest, opts ...grpc.CallOption) (*UpdateBookingResponse, error)
|
||||
GetBooking(ctx context.Context, in *GetBookingRequest, opts ...grpc.CallOption) (*GetBookingResponse, error)
|
||||
CreateBooking(ctx context.Context, in *CreateCarpoolBookingRequest, opts ...grpc.CallOption) (*CreateCarpoolBookingResponse, error)
|
||||
UpdateBooking(ctx context.Context, in *UpdateCarpoolBookingRequest, opts ...grpc.CallOption) (*UpdateCarpoolBookingResponse, error)
|
||||
GetBooking(ctx context.Context, in *GetCarpoolBookingRequest, opts ...grpc.CallOption) (*GetCarpoolBookingResponse, error)
|
||||
}
|
||||
|
||||
type carpoolServiceClient struct {
|
||||
@@ -48,8 +67,9 @@ func NewCarpoolServiceClient(cc grpc.ClientConnInterface) CarpoolServiceClient {
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) CreateRegularRoutes(ctx context.Context, in *CreateRegularRoutesRequest, opts ...grpc.CallOption) (*CreateRegularRoutesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateRegularRoutesResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/CreateRegularRoutes", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_CreateRegularRoutes_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -57,8 +77,19 @@ func (c *carpoolServiceClient) CreateRegularRoutes(ctx context.Context, in *Crea
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) DeleteRegularRoutes(ctx context.Context, in *DeleteRegularRoutesRequest, opts ...grpc.CallOption) (*DeleteRegularRoutesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DeleteRegularRoutesResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/DeleteRegularRoutes", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_DeleteRegularRoutes_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) GetRegularRoutes(ctx context.Context, in *GetRegularRoutesRequest, opts ...grpc.CallOption) (*GetRegularRoutesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetRegularRoutesResponse)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_GetRegularRoutes_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -66,8 +97,9 @@ func (c *carpoolServiceClient) DeleteRegularRoutes(ctx context.Context, in *Dele
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) GetUserPlanning(ctx context.Context, in *GetUserPlanningRequest, opts ...grpc.CallOption) (*GetUserPlanningResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetUserPlanningResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/GetUserPlanning", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_GetUserPlanning_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -75,8 +107,9 @@ func (c *carpoolServiceClient) GetUserPlanning(ctx context.Context, in *GetUserP
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) GetPlannedTrip(ctx context.Context, in *GetPlannedTripRequest, opts ...grpc.CallOption) (*GetPlannedTripResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetPlannedTripResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/GetPlannedTrip", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_GetPlannedTrip_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -84,8 +117,19 @@ func (c *carpoolServiceClient) GetPlannedTrip(ctx context.Context, in *GetPlanne
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) GetUserBookings(ctx context.Context, in *GetUserBookingsRequest, opts ...grpc.CallOption) (*GetUserBookingsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetUserBookingsResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/GetUserBookings", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_GetUserBookings_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) GetCarpoolBookings(ctx context.Context, in *GetCarpoolBookingsRequest, opts ...grpc.CallOption) (*GetCarpoolBookingsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCarpoolBookingsResponse)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_GetCarpoolBookings_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -93,8 +137,9 @@ func (c *carpoolServiceClient) GetUserBookings(ctx context.Context, in *GetUserB
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) DriverJourneys(ctx context.Context, in *DriverJourneysRequest, opts ...grpc.CallOption) (*DriverJourneysResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DriverJourneysResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/DriverJourneys", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_DriverJourneys_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -102,8 +147,9 @@ func (c *carpoolServiceClient) DriverJourneys(ctx context.Context, in *DriverJou
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) PassengerJourneys(ctx context.Context, in *PassengerJourneysRequest, opts ...grpc.CallOption) (*PassengerJourneysResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PassengerJourneysResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/PassengerJourneys", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_PassengerJourneys_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -111,8 +157,9 @@ func (c *carpoolServiceClient) PassengerJourneys(ctx context.Context, in *Passen
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) DriverRegularTrips(ctx context.Context, in *DriverRegularTripsRequest, opts ...grpc.CallOption) (*DriverRegularTripsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(DriverRegularTripsResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/DriverRegularTrips", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_DriverRegularTrips_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -120,35 +167,39 @@ func (c *carpoolServiceClient) DriverRegularTrips(ctx context.Context, in *Drive
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) PassengerRegularTrips(ctx context.Context, in *PassengerRegularTripsRequest, opts ...grpc.CallOption) (*PassengerRegularTripsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(PassengerRegularTripsResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/PassengerRegularTrips", in, out, opts...)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_PassengerRegularTrips_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) CreateBooking(ctx context.Context, in *CreateBookingRequest, opts ...grpc.CallOption) (*CreateBookingResponse, error) {
|
||||
out := new(CreateBookingResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/CreateBooking", in, out, opts...)
|
||||
func (c *carpoolServiceClient) CreateBooking(ctx context.Context, in *CreateCarpoolBookingRequest, opts ...grpc.CallOption) (*CreateCarpoolBookingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CreateCarpoolBookingResponse)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_CreateBooking_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) UpdateBooking(ctx context.Context, in *UpdateBookingRequest, opts ...grpc.CallOption) (*UpdateBookingResponse, error) {
|
||||
out := new(UpdateBookingResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/UpdateBooking", in, out, opts...)
|
||||
func (c *carpoolServiceClient) UpdateBooking(ctx context.Context, in *UpdateCarpoolBookingRequest, opts ...grpc.CallOption) (*UpdateCarpoolBookingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateCarpoolBookingResponse)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_UpdateBooking_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *carpoolServiceClient) GetBooking(ctx context.Context, in *GetBookingRequest, opts ...grpc.CallOption) (*GetBookingResponse, error) {
|
||||
out := new(GetBookingResponse)
|
||||
err := c.cc.Invoke(ctx, "/CarpoolService/GetBooking", in, out, opts...)
|
||||
func (c *carpoolServiceClient) GetBooking(ctx context.Context, in *GetCarpoolBookingRequest, opts ...grpc.CallOption) (*GetCarpoolBookingResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetCarpoolBookingResponse)
|
||||
err := c.cc.Invoke(ctx, CarpoolService_GetBooking_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -157,29 +208,34 @@ func (c *carpoolServiceClient) GetBooking(ctx context.Context, in *GetBookingReq
|
||||
|
||||
// CarpoolServiceServer is the server API for CarpoolService service.
|
||||
// All implementations must embed UnimplementedCarpoolServiceServer
|
||||
// for forward compatibility
|
||||
// for forward compatibility.
|
||||
type CarpoolServiceServer interface {
|
||||
// Internal trips and journeys management
|
||||
// rpc XXXX(Request) returns (Response) {}
|
||||
CreateRegularRoutes(context.Context, *CreateRegularRoutesRequest) (*CreateRegularRoutesResponse, error)
|
||||
DeleteRegularRoutes(context.Context, *DeleteRegularRoutesRequest) (*DeleteRegularRoutesResponse, error)
|
||||
GetRegularRoutes(context.Context, *GetRegularRoutesRequest) (*GetRegularRoutesResponse, error)
|
||||
GetUserPlanning(context.Context, *GetUserPlanningRequest) (*GetUserPlanningResponse, error)
|
||||
GetPlannedTrip(context.Context, *GetPlannedTripRequest) (*GetPlannedTripResponse, error)
|
||||
GetUserBookings(context.Context, *GetUserBookingsRequest) (*GetUserBookingsResponse, error)
|
||||
GetCarpoolBookings(context.Context, *GetCarpoolBookingsRequest) (*GetCarpoolBookingsResponse, error)
|
||||
// OCSS interactions
|
||||
DriverJourneys(context.Context, *DriverJourneysRequest) (*DriverJourneysResponse, error)
|
||||
PassengerJourneys(context.Context, *PassengerJourneysRequest) (*PassengerJourneysResponse, error)
|
||||
DriverRegularTrips(context.Context, *DriverRegularTripsRequest) (*DriverRegularTripsResponse, error)
|
||||
PassengerRegularTrips(context.Context, *PassengerRegularTripsRequest) (*PassengerRegularTripsResponse, error)
|
||||
CreateBooking(context.Context, *CreateBookingRequest) (*CreateBookingResponse, error)
|
||||
UpdateBooking(context.Context, *UpdateBookingRequest) (*UpdateBookingResponse, error)
|
||||
GetBooking(context.Context, *GetBookingRequest) (*GetBookingResponse, error)
|
||||
CreateBooking(context.Context, *CreateCarpoolBookingRequest) (*CreateCarpoolBookingResponse, error)
|
||||
UpdateBooking(context.Context, *UpdateCarpoolBookingRequest) (*UpdateCarpoolBookingResponse, error)
|
||||
GetBooking(context.Context, *GetCarpoolBookingRequest) (*GetCarpoolBookingResponse, error)
|
||||
mustEmbedUnimplementedCarpoolServiceServer()
|
||||
}
|
||||
|
||||
// UnimplementedCarpoolServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedCarpoolServiceServer struct {
|
||||
}
|
||||
// UnimplementedCarpoolServiceServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedCarpoolServiceServer struct{}
|
||||
|
||||
func (UnimplementedCarpoolServiceServer) CreateRegularRoutes(context.Context, *CreateRegularRoutesRequest) (*CreateRegularRoutesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateRegularRoutes not implemented")
|
||||
@@ -187,6 +243,9 @@ func (UnimplementedCarpoolServiceServer) CreateRegularRoutes(context.Context, *C
|
||||
func (UnimplementedCarpoolServiceServer) DeleteRegularRoutes(context.Context, *DeleteRegularRoutesRequest) (*DeleteRegularRoutesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteRegularRoutes not implemented")
|
||||
}
|
||||
func (UnimplementedCarpoolServiceServer) GetRegularRoutes(context.Context, *GetRegularRoutesRequest) (*GetRegularRoutesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRegularRoutes not implemented")
|
||||
}
|
||||
func (UnimplementedCarpoolServiceServer) GetUserPlanning(context.Context, *GetUserPlanningRequest) (*GetUserPlanningResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUserPlanning not implemented")
|
||||
}
|
||||
@@ -196,6 +255,9 @@ func (UnimplementedCarpoolServiceServer) GetPlannedTrip(context.Context, *GetPla
|
||||
func (UnimplementedCarpoolServiceServer) GetUserBookings(context.Context, *GetUserBookingsRequest) (*GetUserBookingsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetUserBookings not implemented")
|
||||
}
|
||||
func (UnimplementedCarpoolServiceServer) GetCarpoolBookings(context.Context, *GetCarpoolBookingsRequest) (*GetCarpoolBookingsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetCarpoolBookings not implemented")
|
||||
}
|
||||
func (UnimplementedCarpoolServiceServer) DriverJourneys(context.Context, *DriverJourneysRequest) (*DriverJourneysResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DriverJourneys not implemented")
|
||||
}
|
||||
@@ -208,16 +270,17 @@ func (UnimplementedCarpoolServiceServer) DriverRegularTrips(context.Context, *Dr
|
||||
func (UnimplementedCarpoolServiceServer) PassengerRegularTrips(context.Context, *PassengerRegularTripsRequest) (*PassengerRegularTripsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PassengerRegularTrips not implemented")
|
||||
}
|
||||
func (UnimplementedCarpoolServiceServer) CreateBooking(context.Context, *CreateBookingRequest) (*CreateBookingResponse, error) {
|
||||
func (UnimplementedCarpoolServiceServer) CreateBooking(context.Context, *CreateCarpoolBookingRequest) (*CreateCarpoolBookingResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CreateBooking not implemented")
|
||||
}
|
||||
func (UnimplementedCarpoolServiceServer) UpdateBooking(context.Context, *UpdateBookingRequest) (*UpdateBookingResponse, error) {
|
||||
func (UnimplementedCarpoolServiceServer) UpdateBooking(context.Context, *UpdateCarpoolBookingRequest) (*UpdateCarpoolBookingResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateBooking not implemented")
|
||||
}
|
||||
func (UnimplementedCarpoolServiceServer) GetBooking(context.Context, *GetBookingRequest) (*GetBookingResponse, error) {
|
||||
func (UnimplementedCarpoolServiceServer) GetBooking(context.Context, *GetCarpoolBookingRequest) (*GetCarpoolBookingResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetBooking not implemented")
|
||||
}
|
||||
func (UnimplementedCarpoolServiceServer) mustEmbedUnimplementedCarpoolServiceServer() {}
|
||||
func (UnimplementedCarpoolServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeCarpoolServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to CarpoolServiceServer will
|
||||
@@ -227,6 +290,13 @@ type UnsafeCarpoolServiceServer interface {
|
||||
}
|
||||
|
||||
func RegisterCarpoolServiceServer(s grpc.ServiceRegistrar, srv CarpoolServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedCarpoolServiceServer 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(&CarpoolService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
@@ -240,7 +310,7 @@ func _CarpoolService_CreateRegularRoutes_Handler(srv interface{}, ctx context.Co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/CreateRegularRoutes",
|
||||
FullMethod: CarpoolService_CreateRegularRoutes_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).CreateRegularRoutes(ctx, req.(*CreateRegularRoutesRequest))
|
||||
@@ -258,7 +328,7 @@ func _CarpoolService_DeleteRegularRoutes_Handler(srv interface{}, ctx context.Co
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/DeleteRegularRoutes",
|
||||
FullMethod: CarpoolService_DeleteRegularRoutes_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).DeleteRegularRoutes(ctx, req.(*DeleteRegularRoutesRequest))
|
||||
@@ -266,6 +336,24 @@ func _CarpoolService_DeleteRegularRoutes_Handler(srv interface{}, ctx context.Co
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CarpoolService_GetRegularRoutes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetRegularRoutesRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CarpoolServiceServer).GetRegularRoutes(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CarpoolService_GetRegularRoutes_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).GetRegularRoutes(ctx, req.(*GetRegularRoutesRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CarpoolService_GetUserPlanning_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetUserPlanningRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -276,7 +364,7 @@ func _CarpoolService_GetUserPlanning_Handler(srv interface{}, ctx context.Contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/GetUserPlanning",
|
||||
FullMethod: CarpoolService_GetUserPlanning_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).GetUserPlanning(ctx, req.(*GetUserPlanningRequest))
|
||||
@@ -294,7 +382,7 @@ func _CarpoolService_GetPlannedTrip_Handler(srv interface{}, ctx context.Context
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/GetPlannedTrip",
|
||||
FullMethod: CarpoolService_GetPlannedTrip_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).GetPlannedTrip(ctx, req.(*GetPlannedTripRequest))
|
||||
@@ -312,7 +400,7 @@ func _CarpoolService_GetUserBookings_Handler(srv interface{}, ctx context.Contex
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/GetUserBookings",
|
||||
FullMethod: CarpoolService_GetUserBookings_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).GetUserBookings(ctx, req.(*GetUserBookingsRequest))
|
||||
@@ -320,6 +408,24 @@ func _CarpoolService_GetUserBookings_Handler(srv interface{}, ctx context.Contex
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CarpoolService_GetCarpoolBookings_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetCarpoolBookingsRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(CarpoolServiceServer).GetCarpoolBookings(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: CarpoolService_GetCarpoolBookings_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).GetCarpoolBookings(ctx, req.(*GetCarpoolBookingsRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CarpoolService_DriverJourneys_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DriverJourneysRequest)
|
||||
if err := dec(in); err != nil {
|
||||
@@ -330,7 +436,7 @@ func _CarpoolService_DriverJourneys_Handler(srv interface{}, ctx context.Context
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/DriverJourneys",
|
||||
FullMethod: CarpoolService_DriverJourneys_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).DriverJourneys(ctx, req.(*DriverJourneysRequest))
|
||||
@@ -348,7 +454,7 @@ func _CarpoolService_PassengerJourneys_Handler(srv interface{}, ctx context.Cont
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/PassengerJourneys",
|
||||
FullMethod: CarpoolService_PassengerJourneys_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).PassengerJourneys(ctx, req.(*PassengerJourneysRequest))
|
||||
@@ -366,7 +472,7 @@ func _CarpoolService_DriverRegularTrips_Handler(srv interface{}, ctx context.Con
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/DriverRegularTrips",
|
||||
FullMethod: CarpoolService_DriverRegularTrips_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).DriverRegularTrips(ctx, req.(*DriverRegularTripsRequest))
|
||||
@@ -384,7 +490,7 @@ func _CarpoolService_PassengerRegularTrips_Handler(srv interface{}, ctx context.
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/PassengerRegularTrips",
|
||||
FullMethod: CarpoolService_PassengerRegularTrips_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).PassengerRegularTrips(ctx, req.(*PassengerRegularTripsRequest))
|
||||
@@ -393,7 +499,7 @@ func _CarpoolService_PassengerRegularTrips_Handler(srv interface{}, ctx context.
|
||||
}
|
||||
|
||||
func _CarpoolService_CreateBooking_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CreateBookingRequest)
|
||||
in := new(CreateCarpoolBookingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -402,16 +508,16 @@ func _CarpoolService_CreateBooking_Handler(srv interface{}, ctx context.Context,
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/CreateBooking",
|
||||
FullMethod: CarpoolService_CreateBooking_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).CreateBooking(ctx, req.(*CreateBookingRequest))
|
||||
return srv.(CarpoolServiceServer).CreateBooking(ctx, req.(*CreateCarpoolBookingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CarpoolService_UpdateBooking_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UpdateBookingRequest)
|
||||
in := new(UpdateCarpoolBookingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -420,16 +526,16 @@ func _CarpoolService_UpdateBooking_Handler(srv interface{}, ctx context.Context,
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/UpdateBooking",
|
||||
FullMethod: CarpoolService_UpdateBooking_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).UpdateBooking(ctx, req.(*UpdateBookingRequest))
|
||||
return srv.(CarpoolServiceServer).UpdateBooking(ctx, req.(*UpdateCarpoolBookingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _CarpoolService_GetBooking_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(GetBookingRequest)
|
||||
in := new(GetCarpoolBookingRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -438,10 +544,10 @@ func _CarpoolService_GetBooking_Handler(srv interface{}, ctx context.Context, de
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: "/CarpoolService/GetBooking",
|
||||
FullMethod: CarpoolService_GetBooking_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(CarpoolServiceServer).GetBooking(ctx, req.(*GetBookingRequest))
|
||||
return srv.(CarpoolServiceServer).GetBooking(ctx, req.(*GetCarpoolBookingRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -461,6 +567,10 @@ var CarpoolService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "DeleteRegularRoutes",
|
||||
Handler: _CarpoolService_DeleteRegularRoutes_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRegularRoutes",
|
||||
Handler: _CarpoolService_GetRegularRoutes_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetUserPlanning",
|
||||
Handler: _CarpoolService_GetUserPlanning_Handler,
|
||||
@@ -473,6 +583,10 @@ var CarpoolService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "GetUserBookings",
|
||||
Handler: _CarpoolService_GetUserBookings_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetCarpoolBookings",
|
||||
Handler: _CarpoolService_GetCarpoolBookings_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DriverJourneys",
|
||||
Handler: _CarpoolService_DriverJourneys_Handler,
|
||||
|
||||
@@ -200,11 +200,13 @@ func (b *CarpoolServiceBooking) ToOCSS() ocss.Booking {
|
||||
}
|
||||
if b.Price != nil {
|
||||
pricetype := ocss.Unknown
|
||||
if b.Price.Type != nil {
|
||||
if *b.Price.Type == CarpoolServicePriceType_FREE {
|
||||
pricetype = ocss.Free
|
||||
} else if *b.Price.Type == CarpoolServicePriceType_PAYING {
|
||||
pricetype = ocss.Paying
|
||||
}
|
||||
}
|
||||
price = ocss.Price{
|
||||
Type: &pricetype,
|
||||
Amount: b.Price.Amount,
|
||||
@@ -265,6 +267,8 @@ func (b *CarpoolServiceBooking) ToOCSS() ocss.Booking {
|
||||
Status: status,
|
||||
DriverJourneyID: b.DriverJourneyId,
|
||||
PassengerJourneyID: b.PassengerJourneyId,
|
||||
DriverCompensationAmount: b.DriverCompensationAmount,
|
||||
DriverCompensationCurrency: b.DriverCompensationCurrency,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -348,6 +352,8 @@ func BookingFromOCSS(b ocss.Booking) *CarpoolServiceBooking {
|
||||
Price: &price,
|
||||
DriverJourneyId: b.DriverJourneyID,
|
||||
PassengerJourneyId: b.PassengerJourneyID,
|
||||
DriverCompensationAmount: b.DriverCompensationAmount,
|
||||
DriverCompensationCurrency: b.DriverCompensationCurrency,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -372,6 +378,8 @@ func BookingFromInternal(b internal.Booking) *CarpoolServiceBooking {
|
||||
}
|
||||
}
|
||||
|
||||
booking.Motivation = b.Motivation
|
||||
|
||||
return booking
|
||||
}
|
||||
|
||||
@@ -395,6 +403,25 @@ func (s CarpoolServiceBookingStatus) ToOCSS() ocss.BookingStatus {
|
||||
return ocss.BookingInitiated
|
||||
}
|
||||
|
||||
func BookingStatusFromOCSS(b ocss.BookingStatus) CarpoolServiceBookingStatus {
|
||||
if b == ocss.BookingInitiated {
|
||||
return CarpoolServiceBookingStatus_INITIATED
|
||||
} else if b == ocss.BookingWaitingDriverConfirmation {
|
||||
return CarpoolServiceBookingStatus_WAITING_DRIVER_CONFIRMATION
|
||||
} else if b == ocss.BookingWaitingPassengerConfirmation {
|
||||
return CarpoolServiceBookingStatus_WAITING_PASSENGER_CONFIRMATION
|
||||
} else if b == ocss.BookingConfirmed {
|
||||
return CarpoolServiceBookingStatus_CONFIRMED
|
||||
} else if b == ocss.BookingCompletedPendingValidation {
|
||||
return CarpoolServiceBookingStatus_COMPLETED_PENDING_VALIDATION
|
||||
} else if b == ocss.BookingValidated {
|
||||
return CarpoolServiceBookingStatus_VALIDATED
|
||||
} else if b == ocss.BookingCancelled {
|
||||
return CarpoolServiceBookingStatus_CANCELLED
|
||||
}
|
||||
return CarpoolServiceBookingStatus_INITIATED
|
||||
}
|
||||
|
||||
func (t CarpoolServiceJourneyType) ToOCSS() ocss.JourneyScheduleType {
|
||||
if t == CarpoolServiceJourneyType_DYNAMIC {
|
||||
return ocss.Dynamic
|
||||
|
||||
@@ -10,13 +10,15 @@ import (
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
func (s *CarpoolServiceServerImpl) CreateBooking(ctx context.Context, req *proto.CreateBookingRequest) (*proto.CreateBookingResponse, error) {
|
||||
func (s *CarpoolServiceServerImpl) CreateBooking(ctx context.Context, req *proto.CreateCarpoolBookingRequest) (*proto.CreateCarpoolBookingResponse, error) {
|
||||
booking := req.Booking.ToOCSS()
|
||||
_, err := s.Handler.Book(booking)
|
||||
createdBooking, err := s.Handler.Book(booking, req.Booking.Motivation)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "could not create booking - %s", err.Error())
|
||||
}
|
||||
return &proto.CreateBookingResponse{}, nil
|
||||
return &proto.CreateCarpoolBookingResponse{
|
||||
Booking: proto.BookingFromInternal(*createdBooking),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) GetUserBookings(ctx context.Context, req *proto.GetUserBookingsRequest) (*proto.GetUserBookingsResponse, error) {
|
||||
@@ -54,22 +56,55 @@ func (s *CarpoolServiceServerImpl) GetUserBookings(ctx context.Context, req *pro
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) UpdateBooking(ctx context.Context, req *proto.UpdateBookingRequest) (*proto.UpdateBookingResponse, error) {
|
||||
func (s *CarpoolServiceServerImpl) GetCarpoolBookings(ctx context.Context, req *proto.GetCarpoolBookingsRequest) (*proto.GetCarpoolBookingsResponse, error) {
|
||||
log.Debug().
|
||||
Time("mindate", req.MinDate.AsTime()).
|
||||
Time("maxdate", req.MaxDate.AsTime()).
|
||||
Msg("grpc server - GetUserBookings")
|
||||
|
||||
var mindate *time.Time
|
||||
if req.MinDate != nil {
|
||||
d := req.MinDate.AsTime()
|
||||
mindate = &d
|
||||
}
|
||||
var maxdate *time.Time
|
||||
if req.MaxDate != nil {
|
||||
d := req.MaxDate.AsTime()
|
||||
maxdate = &d
|
||||
}
|
||||
|
||||
bookings, err := s.Handler.GetBookings(mindate, maxdate)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "error retrieving user bookings - %s", err.Error())
|
||||
}
|
||||
|
||||
results := []*proto.CarpoolServiceBooking{}
|
||||
|
||||
for _, b := range bookings {
|
||||
nb := proto.BookingFromInternal(b)
|
||||
results = append(results, nb)
|
||||
}
|
||||
return &proto.GetCarpoolBookingsResponse{
|
||||
Bookings: results,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) UpdateBooking(ctx context.Context, req *proto.UpdateCarpoolBookingRequest) (*proto.UpdateCarpoolBookingResponse, error) {
|
||||
err := s.Handler.UpdateBookingStatus(req.BookingId, req.Status.ToOCSS())
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "could not update booking status")
|
||||
}
|
||||
return &proto.UpdateBookingResponse{}, nil
|
||||
return &proto.UpdateCarpoolBookingResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) GetBooking(ctx context.Context, req *proto.GetBookingRequest) (*proto.GetBookingResponse, error) {
|
||||
func (s *CarpoolServiceServerImpl) GetBooking(ctx context.Context, req *proto.GetCarpoolBookingRequest) (*proto.GetCarpoolBookingResponse, error) {
|
||||
result, err := s.Handler.GetBooking(req.BookingId)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("issue retrieving booking in handler")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &proto.GetBookingResponse{
|
||||
return &proto.GetCarpoolBookingResponse{
|
||||
Booking: proto.BookingFromInternal(*result),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -32,14 +32,44 @@ func (s *CarpoolServiceServerImpl) CreateRegularRoutes(ctx context.Context, req
|
||||
return &proto.CreateRegularRoutesResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) DeleteRegularRoutes(context.Context, *proto.DeleteRegularRoutesRequest) (*proto.DeleteRegularRoutesResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteTrips not implemented")
|
||||
func (s *CarpoolServiceServerImpl) DeleteRegularRoutes(ctx context.Context, req *proto.DeleteRegularRoutesRequest) (*proto.DeleteRegularRoutesResponse, error) {
|
||||
err := s.Handler.DeleteRegularRoutes(req.Ids)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return &proto.DeleteRegularRoutesResponse{}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) GetRegularRoutes(ctx context.Context, req *proto.GetRegularRoutesRequest) (*proto.GetRegularRoutesResponse, error) {
|
||||
log.Debug().Msg("grpc CarpoolService - GetRegularRoutes")
|
||||
|
||||
routes, err := s.Handler.GetUserRegularRoutes(req.UserId)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "could not retrieve user routes : %s", err.Error())
|
||||
}
|
||||
|
||||
results := []*proto.CarpoolFeatureCollection{}
|
||||
|
||||
for _, r := range routes {
|
||||
serialized, err := r.MarshalJSON()
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error marshaling route")
|
||||
continue
|
||||
}
|
||||
results = append(results, &proto.CarpoolFeatureCollection{
|
||||
Serialized: string(serialized),
|
||||
})
|
||||
}
|
||||
|
||||
return &proto.GetRegularRoutesResponse{
|
||||
Routes: results,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) GetUserPlanning(ctx context.Context, req *proto.GetUserPlanningRequest) (*proto.GetUserPlanningResponse, error) {
|
||||
log.Debug().Msg("grpc CarpoolService - GetRegularUserRoutes")
|
||||
log.Debug().Msg("grpc CarpoolService - GetUserPlanning")
|
||||
|
||||
planned_schedules, err := s.Handler.GetUserPlanning(req.UserId, req.MinDepartureDate.AsTime(), req.MaxDepartureDate.AsTime())
|
||||
planned_schedules, missing_planning, err := s.Handler.GetUserPlanning(req.UserId, req.MinDepartureDate.AsTime(), req.MaxDepartureDate.AsTime())
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "could not get user planning : %s", err.Error())
|
||||
}
|
||||
@@ -52,10 +82,11 @@ func (s *CarpoolServiceServerImpl) GetUserPlanning(ctx context.Context, req *pro
|
||||
Collection: []*proto.CarpoolFeatureCollection{},
|
||||
}
|
||||
|
||||
for _, s := range scheds {
|
||||
s.Route.ExtraMembers["departure_date"] = s.DepartureDate
|
||||
s.Route.ExtraMembers["id"] = s.ID
|
||||
fcraw, _ := s.Route.MarshalJSON()
|
||||
for _, sched := range scheds {
|
||||
sched.Route.ExtraMembers["departure_date"] = sched.DepartureDate
|
||||
sched.Route.ExtraMembers["id"] = sched.ID
|
||||
sched.Route.ExtraMembers["operator"] = s.Handler.InternalOperatorID
|
||||
fcraw, _ := sched.Route.MarshalJSON()
|
||||
results[k].Collection = append(results[k].Collection, &proto.CarpoolFeatureCollection{
|
||||
Serialized: string(fcraw),
|
||||
})
|
||||
@@ -64,6 +95,7 @@ func (s *CarpoolServiceServerImpl) GetUserPlanning(ctx context.Context, req *pro
|
||||
|
||||
return &proto.GetUserPlanningResponse{
|
||||
RoutesByDates: results,
|
||||
MissingPlanning: missing_planning,
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -75,6 +107,19 @@ func (s *CarpoolServiceServerImpl) GetPlannedTrip(ctx context.Context, req *prot
|
||||
|
||||
planned_trip.Route.ExtraMembers["id"] = planned_trip.ID
|
||||
planned_trip.Route.ExtraMembers["departure_date"] = planned_trip.DepartureDate
|
||||
planned_trip.Route.ExtraMembers["operator"] = s.Handler.InternalOperatorID
|
||||
planned_trip.Route.ExtraMembers["driver_distance"] = planned_trip.Itinerary.Distance
|
||||
if planned_trip.Itinerary.Legs != nil && len(planned_trip.Itinerary.Legs) > 1 {
|
||||
planned_trip.Route.ExtraMembers["passenger_distance"] = planned_trip.Itinerary.Legs[1].Distance
|
||||
}
|
||||
|
||||
// Add passenger pickup and drop information to extra members for frontend access
|
||||
if planned_trip.PassengerPickup != nil {
|
||||
planned_trip.Route.ExtraMembers["passenger_pickup"] = planned_trip.PassengerPickup
|
||||
}
|
||||
if planned_trip.PassengerDrop != nil {
|
||||
planned_trip.Route.ExtraMembers["passenger_drop"] = planned_trip.PassengerDrop
|
||||
}
|
||||
|
||||
serialized, err := planned_trip.Route.MarshalJSON()
|
||||
if err != nil {
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"git.coopgo.io/coopgo-platform/carpool-service/servers/grpc/proto"
|
||||
"github.com/paulmach/orb"
|
||||
"github.com/paulmach/orb/geojson"
|
||||
"github.com/rs/zerolog/log"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
@@ -13,10 +14,27 @@ import (
|
||||
)
|
||||
|
||||
func (s *CarpoolServiceServerImpl) DriverJourneys(ctx context.Context, req *proto.DriverJourneysRequest) (*proto.DriverJourneysResponse, error) {
|
||||
|
||||
departure := orb.Point{req.DepartureLng, req.DepartureLat}
|
||||
arrival := orb.Point{req.ArrivalLng, req.ArrivalLat}
|
||||
|
||||
// Create features with addresses
|
||||
departureFeature := geojson.NewFeature(departure)
|
||||
arrivalFeature := geojson.NewFeature(arrival)
|
||||
|
||||
if req.DepartureAddress != nil && *req.DepartureAddress != "" {
|
||||
if departureFeature.Properties == nil {
|
||||
departureFeature.Properties = make(map[string]interface{})
|
||||
}
|
||||
departureFeature.Properties["label"] = *req.DepartureAddress
|
||||
}
|
||||
|
||||
if req.ArrivalAddress != nil && *req.ArrivalAddress != "" {
|
||||
if arrivalFeature.Properties == nil {
|
||||
arrivalFeature.Properties = make(map[string]interface{})
|
||||
}
|
||||
arrivalFeature.Properties["label"] = *req.ArrivalAddress
|
||||
}
|
||||
|
||||
log.Debug().
|
||||
Str("departure date", req.DepartureDate.String()).
|
||||
Any("departure", departure).
|
||||
@@ -40,7 +58,7 @@ func (s *CarpoolServiceServerImpl) DriverJourneys(ctx context.Context, req *prot
|
||||
Int64("td", int64(td)).
|
||||
Msg("DriverJourneys show dates")
|
||||
|
||||
journeys, err := s.Handler.GetDriverJourneys(departure, arrival, req.DepartureRadius, req.ArrivalRadius, minDate, maxDate, req.Count)
|
||||
journeys, err := s.Handler.GetDriverJourneys(departureFeature, arrivalFeature, req.DepartureRadius, req.ArrivalRadius, minDate, maxDate, req.Count)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error finding driver journeys")
|
||||
return nil, err
|
||||
@@ -68,16 +86,26 @@ func (s *CarpoolServiceServerImpl) DriverJourneys(ctx context.Context, req *prot
|
||||
var distance *int64
|
||||
if len(j.Itinerary.Legs) > 2 {
|
||||
duration = j.Itinerary.Legs[1].Duration
|
||||
dist := j.Itinerary.Legs[1].Distance
|
||||
dist := int64(j.Itinerary.Legs[1].Distance)
|
||||
distance = &dist
|
||||
}
|
||||
|
||||
operator := "internal"
|
||||
if usermap["operator"] != nil {
|
||||
operator = usermap["operator"].(string)
|
||||
}
|
||||
|
||||
alias := ""
|
||||
if usermap["alias"] != nil {
|
||||
alias = usermap["alias"].(string)
|
||||
}
|
||||
|
||||
results = append(results, &proto.CarpoolServiceDriverJourney{
|
||||
Id: journeyId,
|
||||
Driver: &proto.CarpoolServiceUser{
|
||||
Id: usermap["id"].(string),
|
||||
Operator: usermap["operator"].(string),
|
||||
Alias: usermap["alias"].(string),
|
||||
Operator: operator,
|
||||
Alias: alias,
|
||||
},
|
||||
Operator: s.Handler.InternalOperatorID,
|
||||
PassengerPickupLat: req.DepartureLat,
|
||||
@@ -103,6 +131,7 @@ func (s *CarpoolServiceServerImpl) DriverJourneys(ctx context.Context, req *prot
|
||||
DriverJourneys: results,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) PassengerJourneys(ctx context.Context, req *proto.PassengerJourneysRequest) (*proto.PassengerJourneysResponse, error) {
|
||||
log.Debug().
|
||||
Str("departure date", req.DepartureDate.String()).
|
||||
@@ -148,7 +177,7 @@ func (s *CarpoolServiceServerImpl) PassengerJourneys(ctx context.Context, req *p
|
||||
var distance *int64
|
||||
if len(j.Itinerary.Legs) > 2 {
|
||||
duration = j.Itinerary.Legs[1].Duration
|
||||
dist := j.Itinerary.Legs[1].Distance
|
||||
dist := int64(j.Itinerary.Legs[1].Distance)
|
||||
distance = &dist
|
||||
}
|
||||
|
||||
@@ -183,9 +212,11 @@ func (s *CarpoolServiceServerImpl) PassengerJourneys(ctx context.Context, req *p
|
||||
PassengerJourneys: results,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) DriverRegularTrips(context.Context, *proto.DriverRegularTripsRequest) (*proto.DriverRegularTripsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DriverRegularTrips not implemented")
|
||||
}
|
||||
|
||||
func (s *CarpoolServiceServerImpl) PassengerRegularTrips(context.Context, *proto.PassengerRegularTripsRequest) (*proto.PassengerRegularTripsResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method PassengerRegularTrips not implemented")
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
)
|
||||
|
||||
func (s *OCSSApiService) PostBookings(ctx context.Context, booking ocss.Booking) (*ocss.Booking, error) {
|
||||
result, err := s.Handler.Book(booking)
|
||||
result, err := s.Handler.Book(booking, nil)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("issue in booking")
|
||||
return nil, err
|
||||
|
||||
@@ -6,6 +6,7 @@ import (
|
||||
|
||||
"git.coopgo.io/coopgo-platform/carpool-service/interoperability/ocss"
|
||||
"github.com/paulmach/orb"
|
||||
"github.com/paulmach/orb/geojson"
|
||||
"github.com/rs/zerolog/log"
|
||||
)
|
||||
|
||||
@@ -13,6 +14,10 @@ func (s *OCSSApiService) GetDriverJourneys(ctx context.Context, departureLat flo
|
||||
departure := orb.Point{departureLng, departureLat}
|
||||
arrival := orb.Point{arrivalLng, arrivalLat}
|
||||
|
||||
// Create features for the handler (OCSS doesn't provide addresses, so they'll be empty)
|
||||
departureFeature := geojson.NewFeature(departure)
|
||||
arrivalFeature := geojson.NewFeature(arrival)
|
||||
|
||||
td := 900 * time.Second
|
||||
if timeDelta != nil {
|
||||
td = *timeDelta
|
||||
@@ -21,7 +26,7 @@ func (s *OCSSApiService) GetDriverJourneys(ctx context.Context, departureLat flo
|
||||
minDate := departureDate.Add(-td * time.Second)
|
||||
maxDate := departureDate.Add(td * time.Second)
|
||||
|
||||
journeys, err := s.Handler.GetDriverJourneys(departure, arrival, departureRadius, arrivalRadius, minDate, maxDate, count)
|
||||
journeys, err := s.Handler.GetDriverJourneys(departureFeature, arrivalFeature, departureRadius, arrivalRadius, minDate, maxDate, count)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
@@ -46,7 +46,6 @@ func NewMongoDBStorage(cfg *viper.Viper) (MongoDBStorage, error) {
|
||||
}
|
||||
|
||||
err = client.Connect(context.TODO())
|
||||
|
||||
if err != nil {
|
||||
return MongoDBStorage{}, err
|
||||
}
|
||||
@@ -68,7 +67,6 @@ func NewMongoDBStorage(cfg *viper.Viper) (MongoDBStorage, error) {
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) CreateRegularRoutes(routes []*geojson.FeatureCollection) error {
|
||||
|
||||
log.Debug().Msg("Storage - CreateRegularRoutes")
|
||||
|
||||
documents := []any{}
|
||||
@@ -180,6 +178,15 @@ func (s MongoDBStorage) GetDriverRegularRoutesForTile(day string, gridId int64)
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) DeleteRegularRoutes(ids []string) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["regular_routes"])
|
||||
_, err := collection.DeleteMany(context.Background(), bson.M{"_id": bson.M{"$in": ids}})
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error deleteing regular routes")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) GetPassengerRegularRoutesForTile(day string, gridId int64) ([]*geojson.FeatureCollection, error) {
|
||||
findOptions := options.Find()
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["regular_routes"])
|
||||
@@ -224,7 +231,6 @@ func (s MongoDBStorage) GetPassengerRegularRoutesForTile(day string, gridId int6
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) CreateBooking(booking internal.Booking) error {
|
||||
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["bookings"])
|
||||
_, err := collection.InsertOne(context.TODO(), booking)
|
||||
if err != nil {
|
||||
@@ -232,6 +238,7 @@ func (s MongoDBStorage) CreateBooking(booking internal.Booking) error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) GetBooking(id string) (booking *internal.Booking, err error) {
|
||||
var b internal.Booking
|
||||
log.Debug().Str("booking id", id).Msg("get booking in DB")
|
||||
@@ -273,9 +280,48 @@ func (s MongoDBStorage) GetUserBookings(userid string) ([]internal.Booking, erro
|
||||
return bookings, nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) GetAllBookings() ([]internal.Booking, error) {
|
||||
findOptions := options.Find()
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["bookings"])
|
||||
cur, err := collection.Find(context.TODO(), bson.M{}, findOptions)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
var bookings []internal.Booking
|
||||
for cur.Next(context.TODO()) {
|
||||
var elem internal.Booking
|
||||
|
||||
if err := cur.Decode(&elem); err != nil {
|
||||
log.Error().Err(err).Msg("error reading bookings response")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
bookings = append(bookings, elem)
|
||||
}
|
||||
|
||||
return bookings, nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) UpdateBookingStatus(bookingid string, status string) error {
|
||||
//TODO implement UpdateBookingStatus
|
||||
return errors.New("MongoDB Storage - UpdateBookingStatus not implemented")
|
||||
log.Debug().Str("booking id", bookingid).Str("status", status).Msg("update booking status in DB")
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["bookings"])
|
||||
|
||||
filter := bson.M{"_id": bookingid}
|
||||
update := bson.M{"$set": bson.M{"status": status}}
|
||||
|
||||
result, err := collection.UpdateOne(context.TODO(), filter, update)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error updating booking status")
|
||||
return err
|
||||
}
|
||||
|
||||
if result.MatchedCount == 0 {
|
||||
return errors.New("booking not found")
|
||||
}
|
||||
|
||||
log.Debug().Int64("modified count", result.ModifiedCount).Msg("booking status updated")
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) PersistedKVPut(documents []any) error {
|
||||
@@ -286,6 +332,7 @@ func (s MongoDBStorage) PersistedKVPut(documents []any) error {
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) PersistedKVGet(id string, document any) error {
|
||||
collection := s.Client.Database(s.DbName).Collection(s.Collections["persisted_kv"])
|
||||
err := collection.FindOne(context.TODO(), bson.M{"_id": id}).Decode(document)
|
||||
@@ -296,7 +343,6 @@ func (s MongoDBStorage) PersistedKVGet(id string, document any) error {
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) StoreRouteSchedules(js []internal.PlannedRouteSchedule) error {
|
||||
|
||||
log.Debug().Msg("Storage - StoreRouteSchedules")
|
||||
|
||||
documents := []any{}
|
||||
@@ -308,7 +354,6 @@ func (s MongoDBStorage) StoreRouteSchedules(js []internal.PlannedRouteSchedule)
|
||||
}
|
||||
|
||||
func (s MongoDBStorage) GetRouteSchedule(id string) (*internal.PlannedRouteSchedule, error) {
|
||||
|
||||
var result internal.PlannedRouteSchedule
|
||||
err := s.PersistedKVGet(id, &result)
|
||||
if err != nil {
|
||||
|
||||
@@ -68,7 +68,6 @@ func NewPostgresqlStorage(cfg *viper.Viper) (PostgresqlStorage, error) {
|
||||
}
|
||||
|
||||
func (s PostgresqlStorage) CreateRegularRoutes(routes []*geojson.FeatureCollection) error {
|
||||
|
||||
log.Debug().Msg("Postgresql Storage - CreateRegularRoutes")
|
||||
|
||||
tx, err := s.DbConnection.Begin()
|
||||
@@ -175,6 +174,15 @@ func (s PostgresqlStorage) GetUserRegularRoutes(userid string) ([]*geojson.Featu
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func (s PostgresqlStorage) DeleteRegularRoutes(ids []string) error {
|
||||
req := fmt.Sprintf(`delete from %s where id in $1`, s.Tables["regular_routes"])
|
||||
_, err := s.DbConnection.Exec(req, ids)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("error in postgresql request - delete regular routes")
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
func (s PostgresqlStorage) GetDriverRegularRoutesForTile(day string, gridId int64) (regular_routes []*geojson.FeatureCollection, err error) {
|
||||
req := fmt.Sprintf(`select id, route
|
||||
from %s inner join %s on id = route_id
|
||||
@@ -404,6 +412,66 @@ func (s PostgresqlStorage) GetUserBookings(userid string) ([]internal.Booking, e
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func (s PostgresqlStorage) GetAllBookings() ([]internal.Booking, error) {
|
||||
req := fmt.Sprintf(`select booking, status, driver_route, passenger_route from %s
|
||||
where 1=1`, s.Tables["bookings"])
|
||||
rows, err := s.DbConnection.Query(req)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("GetUserBookings query issue")
|
||||
}
|
||||
|
||||
results := []internal.Booking{}
|
||||
for rows.Next() {
|
||||
var booking ocss.Booking
|
||||
var status string
|
||||
var bookingbytes, driverroute, passengerroute []byte
|
||||
err := rows.Scan(
|
||||
&bookingbytes,
|
||||
&status,
|
||||
&driverroute,
|
||||
&passengerroute,
|
||||
)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("not able to get and scan booking in GetUsersBooking")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
err = json.Unmarshal(bookingbytes, &booking)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("issue unmarshalling booking in GetUsersBooking")
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// Override booking status
|
||||
booking.Status = ocss.BookingStatusFromString(status)
|
||||
|
||||
var dr, pr *geojson.FeatureCollection
|
||||
if driverroute != nil {
|
||||
dr, err = geojson.UnmarshalFeatureCollection(driverroute)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("could not unmarshal driver route feature collection")
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
if passengerroute != nil {
|
||||
pr, err = geojson.UnmarshalFeatureCollection(passengerroute)
|
||||
if err != nil {
|
||||
log.Error().Err(err).Msg("could not unmarshal passenger route feature collection")
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
results = append(results, internal.Booking{
|
||||
Booking: booking,
|
||||
DriverRoute: dr,
|
||||
PassengerRoute: pr,
|
||||
})
|
||||
|
||||
}
|
||||
return results, nil
|
||||
}
|
||||
|
||||
func (s PostgresqlStorage) StoreRouteSchedules(journeys []internal.PlannedRouteSchedule) error {
|
||||
tx, err := s.DbConnection.Begin()
|
||||
if err != nil {
|
||||
@@ -434,8 +502,8 @@ func (s PostgresqlStorage) StoreRouteSchedules(journeys []internal.PlannedRouteS
|
||||
}
|
||||
|
||||
return nil
|
||||
|
||||
}
|
||||
|
||||
func (s PostgresqlStorage) GetRouteSchedule(id string) (*internal.PlannedRouteSchedule, error) {
|
||||
req := fmt.Sprintf("select data from %s where id = $1", s.Tables["journeys_cache"])
|
||||
var jsonjourney []byte
|
||||
|
||||
@@ -11,12 +11,14 @@ import (
|
||||
type Storage interface {
|
||||
CreateRegularRoutes([]*geojson.FeatureCollection) error
|
||||
GetUserRegularRoutes(userid string) ([]*geojson.FeatureCollection, error)
|
||||
DeleteRegularRoutes(ids []string) error
|
||||
GetDriverRegularRoutesForTile(day string, gridId int64) ([]*geojson.FeatureCollection, error)
|
||||
GetPassengerRegularRoutesForTile(day string, gridId int64) ([]*geojson.FeatureCollection, error)
|
||||
|
||||
CreateBooking(internal.Booking) error
|
||||
GetBooking(id string) (*internal.Booking, error)
|
||||
GetUserBookings(userid string) ([]internal.Booking, error)
|
||||
GetAllBookings() ([]internal.Booking, error)
|
||||
UpdateBookingStatus(bookingid string, status string) error
|
||||
|
||||
// Caching temporary results
|
||||
@@ -29,9 +31,7 @@ type Storage interface {
|
||||
}
|
||||
|
||||
func NewStorage(cfg *viper.Viper) (Storage, error) {
|
||||
var (
|
||||
storage_type = cfg.GetString("storage.db.type")
|
||||
)
|
||||
storage_type := cfg.GetString("storage.db.type")
|
||||
|
||||
switch storage_type {
|
||||
case "mongodb":
|
||||
|
||||
Reference in New Issue
Block a user