GCC Code Coverage Report


Directory: src/
File: src/msg-service.h
Date: 2024-05-18 00:53:33
Exec Total Coverage
Lines: 1 1 100.0%
Functions: 4 4 100.0%
Branches: 4 7 57.1%

Line Branch Exec Source
1 /* Copyright 2022-2023 Jan-Michael Brummer <jan-michael.brummer1@volkswagen.de>
2 *
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU Lesser General Public License as published by
5 * the Free Software Foundation, either version 3 of the License, or
6 * (at your option) any later version.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17 #pragma once
18
19 #include <glib-object.h>
20 #include <libsoup/soup.h>
21 #include <json-glib/json-glib.h>
22
23 #include "msg-authorizer.h"
24
25 G_BEGIN_DECLS
26
27 #define MSG_TYPE_SERVICE (msg_service_get_type ())
28
29 struct _MsgServiceClass {
30 GObjectClass parent;
31 };
32
33
4/7
✓ Branch 0 taken 1 times.
✗ Branch 1 not taken.
✓ Branch 2 taken 5 times.
✓ Branch 3 taken 5 times.
✗ Branch 4 not taken.
✗ Branch 5 not taken.
✓ Branch 6 taken 5 times.
282 G_DECLARE_DERIVABLE_TYPE (MsgService, msg_service, MSG, SERVICE, GObject);
34
35 gboolean
36 msg_service_refresh_authorization(MsgService *self,
37 GCancellable *cancellable,
38 GError **error);
39
40 GInputStream *
41 msg_service_send (MsgService *self,
42 SoupMessage *message,
43 GCancellable *cancellable,
44 GError **error);
45
46 GBytes *
47 msg_service_send_and_read (MsgService *self,
48 SoupMessage *message,
49 GCancellable *cancellable,
50 GError **error);
51
52 JsonParser *
53 msg_service_parse_response (GBytes *bytes,
54 JsonObject **object,
55 GError **error);
56
57 SoupMessage *
58 msg_service_build_message (MsgService *self,
59 const char *method,
60 const char *uri,
61 const char *etag,
62 gboolean etag_if_match);
63
64 gboolean
65 msg_service_accept_certificate_cb (SoupMessage *msg,
66 GTlsCertificate *tls_cert,
67 GTlsCertificateFlags tls_errors,
68 gpointer session);
69
70 guint
71 msg_service_get_https_port (void);
72
73 SoupSession *
74 msg_service_get_session (MsgService *self);
75
76 MsgAuthorizer *
77 msg_service_get_authorizer (MsgService *self);
78
79 JsonParser *
80 msg_service_send_and_parse_response (MsgService *self,
81 SoupMessage *message,
82 JsonObject **object,
83 GCancellable *cancellable,
84 GError **error);
85
86 char *
87 msg_service_get_next_link (JsonObject *object);
88
89 G_END_DECLS
90