Logging of the messages, customizable replies, assigning groups
This commit is contained in:
parent
f03f392cee
commit
7f57cd3bf6
21 changed files with 288 additions and 62 deletions
9
shared/CMakeLists.txt
Normal file
9
shared/CMakeLists.txt
Normal file
|
@ -0,0 +1,9 @@
|
|||
set(SOURCES
|
||||
)
|
||||
|
||||
set(HEADERS
|
||||
definitions.h
|
||||
result.h
|
||||
)
|
||||
|
||||
target_sources(${EXEC_NAME} PRIVATE ${SOURCES})
|
13
shared/definitions.h
Normal file
13
shared/definitions.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
// SPDX-FileCopyrightText: 2024 Yury Gubich <blue@macaw.me>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
namespace Shared {
|
||||
typedef std::vector<std::string> Strings;
|
||||
typedef std::map<std::string, Strings> Permissions;
|
||||
}
|
30
shared/result.h
Normal file
30
shared/result.h
Normal file
|
@ -0,0 +1,30 @@
|
|||
// SPDX-FileCopyrightText: 2024 Yury Gubich <blue@macaw.me>
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <map>
|
||||
#include <array>
|
||||
#include <string_view>
|
||||
|
||||
#include "definitions.h"
|
||||
|
||||
namespace Shared {
|
||||
enum Result {
|
||||
success,
|
||||
forbidden,
|
||||
unhandled,
|
||||
error
|
||||
};
|
||||
|
||||
typedef std::map<Result, Strings> Responses;
|
||||
|
||||
constexpr std::array<std::pair<Result, std::string_view>, 4> results = {{
|
||||
{ success, "success" },
|
||||
{ forbidden, "forbidden" },
|
||||
{ unhandled, "unhandled" },
|
||||
{ error, "error" },
|
||||
}};
|
||||
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue