Skip to content

Commit

Permalink
add subs service
Browse files Browse the repository at this point in the history
  • Loading branch information
ho-229 committed Nov 18, 2022
1 parent 1e4d116 commit 63af102
Show file tree
Hide file tree
Showing 11 changed files with 247 additions and 1,719 deletions.
32 changes: 32 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ members = [
"limit-server-event",
"limit-server-event-test",

"limit-server-subs",

"limit-db",
"limit-config",
"limit-test-utils",
Expand Down
31 changes: 31 additions & 0 deletions idl/subs.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
syntax = "proto3";
package limit.subs;

import "auth.proto";
import "subs.types.proto";

message SubscribableObject {
// subscribable object id
string id = 1;
// public key
string pubkey = 6;
}

message GetObjectsRequest {
limit.auth.Auth token = 1;
// target subscribable object ids
repeated string ids = 2;
}

message GetSubscribableObjectsResponse {
repeated SubscribableObject objects = 1;
}

message GetProfilesResponse {
repeated limit.subs.types.Profile profiles = 1;
}

service SubsService {
rpc GetSubscribableObjects(GetObjectsRequest) returns (GetSubscribableObjectsResponse);
rpc GetProfiles(GetObjectsRequest) returns (GetProfilesResponse);
}
37 changes: 37 additions & 0 deletions idl/subs.types.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
syntax = "proto3";
package limit.subs.types;

import "utils.proto";

enum Types {
USER = 0;
GROUP = 1;
}

message Profile {
// [email protected]
string username = 1;
// subscribable object name
string name = 2;
// intro
string bio = 3;
// avatar link
string avatar = 4;

oneof detail {
User user = 5;
Group group = 6;
}
}

message User {
// last seen date
limit.utils.Date last_seen = 1;
// last modified date
limit.utils.Date last_modified = 2;
}

message Group {
// ids of group members
repeated string members = 1;
}
36 changes: 0 additions & 36 deletions idl/user.profile.proto

This file was deleted.

16 changes: 0 additions & 16 deletions idl/user.proto

This file was deleted.

3 changes: 0 additions & 3 deletions limit-am/src/main.rs

This file was deleted.

Loading

0 comments on commit 63af102

Please sign in to comment.