64 lines
1.9 KiB
C
64 lines
1.9 KiB
C
#ifndef AMDUAT_FED_TRANSPORT_UNIX_H
|
|
#define AMDUAT_FED_TRANSPORT_UNIX_H
|
|
|
|
#include "federation/coord.h"
|
|
#include "amduat/asl/asl_pointer_fs.h"
|
|
#include "amduat/fed/replay.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
enum { AMDUAT_FED_TRANSPORT_UNIX_PATH_MAX = 1024 };
|
|
|
|
typedef struct {
|
|
char socket_path[AMDUAT_FED_TRANSPORT_UNIX_PATH_MAX];
|
|
char space_id[AMDUAT_ASL_POINTER_NAME_MAX + 1u];
|
|
bool has_space;
|
|
} amduat_fed_transport_unix_t;
|
|
|
|
bool amduat_fed_transport_unix_init(amduat_fed_transport_unix_t *transport,
|
|
const char *socket_path);
|
|
|
|
bool amduat_fed_transport_unix_set_space(amduat_fed_transport_unix_t *transport,
|
|
const char *space_id);
|
|
|
|
amduat_fed_transport_t amduat_fed_transport_unix_ops(
|
|
amduat_fed_transport_unix_t *transport);
|
|
|
|
/* Returns true on successful HTTP exchange. Caller frees records via
|
|
* amduat_fed_transport_unix_ops(...).free_records and frees out_body with free.
|
|
*/
|
|
bool amduat_fed_transport_unix_get_records_with_limit(
|
|
amduat_fed_transport_unix_t *transport,
|
|
uint32_t domain_id,
|
|
uint64_t from_logseq,
|
|
uint64_t limit,
|
|
int *out_status,
|
|
amduat_fed_record_t **out_records,
|
|
size_t *out_len,
|
|
char **out_body);
|
|
|
|
/* Returns true on successful HTTP exchange. Caller frees out_body with free. */
|
|
bool amduat_fed_transport_unix_get_artifact_with_status(
|
|
amduat_fed_transport_unix_t *transport,
|
|
amduat_reference_t ref,
|
|
int *out_status,
|
|
amduat_octets_t *out_bytes,
|
|
char **out_body);
|
|
|
|
/* Returns true on successful HTTP exchange. Caller frees out_body with free. */
|
|
bool amduat_fed_transport_unix_post_ingest(
|
|
amduat_fed_transport_unix_t *transport,
|
|
amduat_fed_record_type_t record_type,
|
|
amduat_reference_t ref,
|
|
amduat_octets_t bytes,
|
|
int *out_status,
|
|
char **out_body);
|
|
|
|
#ifdef __cplusplus
|
|
} /* extern "C" */
|
|
#endif
|
|
|
|
#endif /* AMDUAT_FED_TRANSPORT_UNIX_H */
|