|
Pharos 0.7.23
Modern Web Framework & Web App Hosting Service.
|
Implements native backup and restore reporting for app state and sqlite snapshots. More...
#include "native_backup_restore.h"#include "native_artifact_emit.h"#include "native_fs.h"#include "native_json_config.h"#include "native_support.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <time.h>Go to the source code of this file.
Macros | |
| #define | native_backup_restore_strdup strdup |
Functions | |
| static char * | native_default_backend_local (const AppRuntime *app) |
| static char * | native_default_sqlite_path_local (const AppRuntime *app) |
| static char * | native_app_conf_path (const char *app_root) |
| static char * | native_app_conf_value_path (const char *app_root, const char *key) |
| static char * | native_backup_base_dir (const AppRuntime *app) |
| static char * | native_backup_timestamp_utc (void) |
| static long | native_json_top_level_long (const char *text, const char *key, long fallback_value) |
| static char * | native_migration_fixture_path (const AppRuntime *app) |
| static long | native_migration_schema_version (const char *migration_fixture_path) |
| static int | native_write_backup_state_snapshot (const AppRuntime *app, const char *output_path) |
| static char * | native_metadata_artifact_value (const char *metadata_path, const char *key) |
| char * | build_native_backup_report_local_json (const ServeConfig *config, const AppRuntime *app, const char *backend_override, const char *output_dir_override, char **error_out) |
| Builds a JSON report describing a native app backup operation. | |
| char * | build_native_restore_report_local_json (const ServeConfig *config, const AppRuntime *app, const char *backend_override, const char *input_dir, char **error_out) |
| Builds a JSON report describing a native app restore operation. | |
Implements native backup and restore reporting for app state and sqlite snapshots.
Definition in file native_backup_restore.c.
| #define native_backup_restore_strdup strdup |
Definition at line 21 of file native_backup_restore.c.
Referenced by build_native_backup_report_local_json(), build_native_restore_report_local_json(), native_backup_timestamp_utc(), native_default_backend_local(), and native_default_sqlite_path_local().
| char * build_native_backup_report_local_json | ( | const ServeConfig * | config, |
| const AppRuntime * | app, | ||
| const char * | backend_override, | ||
| const char * | output_dir_override, | ||
| char ** | error_out ) |
Builds a JSON report describing a native app backup operation.
| config | Active serve configuration. |
| app | Finalized app runtime to back up. |
| backend_override | Optional backend override. |
| output_dir_override | Optional output directory override. |
| error_out | Optional destination for an allocated error message. |
Definition at line 217 of file native_backup_restore.c.
References copy_file_binary(), ensure_directory(), json_string_dup_native(), native_backup_base_dir(), native_backup_restore_strdup, native_backup_timestamp_utc(), native_default_backend_local(), native_default_sqlite_path_local(), native_migration_fixture_path(), native_migration_schema_version(), native_write_backup_state_snapshot(), path_exists(), path_join(), streq(), ServeConfig::target_id, and write_text_file().
Referenced by handle_native_backup_restore_ops_command().
| char * build_native_restore_report_local_json | ( | const ServeConfig * | config, |
| const AppRuntime * | app, | ||
| const char * | backend_override, | ||
| const char * | input_dir, | ||
| char ** | error_out ) |
Builds a JSON report describing a native app restore operation.
| config | Active serve configuration. |
| app | Finalized app runtime to restore into. |
| backend_override | Optional backend override. |
| input_dir | Directory containing restore input artifacts. |
| error_out | Optional destination for an allocated error message. |
Definition at line 366 of file native_backup_restore.c.
References copy_file_binary(), ensure_directory(), json_string_dup_native(), native_backup_restore_strdup, native_default_backend_local(), native_default_sqlite_path_local(), native_metadata_artifact_value(), path_dirname(), path_exists(), path_join(), AppRuntime::state_path, streq(), and ServeConfig::target_id.
Referenced by handle_native_backup_restore_ops_command().
|
static |
Definition at line 44 of file native_backup_restore.c.
References path_exists(), and path_join().
Referenced by native_app_conf_value_path().
|
static |
Definition at line 63 of file native_backup_restore.c.
References conf_lookup_value(), native_app_conf_path(), path_dirname(), and resolve_relative_to().
Referenced by native_backup_base_dir().
|
static |
Definition at line 88 of file native_backup_restore.c.
References AppRuntime::app_root, conf_lookup_value(), native_app_conf_value_path(), path_join(), and AppRuntime::runtime_conf_path.
Referenced by build_native_backup_report_local_json().
|
static |
Definition at line 108 of file native_backup_restore.c.
References native_backup_restore_strdup.
Referenced by build_native_backup_report_local_json().
|
static |
Definition at line 24 of file native_backup_restore.c.
References conf_lookup_value(), native_backup_restore_strdup, and AppRuntime::runtime_conf_path.
Referenced by build_native_backup_report_local_json(), and build_native_restore_report_local_json().
|
static |
Definition at line 33 of file native_backup_restore.c.
References AppRuntime::app_id, conf_lookup_value(), native_backup_restore_strdup, and AppRuntime::runtime_conf_path.
Referenced by build_native_backup_report_local_json(), and build_native_restore_report_local_json().
|
static |
Definition at line 123 of file native_backup_restore.c.
Referenced by native_migration_schema_version().
|
static |
Definition at line 202 of file native_backup_restore.c.
References json_find_string_in_section(), path_exists(), and read_file_text().
Referenced by build_native_restore_report_local_json().
|
static |
Definition at line 152 of file native_backup_restore.c.
References AppRuntime::app_root, json_find_string_in_section(), path_exists(), path_join(), read_file_text(), and resolve_relative_to().
Referenced by build_native_backup_report_local_json().
|
static |
Definition at line 180 of file native_backup_restore.c.
References native_json_top_level_long(), path_exists(), and read_file_text().
Referenced by build_native_backup_report_local_json().
|
static |
Definition at line 195 of file native_backup_restore.c.
References copy_file_binary(), path_exists(), AppRuntime::state_path, and write_text_file().
Referenced by build_native_backup_report_local_json().