mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Make storage events take a tag for the backend instead of a string
This commit is contained in:
parent
989e4adf90
commit
32ae8f4eaa
15 changed files with 39 additions and 38 deletions
|
@ -11,7 +11,7 @@ using namespace zeek::storage;
|
|||
|
||||
namespace btest::storage::backend {
|
||||
|
||||
BackendPtr StorageDummy::Instantiate(std::string_view tag) { return make_intrusive<StorageDummy>(tag); }
|
||||
BackendPtr StorageDummy::Instantiate() { return make_intrusive<StorageDummy>(); }
|
||||
|
||||
/**
|
||||
* Called by the manager system to open the backend.
|
||||
|
|
|
@ -13,10 +13,10 @@ namespace btest::storage::backend {
|
|||
*/
|
||||
class StorageDummy : public zeek::storage::Backend {
|
||||
public:
|
||||
StorageDummy(std::string_view tag) : Backend(zeek::storage::SupportedModes::SYNC, tag) {}
|
||||
StorageDummy() : Backend(zeek::storage::SupportedModes::SYNC, "StorageDummy") {}
|
||||
~StorageDummy() override = default;
|
||||
|
||||
static zeek::storage::BackendPtr Instantiate(std::string_view tag);
|
||||
static zeek::storage::BackendPtr Instantiate();
|
||||
|
||||
/**
|
||||
* Called by the manager system to open the backend.
|
||||
|
|
|
@ -14,11 +14,11 @@
|
|||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
event Storage::backend_opened(tag: string, config: any) {
|
||||
event Storage::backend_opened(tag: Storage::Backend, config: any) {
|
||||
print "Storage::backend_opened", tag, config;
|
||||
}
|
||||
|
||||
event Storage::backend_lost(tag: string, config: any, reason: string) {
|
||||
event Storage::backend_lost(tag: Storage::Backend, config: any, reason: string) {
|
||||
print "Storage::backend_lost", tag, config, reason;
|
||||
terminate();
|
||||
}
|
||||
|
|
|
@ -12,11 +12,11 @@
|
|||
@load base/frameworks/storage/sync
|
||||
@load policy/frameworks/storage/backend/redis
|
||||
|
||||
event Storage::backend_opened(tag: string, config: any) {
|
||||
event Storage::backend_opened(tag: Storage::Backend, config: any) {
|
||||
print "Storage::backend_opened", tag, config;
|
||||
}
|
||||
|
||||
event Storage::backend_lost(tag: string, config: any, reason: string) {
|
||||
event Storage::backend_lost(tag: Storage::Backend, config: any, reason: string) {
|
||||
print "Storage::backend_lost", tag, config, reason;
|
||||
terminate();
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
event Storage::backend_opened(tag: string, config: any) {
|
||||
event Storage::backend_opened(tag: Storage::Backend, config: any) {
|
||||
print "Storage::backend_opened", tag, config;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
redef exit_only_after_terminate = T;
|
||||
|
||||
event Storage::backend_opened(tag: string, config: any) {
|
||||
event Storage::backend_opened(tag: Storage::Backend, config: any) {
|
||||
print "Storage::backend_opened", tag, config;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue