63 lines
1.2 KiB
Protocol Buffer
63 lines
1.2 KiB
Protocol Buffer
syntax = "proto3";
|
|
|
|
option go_package = "./accounting";
|
|
package accounting;
|
|
|
|
service Accounting {
|
|
|
|
// Проверка доступа права
|
|
rpc Allow (AllowRequest) returns (AllowReply) {}
|
|
|
|
// Изменения значения правила для пользователя/группы
|
|
rpc SetRule (SetRequest) returns (SetReply) {}
|
|
|
|
// Присоеденение пользователя к группе
|
|
rpc AddGroup (AddGroupRequest) returns (AddGroupReply) {}
|
|
|
|
// Удаление пользователя из группы
|
|
rpc DelGroup (DelGroupRequest) returns (DelGroupReply) {}
|
|
}
|
|
|
|
message AllowRequest {
|
|
uint32 id = 1;
|
|
bool is_group = 2;
|
|
string rule = 3;
|
|
}
|
|
|
|
message AllowReply {
|
|
bool access = 1;
|
|
string error = 2;
|
|
}
|
|
|
|
message SetRequest {
|
|
uint32 id = 1;
|
|
bool is_group = 2;
|
|
string rule = 3;
|
|
int32 val = 4;
|
|
}
|
|
|
|
message SetReply {
|
|
bool success = 1;
|
|
string error = 2;
|
|
}
|
|
|
|
message AddGroupRequest {
|
|
uint32 id = 1;
|
|
bool is_group = 2;
|
|
uint32 group_id = 3;
|
|
}
|
|
|
|
message AddGroupReply {
|
|
bool success = 1;
|
|
string error = 2;
|
|
}
|
|
message DelGroupRequest {
|
|
uint32 id = 1;
|
|
bool is_group = 2;
|
|
uint32 group_id = 3;
|
|
}
|
|
|
|
message DelGroupReply {
|
|
bool success = 1;
|
|
string error = 2;
|
|
} |