Compare commits
No commits in common. "39ac016b46e5d8d45578136fe9a0f8af23454c8a" and "8ff2648e4c0181abb36802a29cfbf6255c04466e" have entirely different histories.
39ac016b46
...
8ff2648e4c
72
.idea/workspace.xml
generated
72
.idea/workspace.xml
generated
@ -4,21 +4,7 @@
|
||||
<option name="autoReloadType" value="ALL" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Support users related rpc calls">
|
||||
<change afterPath="$PROJECT_DIR$/pkg/authkit/audit.go" afterDir="false" />
|
||||
<change afterPath="$PROJECT_DIR$/pkg/authkit/notify.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/authkit/models/notifications.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/authkit/models/notifications.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/internal/grpc/notify.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/notify.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/internal/services/notifications.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/services/notifications.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/proto/notify.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/notify.pb.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/proto/notify.proto" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/notify.proto" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/proto/notify_grpc.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/notify_grpc.pb.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/proto/realm.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/realm.pb.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/proto/realm_grpc.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/realm_grpc.pb.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/proto/record.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/record.pb.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/proto/record_grpc.pb.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/record_grpc.pb.go" afterDir="false" />
|
||||
</list>
|
||||
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":rewind: Revert ":recycle: Move models.Account to sec.UserInfo" for a better solution This reverts commit 8fbb7960" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
@ -52,34 +38,34 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<component name="PropertiesComponent">{
|
||||
"keyToString": {
|
||||
"DefaultGoTemplateProperty": "Go File",
|
||||
"Go Build.Backend.executor": "Run",
|
||||
"Go 构建.Backend.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.go.formatter.settings.were.checked": "true",
|
||||
"RunOnceActivity.go.migrated.go.modules.settings": "true",
|
||||
"RunOnceActivity.go.modules.automatic.dependencies.download": "true",
|
||||
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
|
||||
"git-widget-placeholder": "master",
|
||||
"go.import.settings.migrated": "true",
|
||||
"go.sdk.automatically.set": "true",
|
||||
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hypernet/Passport",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"run.code.analysis.last.selected.profile": "pProject Default",
|
||||
"settings.editor.selected.configurable": "preferences.intentionPowerPack",
|
||||
"ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
<component name="PropertiesComponent"><![CDATA[{
|
||||
"keyToString": {
|
||||
"DefaultGoTemplateProperty": "Go File",
|
||||
"Go Build.Backend.executor": "Run",
|
||||
"Go 构建.Backend.executor": "Run",
|
||||
"RunOnceActivity.ShowReadmeOnStart": "true",
|
||||
"RunOnceActivity.go.formatter.settings.were.checked": "true",
|
||||
"RunOnceActivity.go.migrated.go.modules.settings": "true",
|
||||
"RunOnceActivity.go.modules.automatic.dependencies.download": "true",
|
||||
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true",
|
||||
"git-widget-placeholder": "master",
|
||||
"go.import.settings.migrated": "true",
|
||||
"go.sdk.automatically.set": "true",
|
||||
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/keys",
|
||||
"node.js.detected.package.eslint": "true",
|
||||
"node.js.selected.package.eslint": "(autodetect)",
|
||||
"nodejs_package_manager_path": "npm",
|
||||
"run.code.analysis.last.selected.profile": "pProject Default",
|
||||
"settings.editor.selected.configurable": "preferences.intentionPowerPack",
|
||||
"ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib",
|
||||
"vue.rearranger.settings.migration": "true"
|
||||
},
|
||||
"keyToStringList": {
|
||||
"DatabaseDriversLRU": [
|
||||
"postgresql"
|
||||
"keyToStringList": {
|
||||
"DatabaseDriversLRU": [
|
||||
"postgresql"
|
||||
]
|
||||
}
|
||||
}</component>
|
||||
}]]></component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/keys" />
|
||||
@ -165,6 +151,8 @@
|
||||
</component>
|
||||
<component name="VcsManagerConfiguration">
|
||||
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
|
||||
<MESSAGE value=":recycle: Single table to store auth preferences" />
|
||||
<MESSAGE value=":bug: Trying to prevent send same notification to the same user in batch" />
|
||||
<MESSAGE value=":sparkles: Allow user view and remove notification subscriptions" />
|
||||
<MESSAGE value=":recycle: Improve notifications mark read system" />
|
||||
<MESSAGE value=":bug: Bug fixes on multi-factors based authentication" />
|
||||
@ -188,9 +176,7 @@
|
||||
<MESSAGE value=":truck: Auth kit and parser of nexus userinfo token" />
|
||||
<MESSAGE value="Revert ":recycle: Move models.Account to sec.UserInfo" This reverts commit 8fbb7960" />
|
||||
<MESSAGE value=":rewind: Revert ":recycle: Move models.Account to sec.UserInfo" for a better solution This reverts commit 8fbb7960" />
|
||||
<MESSAGE value=":truck: Update package name from Hypdrogen to Hypernet" />
|
||||
<MESSAGE value=":sparkles: Support users related rpc calls" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Support users related rpc calls" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value=":rewind: Revert ":recycle: Move models.Account to sec.UserInfo" for a better solution This reverts commit 8fbb7960" />
|
||||
<option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" />
|
||||
</component>
|
||||
<component name="VgoProject">
|
||||
|
2
go.mod
2
go.mod
@ -3,7 +3,7 @@ module git.solsynth.dev/hypernet/passport
|
||||
go 1.23.2
|
||||
|
||||
require (
|
||||
git.solsynth.dev/hypernet/nexus v0.0.0-20241031125727-aa624ee45428
|
||||
git.solsynth.dev/hypernet/nexus v0.0.0-20241030155904-3f6ea11d2297
|
||||
git.solsynth.dev/hypernet/pusher v0.0.0-20241026153052-cd2c326efa4e
|
||||
github.com/dgraph-io/ristretto v0.1.1
|
||||
github.com/eko/gocache/lib/v4 v4.1.6
|
||||
|
2
go.sum
2
go.sum
@ -35,8 +35,6 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
|
||||
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4=
|
||||
git.solsynth.dev/hypernet/nexus v0.0.0-20241030155904-3f6ea11d2297 h1:g9huTJFUKPESCKWkcGpVm2RRInGkcwkbL8yR8SBjTFo=
|
||||
git.solsynth.dev/hypernet/nexus v0.0.0-20241030155904-3f6ea11d2297/go.mod h1:fXQsHXGio+7/0U95IitKF07wS4yTdCMp5ms8wpFBwVI=
|
||||
git.solsynth.dev/hypernet/nexus v0.0.0-20241031125727-aa624ee45428 h1:1TnXLOzZZKwdneKHynK1qJ/3UL4r/f5Pp3EM+qdL1n4=
|
||||
git.solsynth.dev/hypernet/nexus v0.0.0-20241031125727-aa624ee45428/go.mod h1:fXQsHXGio+7/0U95IitKF07wS4yTdCMp5ms8wpFBwVI=
|
||||
git.solsynth.dev/hypernet/pusher v0.0.0-20241026153052-cd2c326efa4e h1:DtHhMjgxS/spUt/KEdbRFtaVnepI6Vx8pbHdJaNH1hs=
|
||||
git.solsynth.dev/hypernet/pusher v0.0.0-20241026153052-cd2c326efa4e/go.mod h1:XHTqFU/vBe4JiuAjl87GUcL8+w/IizSNoqH6n3WkQFc=
|
||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||
|
@ -1,44 +0,0 @@
|
||||
package authkit
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex/sec"
|
||||
"git.solsynth.dev/hypernet/passport/pkg/proto"
|
||||
"github.com/gofiber/fiber/v2"
|
||||
)
|
||||
|
||||
func AddEvent(nx *nex.Conn, userId uint, action, target, ip, ua string) error {
|
||||
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get auth service client: %v", err)
|
||||
}
|
||||
_, err = proto.NewAuditServiceClient(conn).RecordEvent(nil, &proto.RecordEventRequest{
|
||||
UserId: uint64(userId),
|
||||
Action: action,
|
||||
Target: target,
|
||||
Ip: ip,
|
||||
UserAgent: ua,
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func AddEventExt(nx *nex.Conn, action, target string, c *fiber.Ctx) error {
|
||||
user, ok := c.Locals("nex_user").(*sec.UserInfo)
|
||||
if !ok {
|
||||
return fmt.Errorf("failed to get user info, make sure you call this method behind the ContextMiddleware")
|
||||
}
|
||||
|
||||
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get auth service client: %v", err)
|
||||
}
|
||||
_, err = proto.NewAuditServiceClient(conn).RecordEvent(nil, &proto.RecordEventRequest{
|
||||
UserId: uint64(user.ID),
|
||||
Action: action,
|
||||
Target: target,
|
||||
Ip: c.IP(),
|
||||
UserAgent: c.Get(fiber.HeaderUserAgent),
|
||||
})
|
||||
return err
|
||||
}
|
@ -2,8 +2,6 @@ package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/proto"
|
||||
"gorm.io/datatypes"
|
||||
"time"
|
||||
|
||||
@ -60,15 +58,6 @@ func (v Account) GetPrimaryEmail() AccountContact {
|
||||
return val
|
||||
}
|
||||
|
||||
func (v Account) EncodeToUserInfo() *proto.UserInfo {
|
||||
return &proto.UserInfo{
|
||||
Id: uint64(v.ID),
|
||||
Name: v.Name,
|
||||
PermNodes: nex.EncodeMap(v.PermNodes),
|
||||
Metadata: nex.EncodeMap(v),
|
||||
}
|
||||
}
|
||||
|
||||
type AccountContactType = int8
|
||||
|
||||
const (
|
||||
|
@ -1,7 +1,6 @@
|
||||
package models
|
||||
|
||||
import (
|
||||
"git.solsynth.dev/hypernet/pusher/pkg/pushkit"
|
||||
"gorm.io/datatypes"
|
||||
"time"
|
||||
)
|
||||
@ -21,29 +20,8 @@ type Notification struct {
|
||||
AccountID uint `json:"account_id"`
|
||||
|
||||
ReadAt *time.Time `json:"read_at"`
|
||||
}
|
||||
|
||||
func (v Notification) EncodeToPushkit() pushkit.Notification {
|
||||
return pushkit.Notification{
|
||||
Topic: v.Topic,
|
||||
Title: v.Title,
|
||||
Subtitle: v.Subtitle,
|
||||
Body: v.Body,
|
||||
Metadata: v.Metadata,
|
||||
Priority: v.Priority,
|
||||
}
|
||||
}
|
||||
|
||||
func NewNotificationFromPushkit(pk pushkit.Notification) Notification {
|
||||
return Notification{
|
||||
Topic: pk.Topic,
|
||||
Title: pk.Title,
|
||||
Subtitle: pk.Subtitle,
|
||||
Body: pk.Body,
|
||||
Metadata: pk.Metadata,
|
||||
Priority: pk.Priority,
|
||||
SenderID: nil,
|
||||
}
|
||||
IsRealtime bool `json:"is_realtime" gorm:"-"`
|
||||
}
|
||||
|
||||
const (
|
||||
|
@ -1,47 +0,0 @@
|
||||
package authkit
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
||||
"git.solsynth.dev/hypernet/passport/pkg/proto"
|
||||
"git.solsynth.dev/hypernet/pusher/pkg/pushkit"
|
||||
"github.com/goccy/go-json"
|
||||
)
|
||||
|
||||
func NotifyUser(nx *nex.Conn, userId uint64, notify pushkit.Notification, unsaved ...bool) error {
|
||||
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get auth service client: %v", err)
|
||||
}
|
||||
raw, _ := json.Marshal(notify)
|
||||
if len(unsaved) == 0 {
|
||||
unsaved = append(unsaved, false)
|
||||
}
|
||||
_, err = proto.NewNotifyServiceClient(conn).NotifyUser(nil, &proto.NotifyUserRequest{
|
||||
UserId: userId,
|
||||
Notify: &proto.NotifyInfo{
|
||||
Unsaved: unsaved[0],
|
||||
Data: raw,
|
||||
},
|
||||
})
|
||||
return err
|
||||
}
|
||||
|
||||
func NotifyUserBatch(nx *nex.Conn, userId []uint64, notify pushkit.Notification, unsaved ...bool) error {
|
||||
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
|
||||
if err != nil {
|
||||
return fmt.Errorf("failed to get auth service client: %v", err)
|
||||
}
|
||||
raw, _ := json.Marshal(notify)
|
||||
if len(unsaved) == 0 {
|
||||
unsaved = append(unsaved, false)
|
||||
}
|
||||
_, err = proto.NewNotifyServiceClient(conn).NotifyUserBatch(nil, &proto.NotifyUserBatchRequest{
|
||||
UserId: userId,
|
||||
Notify: &proto.NotifyInfo{
|
||||
Unsaved: unsaved[0],
|
||||
Data: raw,
|
||||
},
|
||||
})
|
||||
return err
|
||||
}
|
@ -5,12 +5,19 @@ import (
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
||||
"git.solsynth.dev/hypernet/passport/pkg/authkit/models"
|
||||
|
||||
"git.solsynth.dev/hypernet/passport/pkg/internal/database"
|
||||
"github.com/samber/lo"
|
||||
|
||||
"git.solsynth.dev/hypernet/passport/pkg/internal/services"
|
||||
jsoniter "github.com/json-iterator/go"
|
||||
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/proto"
|
||||
)
|
||||
|
||||
type authenticateServer struct {
|
||||
proto.UnimplementedAuthServiceServer
|
||||
}
|
||||
|
||||
func (v *App) Authenticate(_ context.Context, in *proto.AuthRequest) (*proto.AuthReply, error) {
|
||||
ticket, perms, err := services.Authenticate(uint(in.GetSessionId()))
|
||||
if err != nil {
|
||||
@ -74,3 +81,55 @@ func (v *App) EnsureUserPermGranted(_ context.Context, in *proto.CheckUserPermRe
|
||||
IsValid: valid,
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (v *App) ListUserFriends(_ context.Context, in *proto.ListUserRelativeRequest) (*proto.ListUserRelativeResponse, error) {
|
||||
tx := database.C.Preload("Account").Where("status = ?", models.RelationshipFriend)
|
||||
|
||||
if in.GetIsRelated() {
|
||||
tx = tx.Where("related_id = ?", in.GetUserId())
|
||||
} else {
|
||||
tx = tx.Where("account_id = ?", in.GetUserId())
|
||||
}
|
||||
|
||||
var data []models.AccountRelationship
|
||||
if err := tx.Find(&data).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &proto.ListUserRelativeResponse{
|
||||
Data: lo.Map(data, func(item models.AccountRelationship, index int) *proto.UserInfo {
|
||||
val := &proto.UserInfo{
|
||||
Id: uint64(item.AccountID),
|
||||
Name: item.Account.Name,
|
||||
}
|
||||
|
||||
return val
|
||||
}),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (v *App) ListUserBlocklist(_ context.Context, in *proto.ListUserRelativeRequest) (*proto.ListUserRelativeResponse, error) {
|
||||
tx := database.C.Preload("Account").Where("status = ?", models.RelationshipBlocked)
|
||||
|
||||
if in.GetIsRelated() {
|
||||
tx = tx.Where("related_id = ?", in.GetUserId())
|
||||
} else {
|
||||
tx = tx.Where("account_id = ?", in.GetUserId())
|
||||
}
|
||||
|
||||
var data []models.AccountRelationship
|
||||
if err := tx.Find(&data).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &proto.ListUserRelativeResponse{
|
||||
Data: lo.Map(data, func(item models.AccountRelationship, index int) *proto.UserInfo {
|
||||
val := &proto.UserInfo{
|
||||
Id: uint64(item.AccountID),
|
||||
Name: item.Account.Name,
|
||||
}
|
||||
|
||||
return val
|
||||
}),
|
||||
}, nil
|
||||
}
|
||||
|
@ -3,9 +3,8 @@ package grpc
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
||||
"git.solsynth.dev/hypernet/passport/pkg/authkit/models"
|
||||
"git.solsynth.dev/hypernet/pusher/pkg/pushkit"
|
||||
"github.com/goccy/go-json"
|
||||
"github.com/rs/zerolog/log"
|
||||
|
||||
"git.solsynth.dev/hypernet/passport/pkg/internal/database"
|
||||
@ -22,18 +21,23 @@ func (v *App) NotifyUser(_ context.Context, in *proto.NotifyUserRequest) (*proto
|
||||
return nil, fmt.Errorf("unable to get account: %v", err)
|
||||
}
|
||||
|
||||
var nty pushkit.Notification
|
||||
if err = json.Unmarshal(in.GetNotify().GetData(), &nty); err != nil {
|
||||
return nil, fmt.Errorf("unable to unmarshal notification: %v", err)
|
||||
}
|
||||
metadata := nex.DecodeMap(in.GetNotify().GetMetadata())
|
||||
|
||||
notification := models.NewNotificationFromPushkit(nty)
|
||||
notification.Account = user
|
||||
notification.AccountID = user.ID
|
||||
notification := models.Notification{
|
||||
Topic: in.GetNotify().GetTopic(),
|
||||
Title: in.GetNotify().GetTitle(),
|
||||
Subtitle: in.GetNotify().GetSubtitle(),
|
||||
Body: in.GetNotify().GetBody(),
|
||||
Metadata: metadata,
|
||||
Priority: int(in.GetNotify().GetPriority()),
|
||||
IsRealtime: in.GetNotify().GetIsRealtime(),
|
||||
Account: user,
|
||||
AccountID: user.ID,
|
||||
}
|
||||
|
||||
log.Debug().Str("topic", notification.Topic).Uint("uid", notification.AccountID).Msg("Notifying user...")
|
||||
|
||||
if in.GetNotify().GetUnsaved() {
|
||||
if notification.IsRealtime {
|
||||
if err := services.PushNotification(notification); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@ -57,10 +61,7 @@ func (v *App) NotifyUserBatch(_ context.Context, in *proto.NotifyUserBatchReques
|
||||
return nil, fmt.Errorf("unable to get account: %v", err)
|
||||
}
|
||||
|
||||
var nty pushkit.Notification
|
||||
if err = json.Unmarshal(in.GetNotify().GetData(), &nty); err != nil {
|
||||
return nil, fmt.Errorf("unable to unmarshal notification: %v", err)
|
||||
}
|
||||
metadata := nex.DecodeMap(in.GetNotify().GetMetadata())
|
||||
|
||||
var checklist = make(map[uint]bool, len(users))
|
||||
var notifications []models.Notification
|
||||
@ -69,9 +70,17 @@ func (v *App) NotifyUserBatch(_ context.Context, in *proto.NotifyUserBatchReques
|
||||
continue
|
||||
}
|
||||
|
||||
notification := models.NewNotificationFromPushkit(nty)
|
||||
notification.Account = user
|
||||
notification.AccountID = user.ID
|
||||
notification := models.Notification{
|
||||
Topic: in.GetNotify().GetTopic(),
|
||||
Title: in.GetNotify().GetTitle(),
|
||||
Subtitle: in.GetNotify().GetSubtitle(),
|
||||
Body: in.GetNotify().GetBody(),
|
||||
Metadata: metadata,
|
||||
Priority: int(in.GetNotify().GetPriority()),
|
||||
IsRealtime: in.GetNotify().GetIsRealtime(),
|
||||
Account: user,
|
||||
AccountID: user.ID,
|
||||
}
|
||||
checklist[user.ID] = true
|
||||
|
||||
notifications = append(notifications, notification)
|
||||
@ -79,7 +88,7 @@ func (v *App) NotifyUserBatch(_ context.Context, in *proto.NotifyUserBatchReques
|
||||
|
||||
log.Debug().Str("topic", notifications[0].Topic).Any("uid", lo.Keys(checklist)).Msg("Notifying users...")
|
||||
|
||||
if in.GetNotify().GetUnsaved() {
|
||||
if in.GetNotify().GetIsRealtime() {
|
||||
services.PushNotificationBatch(notifications)
|
||||
} else {
|
||||
if err := services.NewNotificationBatch(notifications); err != nil {
|
||||
@ -92,16 +101,13 @@ func (v *App) NotifyUserBatch(_ context.Context, in *proto.NotifyUserBatchReques
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (v *App) NotifyAllUser(_ context.Context, in *proto.NotifyInfo) (*proto.NotifyResponse, error) {
|
||||
func (v *App) NotifyAllUser(_ context.Context, in *proto.NotifyRequest) (*proto.NotifyResponse, error) {
|
||||
var users []models.Account
|
||||
if err := database.C.Find(&users).Error; err != nil {
|
||||
return nil, fmt.Errorf("unable to get account: %v", err)
|
||||
}
|
||||
|
||||
var nty pushkit.Notification
|
||||
if err := json.Unmarshal(in.GetData(), &nty); err != nil {
|
||||
return nil, fmt.Errorf("unable to unmarshal notification: %v", err)
|
||||
}
|
||||
metadata := nex.DecodeMap(in.GetMetadata())
|
||||
|
||||
var checklist = make(map[uint]bool, len(users))
|
||||
var notifications []models.Notification
|
||||
@ -110,9 +116,17 @@ func (v *App) NotifyAllUser(_ context.Context, in *proto.NotifyInfo) (*proto.Not
|
||||
continue
|
||||
}
|
||||
|
||||
notification := models.NewNotificationFromPushkit(nty)
|
||||
notification.Account = user
|
||||
notification.AccountID = user.ID
|
||||
notification := models.Notification{
|
||||
Topic: in.GetTopic(),
|
||||
Title: in.GetTitle(),
|
||||
Subtitle: in.GetSubtitle(),
|
||||
Body: in.GetBody(),
|
||||
Metadata: metadata,
|
||||
Priority: int(in.GetPriority()),
|
||||
IsRealtime: in.GetIsRealtime(),
|
||||
Account: user,
|
||||
AccountID: user.ID,
|
||||
}
|
||||
checklist[user.ID] = true
|
||||
|
||||
notifications = append(notifications, notification)
|
||||
@ -120,7 +134,7 @@ func (v *App) NotifyAllUser(_ context.Context, in *proto.NotifyInfo) (*proto.Not
|
||||
|
||||
log.Debug().Str("topic", notifications[0].Topic).Any("uid", lo.Keys(checklist)).Msg("Notifying users...")
|
||||
|
||||
if in.GetUnsaved() {
|
||||
if in.GetIsRealtime() {
|
||||
services.PushNotificationBatch(notifications)
|
||||
} else {
|
||||
if err := services.NewNotificationBatch(notifications); err != nil {
|
@ -16,10 +16,9 @@ import (
|
||||
type App struct {
|
||||
nroto.UnimplementedAuthServiceServer
|
||||
nroto.UnimplementedDirectoryServiceServer
|
||||
nroto.UnimplementedUserServiceServer
|
||||
proto.UnimplementedRealmServiceServer
|
||||
proto.UnimplementedAuditServiceServer
|
||||
proto.UnimplementedNotifyServiceServer
|
||||
proto.UnimplementedNotifierServer
|
||||
proto.UnimplementedRealmServer
|
||||
proto.UnimplementedEventRecorderServer
|
||||
health.UnimplementedHealthServer
|
||||
|
||||
srv *grpc.Server
|
||||
@ -31,10 +30,9 @@ func NewServer() *App {
|
||||
}
|
||||
|
||||
nroto.RegisterAuthServiceServer(server.srv, server)
|
||||
nroto.RegisterUserServiceServer(server.srv, server)
|
||||
proto.RegisterNotifyServiceServer(server.srv, server)
|
||||
proto.RegisterRealmServiceServer(server.srv, server)
|
||||
proto.RegisterAuditServiceServer(server.srv, server)
|
||||
proto.RegisterNotifierServer(server.srv, server)
|
||||
proto.RegisterRealmServer(server.srv, server)
|
||||
proto.RegisterEventRecorderServer(server.srv, server)
|
||||
health.RegisterHealthServer(server.srv, server)
|
||||
|
||||
reflection.Register(server.srv)
|
||||
|
@ -1,66 +0,0 @@
|
||||
package grpc
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/proto"
|
||||
"git.solsynth.dev/hypernet/passport/pkg/authkit/models"
|
||||
"git.solsynth.dev/hypernet/passport/pkg/internal/database"
|
||||
"github.com/samber/lo"
|
||||
"google.golang.org/grpc/codes"
|
||||
"google.golang.org/grpc/status"
|
||||
)
|
||||
|
||||
func (v *App) GetUser(ctx context.Context, request *proto.GetUserRequest) (*proto.UserInfo, error) {
|
||||
var account models.Account
|
||||
if err := database.C.Where("id = ?", uint(request.GetUserId())).First(&account).Error; err != nil {
|
||||
return nil, status.Errorf(codes.NotFound, fmt.Sprintf("requested user with id %d was not found", request.GetUserId()))
|
||||
}
|
||||
return account.EncodeToUserInfo(), nil
|
||||
}
|
||||
|
||||
func (v *App) ListUser(ctx context.Context, request *proto.ListUserRequest) (*proto.MultipleUserInfo, error) {
|
||||
var accounts []models.Account
|
||||
if err := database.C.
|
||||
Where("id IN ?", lo.Map(request.GetUserId(), func(id uint64, _ int) interface{} { return id })).
|
||||
Find(&accounts).Error; err != nil {
|
||||
return nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to list users: %v", err))
|
||||
}
|
||||
return &proto.MultipleUserInfo{
|
||||
Data: lo.Map(request.GetUserId(), func(item uint64, index int) *proto.UserInfo {
|
||||
val, ok := lo.Find(accounts, func(x models.Account) bool {
|
||||
return uint(item) == x.ID
|
||||
})
|
||||
if !ok {
|
||||
return nil
|
||||
}
|
||||
return val.EncodeToUserInfo()
|
||||
}),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func (v *App) ListUserRelative(ctx context.Context, request *proto.ListUserRelativeRequest) (*proto.ListUserRelativeResponse, error) {
|
||||
tx := database.C.Preload("Account").Where("status = ?", request.GetStatus())
|
||||
|
||||
if request.GetIsRelated() {
|
||||
tx = tx.Where("related_id = ?", request.GetUserId())
|
||||
} else {
|
||||
tx = tx.Where("account_id = ?", request.GetUserId())
|
||||
}
|
||||
|
||||
var data []models.AccountRelationship
|
||||
if err := tx.Find(&data).Error; err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return &proto.ListUserRelativeResponse{
|
||||
Data: lo.Map(data, func(item models.AccountRelationship, index int) *proto.UserInfo {
|
||||
val := &proto.UserInfo{
|
||||
Id: uint64(item.AccountID),
|
||||
Name: item.Account.Name,
|
||||
}
|
||||
|
||||
return val
|
||||
}),
|
||||
}, nil
|
||||
}
|
@ -132,9 +132,15 @@ func PushNotification(notification models.Notification, skipNotifiableCheck ...b
|
||||
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
|
||||
defer cancel()
|
||||
err = gap.Px.PushNotifyBatch(pushkit.NotificationPushBatchRequest{
|
||||
Providers: providers,
|
||||
Tokens: tokens,
|
||||
Notification: notification.EncodeToPushkit(),
|
||||
Providers: providers,
|
||||
Tokens: tokens,
|
||||
Notification: pushkit.Notification{
|
||||
Topic: notification.Topic,
|
||||
Title: notification.Title,
|
||||
Subtitle: notification.Subtitle,
|
||||
Body: notification.Body,
|
||||
Metadata: notification.Metadata,
|
||||
},
|
||||
})
|
||||
|
||||
return err
|
||||
@ -202,9 +208,15 @@ func PushNotificationBatch(notifications []models.Notification, skipNotifiableCh
|
||||
|
||||
ctx, cancel = context.WithTimeout(context.Background(), 5*time.Second)
|
||||
_ = gap.Px.PushNotifyBatch(pushkit.NotificationPushBatchRequest{
|
||||
Providers: providers,
|
||||
Tokens: tokens,
|
||||
Notification: notification.EncodeToPushkit(),
|
||||
Providers: providers,
|
||||
Tokens: tokens,
|
||||
Notification: pushkit.Notification{
|
||||
Topic: notification.Topic,
|
||||
Title: notification.Title,
|
||||
Subtitle: notification.Subtitle,
|
||||
Body: notification.Body,
|
||||
Metadata: notification.Metadata,
|
||||
},
|
||||
})
|
||||
cancel()
|
||||
}
|
||||
|
@ -20,73 +20,18 @@ const (
|
||||
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||
)
|
||||
|
||||
type NotifyInfo struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
// This bytes is directly encoded from pushkit.Notification
|
||||
// Which is passed to the pusher service, we don't need to care about the content
|
||||
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
|
||||
Unsaved bool `protobuf:"varint,2,opt,name=unsaved,proto3" json:"unsaved,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NotifyInfo) Reset() {
|
||||
*x = NotifyInfo{}
|
||||
mi := &file_notify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *NotifyInfo) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NotifyInfo) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_notify_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NotifyInfo.ProtoReflect.Descriptor instead.
|
||||
func (*NotifyInfo) Descriptor() ([]byte, []int) {
|
||||
return file_notify_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *NotifyInfo) GetData() []byte {
|
||||
if x != nil {
|
||||
return x.Data
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *NotifyInfo) GetUnsaved() bool {
|
||||
if x != nil {
|
||||
return x.Unsaved
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type NotifyUserRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Notify *NotifyInfo `protobuf:"bytes,2,opt,name=notify,proto3" json:"notify,omitempty"`
|
||||
UserId uint64 `protobuf:"varint,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Notify *NotifyRequest `protobuf:"bytes,2,opt,name=notify,proto3" json:"notify,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NotifyUserRequest) Reset() {
|
||||
*x = NotifyUserRequest{}
|
||||
mi := &file_notify_proto_msgTypes[1]
|
||||
mi := &file_notify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -98,7 +43,7 @@ func (x *NotifyUserRequest) String() string {
|
||||
func (*NotifyUserRequest) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyUserRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_notify_proto_msgTypes[1]
|
||||
mi := &file_notify_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -111,7 +56,7 @@ func (x *NotifyUserRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use NotifyUserRequest.ProtoReflect.Descriptor instead.
|
||||
func (*NotifyUserRequest) Descriptor() ([]byte, []int) {
|
||||
return file_notify_proto_rawDescGZIP(), []int{1}
|
||||
return file_notify_proto_rawDescGZIP(), []int{0}
|
||||
}
|
||||
|
||||
func (x *NotifyUserRequest) GetUserId() uint64 {
|
||||
@ -121,7 +66,7 @@ func (x *NotifyUserRequest) GetUserId() uint64 {
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NotifyUserRequest) GetNotify() *NotifyInfo {
|
||||
func (x *NotifyUserRequest) GetNotify() *NotifyRequest {
|
||||
if x != nil {
|
||||
return x.Notify
|
||||
}
|
||||
@ -133,13 +78,13 @@ type NotifyUserBatchRequest struct {
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
UserId []uint64 `protobuf:"varint,1,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Notify *NotifyInfo `protobuf:"bytes,2,opt,name=notify,proto3" json:"notify,omitempty"`
|
||||
UserId []uint64 `protobuf:"varint,1,rep,packed,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
|
||||
Notify *NotifyRequest `protobuf:"bytes,2,opt,name=notify,proto3" json:"notify,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NotifyUserBatchRequest) Reset() {
|
||||
*x = NotifyUserBatchRequest{}
|
||||
mi := &file_notify_proto_msgTypes[2]
|
||||
mi := &file_notify_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
@ -151,7 +96,7 @@ func (x *NotifyUserBatchRequest) String() string {
|
||||
func (*NotifyUserBatchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyUserBatchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_notify_proto_msgTypes[2]
|
||||
mi := &file_notify_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
@ -164,7 +109,7 @@ func (x *NotifyUserBatchRequest) ProtoReflect() protoreflect.Message {
|
||||
|
||||
// Deprecated: Use NotifyUserBatchRequest.ProtoReflect.Descriptor instead.
|
||||
func (*NotifyUserBatchRequest) Descriptor() ([]byte, []int) {
|
||||
return file_notify_proto_rawDescGZIP(), []int{2}
|
||||
return file_notify_proto_rawDescGZIP(), []int{1}
|
||||
}
|
||||
|
||||
func (x *NotifyUserBatchRequest) GetUserId() []uint64 {
|
||||
@ -174,19 +119,113 @@ func (x *NotifyUserBatchRequest) GetUserId() []uint64 {
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *NotifyUserBatchRequest) GetNotify() *NotifyInfo {
|
||||
func (x *NotifyUserBatchRequest) GetNotify() *NotifyRequest {
|
||||
if x != nil {
|
||||
return x.Notify
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type NotifyRequest struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
Topic string `protobuf:"bytes,1,opt,name=topic,proto3" json:"topic,omitempty"`
|
||||
Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
|
||||
Subtitle *string `protobuf:"bytes,3,opt,name=subtitle,proto3,oneof" json:"subtitle,omitempty"`
|
||||
Body string `protobuf:"bytes,4,opt,name=body,proto3" json:"body,omitempty"`
|
||||
Metadata []byte `protobuf:"bytes,5,opt,name=metadata,proto3" json:"metadata,omitempty"`
|
||||
Priority int64 `protobuf:"varint,6,opt,name=priority,proto3" json:"priority,omitempty"`
|
||||
IsRealtime bool `protobuf:"varint,8,opt,name=is_realtime,json=isRealtime,proto3" json:"is_realtime,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) Reset() {
|
||||
*x = NotifyRequest{}
|
||||
mi := &file_notify_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) String() string {
|
||||
return protoimpl.X.MessageStringOf(x)
|
||||
}
|
||||
|
||||
func (*NotifyRequest) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_notify_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
return ms
|
||||
}
|
||||
return mi.MessageOf(x)
|
||||
}
|
||||
|
||||
// Deprecated: Use NotifyRequest.ProtoReflect.Descriptor instead.
|
||||
func (*NotifyRequest) Descriptor() ([]byte, []int) {
|
||||
return file_notify_proto_rawDescGZIP(), []int{2}
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) GetTopic() string {
|
||||
if x != nil {
|
||||
return x.Topic
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) GetTitle() string {
|
||||
if x != nil {
|
||||
return x.Title
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) GetSubtitle() string {
|
||||
if x != nil && x.Subtitle != nil {
|
||||
return *x.Subtitle
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) GetBody() string {
|
||||
if x != nil {
|
||||
return x.Body
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) GetMetadata() []byte {
|
||||
if x != nil {
|
||||
return x.Metadata
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) GetPriority() int64 {
|
||||
if x != nil {
|
||||
return x.Priority
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) GetIsRealtime() bool {
|
||||
if x != nil {
|
||||
return x.IsRealtime
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type NotifyResponse struct {
|
||||
state protoimpl.MessageState
|
||||
sizeCache protoimpl.SizeCache
|
||||
unknownFields protoimpl.UnknownFields
|
||||
|
||||
IsSuccess bool `protobuf:"varint,1,opt,name=is_success,json=isSuccess,proto3" json:"is_success,omitempty"`
|
||||
IsSuccess bool `protobuf:"varint,1,opt,name=is_success,json=isSuccess,proto3" json:"is_success,omitempty"`
|
||||
AffectedCount int64 `protobuf:"varint,2,opt,name=affected_count,json=affectedCount,proto3" json:"affected_count,omitempty"`
|
||||
}
|
||||
|
||||
func (x *NotifyResponse) Reset() {
|
||||
@ -226,44 +265,63 @@ func (x *NotifyResponse) GetIsSuccess() bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func (x *NotifyResponse) GetAffectedCount() int64 {
|
||||
if x != nil {
|
||||
return x.AffectedCount
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
var File_notify_proto protoreflect.FileDescriptor
|
||||
|
||||
var file_notify_proto_rawDesc = []byte{
|
||||
0x0a, 0x0c, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x05,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x3a, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49,
|
||||
0x6e, 0x66, 0x6f, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x18, 0x0a, 0x07, 0x75, 0x6e, 0x73, 0x61, 0x76,
|
||||
0x65, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x75, 0x6e, 0x73, 0x61, 0x76, 0x65,
|
||||
0x64, 0x22, 0x57, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69,
|
||||
0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12,
|
||||
0x29, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32,
|
||||
0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x5c, 0x0a, 0x16, 0x4e, 0x6f,
|
||||
0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18,
|
||||
0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x12, 0x29, 0x0a,
|
||||
0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x66, 0x6f,
|
||||
0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x22, 0x2f, 0x0a, 0x0e, 0x4e, 0x6f, 0x74, 0x69,
|
||||
0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73,
|
||||
0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x09,
|
||||
0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0xd8, 0x01, 0x0a, 0x0d, 0x4e, 0x6f,
|
||||
0x74, 0x69, 0x66, 0x79, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x4e,
|
||||
0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x5a, 0x0a, 0x11, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55,
|
||||
0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73,
|
||||
0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65,
|
||||
0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02, 0x20,
|
||||
0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69,
|
||||
0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66,
|
||||
0x79, 0x22, 0x5f, 0x0a, 0x16, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42,
|
||||
0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75,
|
||||
0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x03, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73,
|
||||
0x65, 0x72, 0x49, 0x64, 0x12, 0x2c, 0x0a, 0x06, 0x6e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74,
|
||||
0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x06, 0x6e, 0x6f, 0x74, 0x69,
|
||||
0x66, 0x79, 0x22, 0xd6, 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x18, 0x01, 0x20,
|
||||
0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x70, 0x69, 0x63, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69,
|
||||
0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65,
|
||||
0x12, 0x1f, 0x0a, 0x08, 0x73, 0x75, 0x62, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x03, 0x20, 0x01,
|
||||
0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x73, 0x75, 0x62, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x88, 0x01,
|
||||
0x01, 0x12, 0x12, 0x0a, 0x04, 0x62, 0x6f, 0x64, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52,
|
||||
0x04, 0x62, 0x6f, 0x64, 0x79, 0x12, 0x1a, 0x0a, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||
0x61, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x08, 0x6d, 0x65, 0x74, 0x61, 0x64, 0x61, 0x74,
|
||||
0x61, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x18, 0x06, 0x20,
|
||||
0x01, 0x28, 0x03, 0x52, 0x08, 0x70, 0x72, 0x69, 0x6f, 0x72, 0x69, 0x74, 0x79, 0x12, 0x1f, 0x0a,
|
||||
0x0b, 0x69, 0x73, 0x5f, 0x72, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x08, 0x20, 0x01,
|
||||
0x28, 0x08, 0x52, 0x0a, 0x69, 0x73, 0x52, 0x65, 0x61, 0x6c, 0x74, 0x69, 0x6d, 0x65, 0x42, 0x0b,
|
||||
0x0a, 0x09, 0x5f, 0x73, 0x75, 0x62, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x22, 0x56, 0x0a, 0x0e, 0x4e,
|
||||
0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a,
|
||||
0x0a, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28,
|
||||
0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x12, 0x25, 0x0a, 0x0e,
|
||||
0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x5f, 0x63, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x02,
|
||||
0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x61, 0x66, 0x66, 0x65, 0x63, 0x74, 0x65, 0x64, 0x43, 0x6f,
|
||||
0x75, 0x6e, 0x74, 0x32, 0xd6, 0x01, 0x0a, 0x08, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x69, 0x65, 0x72,
|
||||
0x12, 0x3f, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65,
|
||||
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
|
||||
0x00, 0x12, 0x49, 0x0a, 0x0f, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42,
|
||||
0x61, 0x74, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74,
|
||||
0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69,
|
||||
0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x49, 0x0a, 0x0f,
|
||||
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x12,
|
||||
0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73,
|
||||
0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3b, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66,
|
||||
0x79, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x12, 0x11, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x49, 0x6e, 0x66, 0x6f, 0x1a, 0x15, 0x2e, 0x70, 0x72,
|
||||
0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62,
|
||||
0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0d,
|
||||
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x71, 0x75,
|
||||
0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69,
|
||||
0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07,
|
||||
0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -280,20 +338,20 @@ func file_notify_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_notify_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_notify_proto_goTypes = []any{
|
||||
(*NotifyInfo)(nil), // 0: proto.NotifyInfo
|
||||
(*NotifyUserRequest)(nil), // 1: proto.NotifyUserRequest
|
||||
(*NotifyUserBatchRequest)(nil), // 2: proto.NotifyUserBatchRequest
|
||||
(*NotifyUserRequest)(nil), // 0: proto.NotifyUserRequest
|
||||
(*NotifyUserBatchRequest)(nil), // 1: proto.NotifyUserBatchRequest
|
||||
(*NotifyRequest)(nil), // 2: proto.NotifyRequest
|
||||
(*NotifyResponse)(nil), // 3: proto.NotifyResponse
|
||||
}
|
||||
var file_notify_proto_depIdxs = []int32{
|
||||
0, // 0: proto.NotifyUserRequest.notify:type_name -> proto.NotifyInfo
|
||||
0, // 1: proto.NotifyUserBatchRequest.notify:type_name -> proto.NotifyInfo
|
||||
1, // 2: proto.NotifyService.NotifyUser:input_type -> proto.NotifyUserRequest
|
||||
2, // 3: proto.NotifyService.NotifyUserBatch:input_type -> proto.NotifyUserBatchRequest
|
||||
0, // 4: proto.NotifyService.NotifyAllUser:input_type -> proto.NotifyInfo
|
||||
3, // 5: proto.NotifyService.NotifyUser:output_type -> proto.NotifyResponse
|
||||
3, // 6: proto.NotifyService.NotifyUserBatch:output_type -> proto.NotifyResponse
|
||||
3, // 7: proto.NotifyService.NotifyAllUser:output_type -> proto.NotifyResponse
|
||||
2, // 0: proto.NotifyUserRequest.notify:type_name -> proto.NotifyRequest
|
||||
2, // 1: proto.NotifyUserBatchRequest.notify:type_name -> proto.NotifyRequest
|
||||
0, // 2: proto.Notifier.NotifyUser:input_type -> proto.NotifyUserRequest
|
||||
1, // 3: proto.Notifier.NotifyUserBatch:input_type -> proto.NotifyUserBatchRequest
|
||||
2, // 4: proto.Notifier.NotifyAllUser:input_type -> proto.NotifyRequest
|
||||
3, // 5: proto.Notifier.NotifyUser:output_type -> proto.NotifyResponse
|
||||
3, // 6: proto.Notifier.NotifyUserBatch:output_type -> proto.NotifyResponse
|
||||
3, // 7: proto.Notifier.NotifyAllUser:output_type -> proto.NotifyResponse
|
||||
5, // [5:8] is the sub-list for method output_type
|
||||
2, // [2:5] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
@ -306,6 +364,7 @@ func file_notify_proto_init() {
|
||||
if File_notify_proto != nil {
|
||||
return
|
||||
}
|
||||
file_notify_proto_msgTypes[2].OneofWrappers = []any{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
@ -4,29 +4,33 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service NotifyService {
|
||||
service Notifier {
|
||||
rpc NotifyUser(NotifyUserRequest) returns (NotifyResponse) {}
|
||||
rpc NotifyUserBatch(NotifyUserBatchRequest) returns (NotifyResponse) {}
|
||||
rpc NotifyAllUser(NotifyInfo) returns(NotifyResponse) {}
|
||||
}
|
||||
|
||||
message NotifyInfo {
|
||||
// This bytes is directly encoded from pushkit.Notification
|
||||
// Which is passed to the pusher service, we don't need to care about the content
|
||||
bytes data = 1;
|
||||
bool unsaved = 2;
|
||||
rpc NotifyAllUser(NotifyRequest) returns(NotifyResponse) {}
|
||||
}
|
||||
|
||||
message NotifyUserRequest {
|
||||
uint64 user_id = 1;
|
||||
NotifyInfo notify = 2;
|
||||
NotifyRequest notify = 2;
|
||||
}
|
||||
|
||||
message NotifyUserBatchRequest {
|
||||
repeated uint64 user_id = 1;
|
||||
NotifyInfo notify = 2;
|
||||
NotifyRequest notify = 2;
|
||||
}
|
||||
|
||||
message NotifyRequest {
|
||||
string topic = 1;
|
||||
string title = 2;
|
||||
optional string subtitle = 3;
|
||||
string body = 4;
|
||||
bytes metadata = 5;
|
||||
int64 priority = 6;
|
||||
bool is_realtime = 8;
|
||||
}
|
||||
|
||||
message NotifyResponse {
|
||||
bool is_success = 1;
|
||||
int64 affected_count = 2;
|
||||
}
|
||||
|
@ -19,177 +19,177 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
NotifyService_NotifyUser_FullMethodName = "/proto.NotifyService/NotifyUser"
|
||||
NotifyService_NotifyUserBatch_FullMethodName = "/proto.NotifyService/NotifyUserBatch"
|
||||
NotifyService_NotifyAllUser_FullMethodName = "/proto.NotifyService/NotifyAllUser"
|
||||
Notifier_NotifyUser_FullMethodName = "/proto.Notifier/NotifyUser"
|
||||
Notifier_NotifyUserBatch_FullMethodName = "/proto.Notifier/NotifyUserBatch"
|
||||
Notifier_NotifyAllUser_FullMethodName = "/proto.Notifier/NotifyAllUser"
|
||||
)
|
||||
|
||||
// NotifyServiceClient is the client API for NotifyService service.
|
||||
// NotifierClient is the client API for Notifier service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type NotifyServiceClient interface {
|
||||
type NotifierClient interface {
|
||||
NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
|
||||
NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
|
||||
NotifyAllUser(ctx context.Context, in *NotifyInfo, opts ...grpc.CallOption) (*NotifyResponse, error)
|
||||
NotifyAllUser(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
|
||||
}
|
||||
|
||||
type notifyServiceClient struct {
|
||||
type notifierClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewNotifyServiceClient(cc grpc.ClientConnInterface) NotifyServiceClient {
|
||||
return ¬ifyServiceClient{cc}
|
||||
func NewNotifierClient(cc grpc.ClientConnInterface) NotifierClient {
|
||||
return ¬ifierClient{cc}
|
||||
}
|
||||
|
||||
func (c *notifyServiceClient) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
func (c *notifierClient) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(NotifyResponse)
|
||||
err := c.cc.Invoke(ctx, NotifyService_NotifyUser_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Notifier_NotifyUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *notifyServiceClient) NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
func (c *notifierClient) NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(NotifyResponse)
|
||||
err := c.cc.Invoke(ctx, NotifyService_NotifyUserBatch_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Notifier_NotifyUserBatch_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *notifyServiceClient) NotifyAllUser(ctx context.Context, in *NotifyInfo, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
func (c *notifierClient) NotifyAllUser(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(NotifyResponse)
|
||||
err := c.cc.Invoke(ctx, NotifyService_NotifyAllUser_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Notifier_NotifyAllUser_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// NotifyServiceServer is the server API for NotifyService service.
|
||||
// All implementations must embed UnimplementedNotifyServiceServer
|
||||
// NotifierServer is the http API for Notifier service.
|
||||
// All implementations must embed UnimplementedNotifierServer
|
||||
// for forward compatibility.
|
||||
type NotifyServiceServer interface {
|
||||
type NotifierServer interface {
|
||||
NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error)
|
||||
NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error)
|
||||
NotifyAllUser(context.Context, *NotifyInfo) (*NotifyResponse, error)
|
||||
mustEmbedUnimplementedNotifyServiceServer()
|
||||
NotifyAllUser(context.Context, *NotifyRequest) (*NotifyResponse, error)
|
||||
mustEmbedUnimplementedNotifierServer()
|
||||
}
|
||||
|
||||
// UnimplementedNotifyServiceServer must be embedded to have
|
||||
// UnimplementedNotifierServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedNotifyServiceServer struct{}
|
||||
type UnimplementedNotifierServer struct{}
|
||||
|
||||
func (UnimplementedNotifyServiceServer) NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error) {
|
||||
func (UnimplementedNotifierServer) NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyUser not implemented")
|
||||
}
|
||||
func (UnimplementedNotifyServiceServer) NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error) {
|
||||
func (UnimplementedNotifierServer) NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyUserBatch not implemented")
|
||||
}
|
||||
func (UnimplementedNotifyServiceServer) NotifyAllUser(context.Context, *NotifyInfo) (*NotifyResponse, error) {
|
||||
func (UnimplementedNotifierServer) NotifyAllUser(context.Context, *NotifyRequest) (*NotifyResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyAllUser not implemented")
|
||||
}
|
||||
func (UnimplementedNotifyServiceServer) mustEmbedUnimplementedNotifyServiceServer() {}
|
||||
func (UnimplementedNotifyServiceServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedNotifierServer) mustEmbedUnimplementedNotifierServer() {}
|
||||
func (UnimplementedNotifierServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeNotifyServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to NotifyServiceServer will
|
||||
// UnsafeNotifierServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to NotifierServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeNotifyServiceServer interface {
|
||||
mustEmbedUnimplementedNotifyServiceServer()
|
||||
type UnsafeNotifierServer interface {
|
||||
mustEmbedUnimplementedNotifierServer()
|
||||
}
|
||||
|
||||
func RegisterNotifyServiceServer(s grpc.ServiceRegistrar, srv NotifyServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedNotifyServiceServer was
|
||||
func RegisterNotifierServer(s grpc.ServiceRegistrar, srv NotifierServer) {
|
||||
// If the following call pancis, it indicates UnimplementedNotifierServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&NotifyService_ServiceDesc, srv)
|
||||
s.RegisterService(&Notifier_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _NotifyService_NotifyUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Notifier_NotifyUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NotifyUserRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NotifyServiceServer).NotifyUser(ctx, in)
|
||||
return srv.(NotifierServer).NotifyUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: NotifyService_NotifyUser_FullMethodName,
|
||||
FullMethod: Notifier_NotifyUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NotifyServiceServer).NotifyUser(ctx, req.(*NotifyUserRequest))
|
||||
return srv.(NotifierServer).NotifyUser(ctx, req.(*NotifyUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _NotifyService_NotifyUserBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Notifier_NotifyUserBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NotifyUserBatchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NotifyServiceServer).NotifyUserBatch(ctx, in)
|
||||
return srv.(NotifierServer).NotifyUserBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: NotifyService_NotifyUserBatch_FullMethodName,
|
||||
FullMethod: Notifier_NotifyUserBatch_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NotifyServiceServer).NotifyUserBatch(ctx, req.(*NotifyUserBatchRequest))
|
||||
return srv.(NotifierServer).NotifyUserBatch(ctx, req.(*NotifyUserBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _NotifyService_NotifyAllUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NotifyInfo)
|
||||
func _Notifier_NotifyAllUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(NotifyRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(NotifyServiceServer).NotifyAllUser(ctx, in)
|
||||
return srv.(NotifierServer).NotifyAllUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: NotifyService_NotifyAllUser_FullMethodName,
|
||||
FullMethod: Notifier_NotifyAllUser_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NotifyServiceServer).NotifyAllUser(ctx, req.(*NotifyInfo))
|
||||
return srv.(NotifierServer).NotifyAllUser(ctx, req.(*NotifyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// NotifyService_ServiceDesc is the grpc.ServiceDesc for NotifyService service.
|
||||
// Notifier_ServiceDesc is the grpc.ServiceDesc for Notifier service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var NotifyService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.NotifyService",
|
||||
HandlerType: (*NotifyServiceServer)(nil),
|
||||
var Notifier_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.Notifier",
|
||||
HandlerType: (*NotifierServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "NotifyUser",
|
||||
Handler: _NotifyService_NotifyUser_Handler,
|
||||
Handler: _Notifier_NotifyUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NotifyUserBatch",
|
||||
Handler: _NotifyService_NotifyUserBatch_Handler,
|
||||
Handler: _Notifier_NotifyUserBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NotifyAllUser",
|
||||
Handler: _NotifyService_NotifyAllUser_Handler,
|
||||
Handler: _Notifier_NotifyAllUser_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
@ -658,43 +658,42 @@ var file_realm_proto_rawDesc = []byte{
|
||||
0x65, 0x61, 0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x12, 0x1d, 0x0a, 0x0a, 0x69, 0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01,
|
||||
0x20, 0x01, 0x28, 0x08, 0x52, 0x09, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32,
|
||||
0xac, 0x04, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
|
||||
0x12, 0x49, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74,
|
||||
0x79, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
|
||||
0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c,
|
||||
0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x12, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x61, 0x6c,
|
||||
0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70,
|
||||
0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61,
|
||||
0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e,
|
||||
0x4c, 0x69, 0x73, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x1d,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65,
|
||||
0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52,
|
||||
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x08, 0x47, 0x65, 0x74,
|
||||
0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f,
|
||||
0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||
0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x49, 0x6e,
|
||||
0x66, 0x6f, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c,
|
||||
0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75,
|
||||
0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x47, 0x65,
|
||||
0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65,
|
||||
0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63, 0x6b,
|
||||
0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x12,
|
||||
0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61,
|
||||
0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d,
|
||||
0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09,
|
||||
0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x33,
|
||||
0xa5, 0x04, 0x0a, 0x05, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x49, 0x0a, 0x12, 0x4c, 0x69, 0x73,
|
||||
0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12,
|
||||
0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c,
|
||||
0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,
|
||||
0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x76, 0x61, 0x69,
|
||||
0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61,
|
||||
0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f,
|
||||
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x77, 0x6e,
|
||||
0x65, 0x64, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
|
||||
0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c,
|
||||
0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x12, 0x39, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x19,
|
||||
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x61,
|
||||
0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x54, 0x0a,
|
||||
0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
|
||||
0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65,
|
||||
0x6d, 0x62, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
|
||||
0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65,
|
||||
0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d,
|
||||
0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65,
|
||||
0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52,
|
||||
0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00,
|
||||
0x12, 0x55, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65,
|
||||
0x6d, 0x62, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||
0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52,
|
||||
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43,
|
||||
0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73,
|
||||
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -725,20 +724,20 @@ var file_realm_proto_goTypes = []any{
|
||||
var file_realm_proto_depIdxs = []int32{
|
||||
0, // 0: proto.ListRealmResponse.data:type_name -> proto.RealmInfo
|
||||
6, // 1: proto.ListRealmMemberResponse.data:type_name -> proto.RealmMemberInfo
|
||||
1, // 2: proto.RealmService.ListCommunityRealm:input_type -> proto.ListRealmRequest
|
||||
2, // 3: proto.RealmService.ListAvailableRealm:input_type -> proto.LookupUserRealmRequest
|
||||
2, // 4: proto.RealmService.ListOwnedRealm:input_type -> proto.LookupUserRealmRequest
|
||||
3, // 5: proto.RealmService.GetRealm:input_type -> proto.LookupRealmRequest
|
||||
5, // 6: proto.RealmService.ListRealmMember:input_type -> proto.RealmMemberLookupRequest
|
||||
5, // 7: proto.RealmService.GetRealmMember:input_type -> proto.RealmMemberLookupRequest
|
||||
8, // 8: proto.RealmService.CheckRealmMemberPerm:input_type -> proto.CheckRealmPermRequest
|
||||
4, // 9: proto.RealmService.ListCommunityRealm:output_type -> proto.ListRealmResponse
|
||||
4, // 10: proto.RealmService.ListAvailableRealm:output_type -> proto.ListRealmResponse
|
||||
4, // 11: proto.RealmService.ListOwnedRealm:output_type -> proto.ListRealmResponse
|
||||
0, // 12: proto.RealmService.GetRealm:output_type -> proto.RealmInfo
|
||||
7, // 13: proto.RealmService.ListRealmMember:output_type -> proto.ListRealmMemberResponse
|
||||
6, // 14: proto.RealmService.GetRealmMember:output_type -> proto.RealmMemberInfo
|
||||
9, // 15: proto.RealmService.CheckRealmMemberPerm:output_type -> proto.CheckRealmPermResponse
|
||||
1, // 2: proto.Realm.ListCommunityRealm:input_type -> proto.ListRealmRequest
|
||||
2, // 3: proto.Realm.ListAvailableRealm:input_type -> proto.LookupUserRealmRequest
|
||||
2, // 4: proto.Realm.ListOwnedRealm:input_type -> proto.LookupUserRealmRequest
|
||||
3, // 5: proto.Realm.GetRealm:input_type -> proto.LookupRealmRequest
|
||||
5, // 6: proto.Realm.ListRealmMember:input_type -> proto.RealmMemberLookupRequest
|
||||
5, // 7: proto.Realm.GetRealmMember:input_type -> proto.RealmMemberLookupRequest
|
||||
8, // 8: proto.Realm.CheckRealmMemberPerm:input_type -> proto.CheckRealmPermRequest
|
||||
4, // 9: proto.Realm.ListCommunityRealm:output_type -> proto.ListRealmResponse
|
||||
4, // 10: proto.Realm.ListAvailableRealm:output_type -> proto.ListRealmResponse
|
||||
4, // 11: proto.Realm.ListOwnedRealm:output_type -> proto.ListRealmResponse
|
||||
0, // 12: proto.Realm.GetRealm:output_type -> proto.RealmInfo
|
||||
7, // 13: proto.Realm.ListRealmMember:output_type -> proto.ListRealmMemberResponse
|
||||
6, // 14: proto.Realm.GetRealmMember:output_type -> proto.RealmMemberInfo
|
||||
9, // 15: proto.Realm.CheckRealmMemberPerm:output_type -> proto.CheckRealmPermResponse
|
||||
9, // [9:16] is the sub-list for method output_type
|
||||
2, // [2:9] is the sub-list for method input_type
|
||||
2, // [2:2] is the sub-list for extension type_name
|
||||
|
@ -4,7 +4,7 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service RealmService {
|
||||
service Realm {
|
||||
rpc ListCommunityRealm(ListRealmRequest) returns (ListRealmResponse) {}
|
||||
rpc ListAvailableRealm(LookupUserRealmRequest) returns (ListRealmResponse) {}
|
||||
rpc ListOwnedRealm(LookupUserRealmRequest) returns (ListRealmResponse) {}
|
||||
|
@ -19,19 +19,19 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
RealmService_ListCommunityRealm_FullMethodName = "/proto.RealmService/ListCommunityRealm"
|
||||
RealmService_ListAvailableRealm_FullMethodName = "/proto.RealmService/ListAvailableRealm"
|
||||
RealmService_ListOwnedRealm_FullMethodName = "/proto.RealmService/ListOwnedRealm"
|
||||
RealmService_GetRealm_FullMethodName = "/proto.RealmService/GetRealm"
|
||||
RealmService_ListRealmMember_FullMethodName = "/proto.RealmService/ListRealmMember"
|
||||
RealmService_GetRealmMember_FullMethodName = "/proto.RealmService/GetRealmMember"
|
||||
RealmService_CheckRealmMemberPerm_FullMethodName = "/proto.RealmService/CheckRealmMemberPerm"
|
||||
Realm_ListCommunityRealm_FullMethodName = "/proto.Realm/ListCommunityRealm"
|
||||
Realm_ListAvailableRealm_FullMethodName = "/proto.Realm/ListAvailableRealm"
|
||||
Realm_ListOwnedRealm_FullMethodName = "/proto.Realm/ListOwnedRealm"
|
||||
Realm_GetRealm_FullMethodName = "/proto.Realm/GetRealm"
|
||||
Realm_ListRealmMember_FullMethodName = "/proto.Realm/ListRealmMember"
|
||||
Realm_GetRealmMember_FullMethodName = "/proto.Realm/GetRealmMember"
|
||||
Realm_CheckRealmMemberPerm_FullMethodName = "/proto.Realm/CheckRealmMemberPerm"
|
||||
)
|
||||
|
||||
// RealmServiceClient is the client API for RealmService service.
|
||||
// RealmClient is the client API for Realm service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type RealmServiceClient interface {
|
||||
type RealmClient interface {
|
||||
ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error)
|
||||
ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error)
|
||||
ListOwnedRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error)
|
||||
@ -41,88 +41,88 @@ type RealmServiceClient interface {
|
||||
CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error)
|
||||
}
|
||||
|
||||
type realmServiceClient struct {
|
||||
type realmClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRealmServiceClient(cc grpc.ClientConnInterface) RealmServiceClient {
|
||||
return &realmServiceClient{cc}
|
||||
func NewRealmClient(cc grpc.ClientConnInterface) RealmClient {
|
||||
return &realmClient{cc}
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
func (c *realmClient) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListRealmResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_ListCommunityRealm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Realm_ListCommunityRealm_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
func (c *realmClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListRealmResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_ListAvailableRealm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Realm_ListAvailableRealm_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) ListOwnedRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
func (c *realmClient) ListOwnedRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListRealmResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_ListOwnedRealm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Realm_ListOwnedRealm_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) {
|
||||
func (c *realmClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RealmInfo)
|
||||
err := c.cc.Invoke(ctx, RealmService_GetRealm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Realm_GetRealm_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error) {
|
||||
func (c *realmClient) ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListRealmMemberResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_ListRealmMember_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Realm_ListRealmMember_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error) {
|
||||
func (c *realmClient) GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RealmMemberInfo)
|
||||
err := c.cc.Invoke(ctx, RealmService_GetRealmMember_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Realm_GetRealmMember_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmServiceClient) CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error) {
|
||||
func (c *realmClient) CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CheckRealmPermResponse)
|
||||
err := c.cc.Invoke(ctx, RealmService_CheckRealmMemberPerm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, Realm_CheckRealmMemberPerm_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RealmServiceServer is the server API for RealmService service.
|
||||
// All implementations must embed UnimplementedRealmServiceServer
|
||||
// RealmServer is the http API for Realm service.
|
||||
// All implementations must embed UnimplementedRealmServer
|
||||
// for forward compatibility.
|
||||
type RealmServiceServer interface {
|
||||
type RealmServer interface {
|
||||
ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error)
|
||||
ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error)
|
||||
ListOwnedRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error)
|
||||
@ -130,218 +130,218 @@ type RealmServiceServer interface {
|
||||
ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error)
|
||||
GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error)
|
||||
CheckRealmMemberPerm(context.Context, *CheckRealmPermRequest) (*CheckRealmPermResponse, error)
|
||||
mustEmbedUnimplementedRealmServiceServer()
|
||||
mustEmbedUnimplementedRealmServer()
|
||||
}
|
||||
|
||||
// UnimplementedRealmServiceServer must be embedded to have
|
||||
// UnimplementedRealmServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedRealmServiceServer struct{}
|
||||
type UnimplementedRealmServer struct{}
|
||||
|
||||
func (UnimplementedRealmServiceServer) ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error) {
|
||||
func (UnimplementedRealmServer) ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListCommunityRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) {
|
||||
func (UnimplementedRealmServer) ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListAvailableRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) ListOwnedRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) {
|
||||
func (UnimplementedRealmServer) ListOwnedRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListOwnedRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) GetRealm(context.Context, *LookupRealmRequest) (*RealmInfo, error) {
|
||||
func (UnimplementedRealmServer) GetRealm(context.Context, *LookupRealmRequest) (*RealmInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error) {
|
||||
func (UnimplementedRealmServer) ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListRealmMember not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error) {
|
||||
func (UnimplementedRealmServer) GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRealmMember not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) CheckRealmMemberPerm(context.Context, *CheckRealmPermRequest) (*CheckRealmPermResponse, error) {
|
||||
func (UnimplementedRealmServer) CheckRealmMemberPerm(context.Context, *CheckRealmPermRequest) (*CheckRealmPermResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CheckRealmMemberPerm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServiceServer) mustEmbedUnimplementedRealmServiceServer() {}
|
||||
func (UnimplementedRealmServiceServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedRealmServer) mustEmbedUnimplementedRealmServer() {}
|
||||
func (UnimplementedRealmServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeRealmServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RealmServiceServer will
|
||||
// UnsafeRealmServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to RealmServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeRealmServiceServer interface {
|
||||
mustEmbedUnimplementedRealmServiceServer()
|
||||
type UnsafeRealmServer interface {
|
||||
mustEmbedUnimplementedRealmServer()
|
||||
}
|
||||
|
||||
func RegisterRealmServiceServer(s grpc.ServiceRegistrar, srv RealmServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRealmServiceServer was
|
||||
func RegisterRealmServer(s grpc.ServiceRegistrar, srv RealmServer) {
|
||||
// If the following call pancis, it indicates UnimplementedRealmServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&RealmService_ServiceDesc, srv)
|
||||
s.RegisterService(&Realm_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _RealmService_ListCommunityRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Realm_ListCommunityRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(ListRealmRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).ListCommunityRealm(ctx, in)
|
||||
return srv.(RealmServer).ListCommunityRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_ListCommunityRealm_FullMethodName,
|
||||
FullMethod: Realm_ListCommunityRealm_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).ListCommunityRealm(ctx, req.(*ListRealmRequest))
|
||||
return srv.(RealmServer).ListCommunityRealm(ctx, req.(*ListRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_ListAvailableRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Realm_ListAvailableRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LookupUserRealmRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).ListAvailableRealm(ctx, in)
|
||||
return srv.(RealmServer).ListAvailableRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_ListAvailableRealm_FullMethodName,
|
||||
FullMethod: Realm_ListAvailableRealm_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).ListAvailableRealm(ctx, req.(*LookupUserRealmRequest))
|
||||
return srv.(RealmServer).ListAvailableRealm(ctx, req.(*LookupUserRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_ListOwnedRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Realm_ListOwnedRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LookupUserRealmRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).ListOwnedRealm(ctx, in)
|
||||
return srv.(RealmServer).ListOwnedRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_ListOwnedRealm_FullMethodName,
|
||||
FullMethod: Realm_ListOwnedRealm_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).ListOwnedRealm(ctx, req.(*LookupUserRealmRequest))
|
||||
return srv.(RealmServer).ListOwnedRealm(ctx, req.(*LookupUserRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_GetRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Realm_GetRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(LookupRealmRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).GetRealm(ctx, in)
|
||||
return srv.(RealmServer).GetRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_GetRealm_FullMethodName,
|
||||
FullMethod: Realm_GetRealm_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).GetRealm(ctx, req.(*LookupRealmRequest))
|
||||
return srv.(RealmServer).GetRealm(ctx, req.(*LookupRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_ListRealmMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Realm_ListRealmMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RealmMemberLookupRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).ListRealmMember(ctx, in)
|
||||
return srv.(RealmServer).ListRealmMember(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_ListRealmMember_FullMethodName,
|
||||
FullMethod: Realm_ListRealmMember_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).ListRealmMember(ctx, req.(*RealmMemberLookupRequest))
|
||||
return srv.(RealmServer).ListRealmMember(ctx, req.(*RealmMemberLookupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_GetRealmMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Realm_GetRealmMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RealmMemberLookupRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).GetRealmMember(ctx, in)
|
||||
return srv.(RealmServer).GetRealmMember(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_GetRealmMember_FullMethodName,
|
||||
FullMethod: Realm_GetRealmMember_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).GetRealmMember(ctx, req.(*RealmMemberLookupRequest))
|
||||
return srv.(RealmServer).GetRealmMember(ctx, req.(*RealmMemberLookupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _RealmService_CheckRealmMemberPerm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _Realm_CheckRealmMemberPerm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(CheckRealmPermRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(RealmServiceServer).CheckRealmMemberPerm(ctx, in)
|
||||
return srv.(RealmServer).CheckRealmMemberPerm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: RealmService_CheckRealmMemberPerm_FullMethodName,
|
||||
FullMethod: Realm_CheckRealmMemberPerm_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServiceServer).CheckRealmMemberPerm(ctx, req.(*CheckRealmPermRequest))
|
||||
return srv.(RealmServer).CheckRealmMemberPerm(ctx, req.(*CheckRealmPermRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// RealmService_ServiceDesc is the grpc.ServiceDesc for RealmService service.
|
||||
// Realm_ServiceDesc is the grpc.ServiceDesc for Realm service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var RealmService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.RealmService",
|
||||
HandlerType: (*RealmServiceServer)(nil),
|
||||
var Realm_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.Realm",
|
||||
HandlerType: (*RealmServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListCommunityRealm",
|
||||
Handler: _RealmService_ListCommunityRealm_Handler,
|
||||
Handler: _Realm_ListCommunityRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListAvailableRealm",
|
||||
Handler: _RealmService_ListAvailableRealm_Handler,
|
||||
Handler: _Realm_ListAvailableRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListOwnedRealm",
|
||||
Handler: _RealmService_ListOwnedRealm_Handler,
|
||||
Handler: _Realm_ListOwnedRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRealm",
|
||||
Handler: _RealmService_GetRealm_Handler,
|
||||
Handler: _Realm_GetRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListRealmMember",
|
||||
Handler: _RealmService_ListRealmMember_Handler,
|
||||
Handler: _Realm_ListRealmMember_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRealmMember",
|
||||
Handler: _RealmService_GetRealmMember_Handler,
|
||||
Handler: _Realm_GetRealmMember_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CheckRealmMemberPerm",
|
||||
Handler: _RealmService_CheckRealmMemberPerm_Handler,
|
||||
Handler: _Realm_CheckRealmMemberPerm_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
@ -158,14 +158,14 @@ var file_record_proto_rawDesc = []byte{
|
||||
0x67, 0x65, 0x6e, 0x74, 0x22, 0x34, 0x0a, 0x13, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76,
|
||||
0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x69,
|
||||
0x73, 0x5f, 0x73, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52,
|
||||
0x09, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0x56, 0x0a, 0x0c, 0x41, 0x75,
|
||||
0x64, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x52, 0x65,
|
||||
0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74,
|
||||
0x6f, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
|
||||
0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63,
|
||||
0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||
0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70,
|
||||
0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
0x09, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0x57, 0x0a, 0x0d, 0x45, 0x76,
|
||||
0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x0b, 0x52,
|
||||
0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f,
|
||||
0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65,
|
||||
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65,
|
||||
0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,
|
||||
0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06,
|
||||
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -186,8 +186,8 @@ var file_record_proto_goTypes = []any{
|
||||
(*RecordEventResponse)(nil), // 1: proto.RecordEventResponse
|
||||
}
|
||||
var file_record_proto_depIdxs = []int32{
|
||||
0, // 0: proto.AuditService.RecordEvent:input_type -> proto.RecordEventRequest
|
||||
1, // 1: proto.AuditService.RecordEvent:output_type -> proto.RecordEventResponse
|
||||
0, // 0: proto.EventRecorder.RecordEvent:input_type -> proto.RecordEventRequest
|
||||
1, // 1: proto.EventRecorder.RecordEvent:output_type -> proto.RecordEventResponse
|
||||
1, // [1:2] is the sub-list for method output_type
|
||||
0, // [0:1] is the sub-list for method input_type
|
||||
0, // [0:0] is the sub-list for extension type_name
|
||||
|
@ -4,18 +4,18 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service AuditService {
|
||||
rpc RecordEvent(RecordEventRequest) returns (RecordEventResponse) {}
|
||||
service EventRecorder {
|
||||
rpc RecordEvent(RecordEventRequest) returns (RecordEventResponse) {}
|
||||
}
|
||||
|
||||
message RecordEventRequest {
|
||||
uint64 user_id = 1;
|
||||
string action = 2;
|
||||
string target = 3;
|
||||
string ip = 4;
|
||||
string user_agent = 5;
|
||||
uint64 user_id = 1;
|
||||
string action = 2;
|
||||
string target = 3;
|
||||
string ip = 4;
|
||||
string user_agent = 5;
|
||||
}
|
||||
|
||||
message RecordEventResponse {
|
||||
bool is_success = 1;
|
||||
bool is_success = 1;
|
||||
}
|
||||
|
@ -19,101 +19,101 @@ import (
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
|
||||
const (
|
||||
AuditService_RecordEvent_FullMethodName = "/proto.AuditService/RecordEvent"
|
||||
EventRecorder_RecordEvent_FullMethodName = "/proto.EventRecorder/RecordEvent"
|
||||
)
|
||||
|
||||
// AuditServiceClient is the client API for AuditService service.
|
||||
// EventRecorderClient is the client API for EventRecorder service.
|
||||
//
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type AuditServiceClient interface {
|
||||
type EventRecorderClient interface {
|
||||
RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error)
|
||||
}
|
||||
|
||||
type auditServiceClient struct {
|
||||
type eventRecorderClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewAuditServiceClient(cc grpc.ClientConnInterface) AuditServiceClient {
|
||||
return &auditServiceClient{cc}
|
||||
func NewEventRecorderClient(cc grpc.ClientConnInterface) EventRecorderClient {
|
||||
return &eventRecorderClient{cc}
|
||||
}
|
||||
|
||||
func (c *auditServiceClient) RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error) {
|
||||
func (c *eventRecorderClient) RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(RecordEventResponse)
|
||||
err := c.cc.Invoke(ctx, AuditService_RecordEvent_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, EventRecorder_RecordEvent_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// AuditServiceServer is the server API for AuditService service.
|
||||
// All implementations must embed UnimplementedAuditServiceServer
|
||||
// EventRecorderServer is the http API for EventRecorder service.
|
||||
// All implementations must embed UnimplementedEventRecorderServer
|
||||
// for forward compatibility.
|
||||
type AuditServiceServer interface {
|
||||
type EventRecorderServer interface {
|
||||
RecordEvent(context.Context, *RecordEventRequest) (*RecordEventResponse, error)
|
||||
mustEmbedUnimplementedAuditServiceServer()
|
||||
mustEmbedUnimplementedEventRecorderServer()
|
||||
}
|
||||
|
||||
// UnimplementedAuditServiceServer must be embedded to have
|
||||
// UnimplementedEventRecorderServer must be embedded to have
|
||||
// forward compatible implementations.
|
||||
//
|
||||
// NOTE: this should be embedded by value instead of pointer to avoid a nil
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAuditServiceServer struct{}
|
||||
type UnimplementedEventRecorderServer struct{}
|
||||
|
||||
func (UnimplementedAuditServiceServer) RecordEvent(context.Context, *RecordEventRequest) (*RecordEventResponse, error) {
|
||||
func (UnimplementedEventRecorderServer) RecordEvent(context.Context, *RecordEventRequest) (*RecordEventResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RecordEvent not implemented")
|
||||
}
|
||||
func (UnimplementedAuditServiceServer) mustEmbedUnimplementedAuditServiceServer() {}
|
||||
func (UnimplementedAuditServiceServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedEventRecorderServer) mustEmbedUnimplementedEventRecorderServer() {}
|
||||
func (UnimplementedEventRecorderServer) testEmbeddedByValue() {}
|
||||
|
||||
// UnsafeAuditServiceServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to AuditServiceServer will
|
||||
// UnsafeEventRecorderServer may be embedded to opt out of forward compatibility for this service.
|
||||
// Use of this interface is not recommended, as added methods to EventRecorderServer will
|
||||
// result in compilation errors.
|
||||
type UnsafeAuditServiceServer interface {
|
||||
mustEmbedUnimplementedAuditServiceServer()
|
||||
type UnsafeEventRecorderServer interface {
|
||||
mustEmbedUnimplementedEventRecorderServer()
|
||||
}
|
||||
|
||||
func RegisterAuditServiceServer(s grpc.ServiceRegistrar, srv AuditServiceServer) {
|
||||
// If the following call pancis, it indicates UnimplementedAuditServiceServer was
|
||||
func RegisterEventRecorderServer(s grpc.ServiceRegistrar, srv EventRecorderServer) {
|
||||
// If the following call pancis, it indicates UnimplementedEventRecorderServer was
|
||||
// embedded by pointer and is nil. This will cause panics if an
|
||||
// unimplemented method is ever invoked, so we test this at initialization
|
||||
// time to prevent it from happening at runtime later due to I/O.
|
||||
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
|
||||
t.testEmbeddedByValue()
|
||||
}
|
||||
s.RegisterService(&AuditService_ServiceDesc, srv)
|
||||
s.RegisterService(&EventRecorder_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _AuditService_RecordEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _EventRecorder_RecordEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(RecordEventRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(AuditServiceServer).RecordEvent(ctx, in)
|
||||
return srv.(EventRecorderServer).RecordEvent(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: AuditService_RecordEvent_FullMethodName,
|
||||
FullMethod: EventRecorder_RecordEvent_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AuditServiceServer).RecordEvent(ctx, req.(*RecordEventRequest))
|
||||
return srv.(EventRecorderServer).RecordEvent(ctx, req.(*RecordEventRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// AuditService_ServiceDesc is the grpc.ServiceDesc for AuditService service.
|
||||
// EventRecorder_ServiceDesc is the grpc.ServiceDesc for EventRecorder service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var AuditService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.AuditService",
|
||||
HandlerType: (*AuditServiceServer)(nil),
|
||||
var EventRecorder_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.EventRecorder",
|
||||
HandlerType: (*EventRecorderServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "RecordEvent",
|
||||
Handler: _AuditService_RecordEvent_Handler,
|
||||
Handler: _EventRecorder_RecordEvent_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
Loading…
x
Reference in New Issue
Block a user