open5gs/lib/dbi/ogs-mongoc.h

58 lines
1.4 KiB
C
Raw Normal View History

/*
2020-06-04 18:12:05 +00:00
* Copyright (C) 2019,2020 by Sukchan Lee <acetcom@gmail.com>
*
* This file is part of Open5GS.
*
* 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 General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
2019-09-13 12:07:47 +00:00
#if !defined(OGS_DBI_INSIDE) && !defined(OGS_DBI_COMPILATION)
#error "This header cannot be included directly."
#endif
#ifndef OGS_MONGOC_H
#define OGS_MONGOC_H
2019-04-27 14:54:30 +00:00
#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */
2022-06-14 21:20:50 +00:00
2019-09-13 12:07:47 +00:00
typedef struct ogs_mongoc_s {
bool initialized;
const char *name;
void *uri;
void *client;
void *database;
2020-06-04 18:12:05 +00:00
char *masked_db_uri;
2020-06-04 18:12:05 +00:00
struct {
void *subscriber;
} collection;
2019-09-13 12:07:47 +00:00
} ogs_mongoc_t;
2019-04-27 14:54:30 +00:00
2019-09-13 12:07:47 +00:00
int ogs_mongoc_init(const char *db_uri);
void ogs_mongoc_final(void);
ogs_mongoc_t *ogs_mongoc(void);
2019-04-27 14:54:30 +00:00
2020-06-04 18:12:05 +00:00
int ogs_dbi_init(const char *db_uri);
void ogs_dbi_final(void);
2019-04-27 14:54:30 +00:00
#ifdef __cplusplus
}
#endif
2019-04-27 14:54:30 +00:00
2019-09-13 12:07:47 +00:00
#endif /* OGS_MONGOC_H */