✨ Support users related rpc calls
This commit is contained in:
parent
8ff2648e4c
commit
8326c716e3
74
.idea/workspace.xml
generated
74
.idea/workspace.xml
generated
@ -4,7 +4,25 @@
|
||||
<option name="autoReloadType" value="ALL" />
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<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" />
|
||||
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":truck: Update package name from Hypdrogen to Hypernet">
|
||||
<change afterPath="$PROJECT_DIR$/pkg/internal/grpc/user.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/go.mod" beforeDir="false" afterPath="$PROJECT_DIR$/go.mod" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/go.sum" beforeDir="false" afterPath="$PROJECT_DIR$/go.sum" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/authkit/models/accounts.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/authkit/models/accounts.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/internal/grpc/auth.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/auth.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/internal/grpc/notifier.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/notify.go" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/pkg/internal/grpc/server.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/server.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.proto" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/realm.proto" 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.proto" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/proto/record.proto" 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>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
@ -38,34 +56,34 @@
|
||||
<option name="hideEmptyMiddlePackages" value="true" />
|
||||
<option name="showLibraryContents" value="true" />
|
||||
</component>
|
||||
<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"
|
||||
<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"
|
||||
},
|
||||
"keyToStringList": {
|
||||
"DatabaseDriversLRU": [
|
||||
"postgresql"
|
||||
"keyToStringList": {
|
||||
"DatabaseDriversLRU": [
|
||||
"postgresql"
|
||||
]
|
||||
}
|
||||
}]]></component>
|
||||
}</component>
|
||||
<component name="RecentsManager">
|
||||
<key name="CopyFile.RECENT_KEYS">
|
||||
<recent name="$PROJECT_DIR$/keys" />
|
||||
@ -151,7 +169,6 @@
|
||||
</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" />
|
||||
@ -176,7 +193,8 @@
|
||||
<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" />
|
||||
<option name="LAST_COMMIT_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" />
|
||||
<option name="LAST_COMMIT_MESSAGE" value=":truck: Update package name from Hypdrogen to Hypernet" />
|
||||
<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-20241030155904-3f6ea11d2297
|
||||
git.solsynth.dev/hypernet/nexus v0.0.0-20241031125727-aa624ee45428
|
||||
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,6 +35,8 @@ 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=
|
||||
|
@ -2,6 +2,8 @@ package models
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/nex"
|
||||
"git.solsynth.dev/hypernet/nexus/pkg/proto"
|
||||
"gorm.io/datatypes"
|
||||
"time"
|
||||
|
||||
@ -58,6 +60,15 @@ 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 (
|
||||
|
@ -5,19 +5,12 @@ 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 {
|
||||
@ -81,55 +74,3 @@ 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
|
||||
}
|
||||
|
@ -16,9 +16,10 @@ import (
|
||||
type App struct {
|
||||
nroto.UnimplementedAuthServiceServer
|
||||
nroto.UnimplementedDirectoryServiceServer
|
||||
proto.UnimplementedNotifierServer
|
||||
proto.UnimplementedRealmServer
|
||||
proto.UnimplementedEventRecorderServer
|
||||
nroto.UnimplementedUserServiceServer
|
||||
proto.UnimplementedRealmServiceServer
|
||||
proto.UnimplementedAuditServiceServer
|
||||
proto.UnimplementedNotifyServiceServer
|
||||
health.UnimplementedHealthServer
|
||||
|
||||
srv *grpc.Server
|
||||
@ -30,9 +31,10 @@ func NewServer() *App {
|
||||
}
|
||||
|
||||
nroto.RegisterAuthServiceServer(server.srv, server)
|
||||
proto.RegisterNotifierServer(server.srv, server)
|
||||
proto.RegisterRealmServer(server.srv, server)
|
||||
proto.RegisterEventRecorderServer(server.srv, server)
|
||||
nroto.RegisterUserServiceServer(server.srv, server)
|
||||
proto.RegisterNotifyServiceServer(server.srv, server)
|
||||
proto.RegisterRealmServiceServer(server.srv, server)
|
||||
proto.RegisterAuditServiceServer(server.srv, server)
|
||||
health.RegisterHealthServer(server.srv, server)
|
||||
|
||||
reflection.Register(server.srv)
|
||||
|
66
pkg/internal/grpc/user.go
Normal file
66
pkg/internal/grpc/user.go
Normal file
@ -0,0 +1,66 @@
|
||||
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
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.35.1
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v5.28.2
|
||||
// source: notify.proto
|
||||
|
||||
@ -31,9 +31,11 @@ type NotifyUserRequest struct {
|
||||
|
||||
func (x *NotifyUserRequest) Reset() {
|
||||
*x = NotifyUserRequest{}
|
||||
mi := &file_notify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_notify_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NotifyUserRequest) String() string {
|
||||
@ -44,7 +46,7 @@ func (*NotifyUserRequest) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyUserRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_notify_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -84,9 +86,11 @@ type NotifyUserBatchRequest struct {
|
||||
|
||||
func (x *NotifyUserBatchRequest) Reset() {
|
||||
*x = NotifyUserBatchRequest{}
|
||||
mi := &file_notify_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_notify_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NotifyUserBatchRequest) String() string {
|
||||
@ -97,7 +101,7 @@ func (*NotifyUserBatchRequest) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyUserBatchRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_notify_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -142,9 +146,11 @@ type NotifyRequest struct {
|
||||
|
||||
func (x *NotifyRequest) Reset() {
|
||||
*x = NotifyRequest{}
|
||||
mi := &file_notify_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_notify_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NotifyRequest) String() string {
|
||||
@ -155,7 +161,7 @@ func (*NotifyRequest) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_notify_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -230,9 +236,11 @@ type NotifyResponse struct {
|
||||
|
||||
func (x *NotifyResponse) Reset() {
|
||||
*x = NotifyResponse{}
|
||||
mi := &file_notify_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_notify_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *NotifyResponse) String() string {
|
||||
@ -243,7 +251,7 @@ func (*NotifyResponse) ProtoMessage() {}
|
||||
|
||||
func (x *NotifyResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_notify_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -307,21 +315,22 @@ var file_notify_proto_rawDesc = []byte{
|
||||
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,
|
||||
0x75, 0x6e, 0x74, 0x32, 0xdb, 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, 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, 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,
|
||||
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 (
|
||||
@ -337,7 +346,7 @@ func file_notify_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_notify_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
|
||||
var file_notify_proto_goTypes = []any{
|
||||
var file_notify_proto_goTypes = []interface{}{
|
||||
(*NotifyUserRequest)(nil), // 0: proto.NotifyUserRequest
|
||||
(*NotifyUserBatchRequest)(nil), // 1: proto.NotifyUserBatchRequest
|
||||
(*NotifyRequest)(nil), // 2: proto.NotifyRequest
|
||||
@ -346,12 +355,12 @@ var file_notify_proto_goTypes = []any{
|
||||
var file_notify_proto_depIdxs = []int32{
|
||||
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
|
||||
0, // 2: proto.NotifyService.NotifyUser:input_type -> proto.NotifyUserRequest
|
||||
1, // 3: proto.NotifyService.NotifyUserBatch:input_type -> proto.NotifyUserBatchRequest
|
||||
2, // 4: proto.NotifyService.NotifyAllUser:input_type -> proto.NotifyRequest
|
||||
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
|
||||
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
|
||||
@ -364,7 +373,57 @@ func file_notify_proto_init() {
|
||||
if File_notify_proto != nil {
|
||||
return
|
||||
}
|
||||
file_notify_proto_msgTypes[2].OneofWrappers = []any{}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_notify_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NotifyUserRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_notify_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NotifyUserBatchRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_notify_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NotifyRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_notify_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*NotifyResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_notify_proto_msgTypes[2].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
@ -4,7 +4,7 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service Notifier {
|
||||
service NotifyService {
|
||||
rpc NotifyUser(NotifyUserRequest) returns (NotifyResponse) {}
|
||||
rpc NotifyUserBatch(NotifyUserBatchRequest) returns (NotifyResponse) {}
|
||||
rpc NotifyAllUser(NotifyRequest) returns(NotifyResponse) {}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v5.28.2
|
||||
// source: notify.proto
|
||||
|
||||
@ -15,181 +15,161 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
Notifier_NotifyUser_FullMethodName = "/proto.Notifier/NotifyUser"
|
||||
Notifier_NotifyUserBatch_FullMethodName = "/proto.Notifier/NotifyUserBatch"
|
||||
Notifier_NotifyAllUser_FullMethodName = "/proto.Notifier/NotifyAllUser"
|
||||
)
|
||||
|
||||
// NotifierClient is the client API for Notifier service.
|
||||
// NotifyServiceClient is the client API for NotifyService 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 NotifierClient interface {
|
||||
type NotifyServiceClient 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 *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
|
||||
}
|
||||
|
||||
type notifierClient struct {
|
||||
type notifyServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewNotifierClient(cc grpc.ClientConnInterface) NotifierClient {
|
||||
return ¬ifierClient{cc}
|
||||
func NewNotifyServiceClient(cc grpc.ClientConnInterface) NotifyServiceClient {
|
||||
return ¬ifyServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *notifierClient) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *notifyServiceClient) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
out := new(NotifyResponse)
|
||||
err := c.cc.Invoke(ctx, Notifier_NotifyUser_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.NotifyService/NotifyUser", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *notifierClient) NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *notifyServiceClient) NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
out := new(NotifyResponse)
|
||||
err := c.cc.Invoke(ctx, Notifier_NotifyUserBatch_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.NotifyService/NotifyUserBatch", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *notifierClient) NotifyAllUser(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *notifyServiceClient) NotifyAllUser(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
|
||||
out := new(NotifyResponse)
|
||||
err := c.cc.Invoke(ctx, Notifier_NotifyAllUser_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.NotifyService/NotifyAllUser", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// NotifierServer is the http API for Notifier service.
|
||||
// All implementations must embed UnimplementedNotifierServer
|
||||
// for forward compatibility.
|
||||
type NotifierServer interface {
|
||||
// NotifyServiceServer is the server API for NotifyService service.
|
||||
// All implementations must embed UnimplementedNotifyServiceServer
|
||||
// for forward compatibility
|
||||
type NotifyServiceServer interface {
|
||||
NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error)
|
||||
NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error)
|
||||
NotifyAllUser(context.Context, *NotifyRequest) (*NotifyResponse, error)
|
||||
mustEmbedUnimplementedNotifierServer()
|
||||
mustEmbedUnimplementedNotifyServiceServer()
|
||||
}
|
||||
|
||||
// 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 UnimplementedNotifierServer struct{}
|
||||
// UnimplementedNotifyServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedNotifyServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedNotifierServer) NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error) {
|
||||
func (UnimplementedNotifyServiceServer) NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyUser not implemented")
|
||||
}
|
||||
func (UnimplementedNotifierServer) NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error) {
|
||||
func (UnimplementedNotifyServiceServer) NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyUserBatch not implemented")
|
||||
}
|
||||
func (UnimplementedNotifierServer) NotifyAllUser(context.Context, *NotifyRequest) (*NotifyResponse, error) {
|
||||
func (UnimplementedNotifyServiceServer) NotifyAllUser(context.Context, *NotifyRequest) (*NotifyResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method NotifyAllUser not implemented")
|
||||
}
|
||||
func (UnimplementedNotifierServer) mustEmbedUnimplementedNotifierServer() {}
|
||||
func (UnimplementedNotifierServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedNotifyServiceServer) mustEmbedUnimplementedNotifyServiceServer() {}
|
||||
|
||||
// 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
|
||||
// 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
|
||||
// result in compilation errors.
|
||||
type UnsafeNotifierServer interface {
|
||||
mustEmbedUnimplementedNotifierServer()
|
||||
type UnsafeNotifyServiceServer interface {
|
||||
mustEmbedUnimplementedNotifyServiceServer()
|
||||
}
|
||||
|
||||
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(&Notifier_ServiceDesc, srv)
|
||||
func RegisterNotifyServiceServer(s grpc.ServiceRegistrar, srv NotifyServiceServer) {
|
||||
s.RegisterService(&NotifyService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Notifier_NotifyUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _NotifyService_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.(NotifierServer).NotifyUser(ctx, in)
|
||||
return srv.(NotifyServiceServer).NotifyUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Notifier_NotifyUser_FullMethodName,
|
||||
FullMethod: "/proto.NotifyService/NotifyUser",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NotifierServer).NotifyUser(ctx, req.(*NotifyUserRequest))
|
||||
return srv.(NotifyServiceServer).NotifyUser(ctx, req.(*NotifyUserRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Notifier_NotifyUserBatch_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _NotifyService_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.(NotifierServer).NotifyUserBatch(ctx, in)
|
||||
return srv.(NotifyServiceServer).NotifyUserBatch(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Notifier_NotifyUserBatch_FullMethodName,
|
||||
FullMethod: "/proto.NotifyService/NotifyUserBatch",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NotifierServer).NotifyUserBatch(ctx, req.(*NotifyUserBatchRequest))
|
||||
return srv.(NotifyServiceServer).NotifyUserBatch(ctx, req.(*NotifyUserBatchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Notifier_NotifyAllUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _NotifyService_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.(NotifierServer).NotifyAllUser(ctx, in)
|
||||
return srv.(NotifyServiceServer).NotifyAllUser(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Notifier_NotifyAllUser_FullMethodName,
|
||||
FullMethod: "/proto.NotifyService/NotifyAllUser",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NotifierServer).NotifyAllUser(ctx, req.(*NotifyRequest))
|
||||
return srv.(NotifyServiceServer).NotifyAllUser(ctx, req.(*NotifyRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Notifier_ServiceDesc is the grpc.ServiceDesc for Notifier service.
|
||||
// NotifyService_ServiceDesc is the grpc.ServiceDesc for NotifyService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Notifier_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.Notifier",
|
||||
HandlerType: (*NotifierServer)(nil),
|
||||
var NotifyService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.NotifyService",
|
||||
HandlerType: (*NotifyServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "NotifyUser",
|
||||
Handler: _Notifier_NotifyUser_Handler,
|
||||
Handler: _NotifyService_NotifyUser_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NotifyUserBatch",
|
||||
Handler: _Notifier_NotifyUserBatch_Handler,
|
||||
Handler: _NotifyService_NotifyUserBatch_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "NotifyAllUser",
|
||||
Handler: _Notifier_NotifyAllUser_Handler,
|
||||
Handler: _NotifyService_NotifyAllUser_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.35.1
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v5.28.2
|
||||
// source: realm.proto
|
||||
|
||||
@ -38,9 +38,11 @@ type RealmInfo struct {
|
||||
|
||||
func (x *RealmInfo) Reset() {
|
||||
*x = RealmInfo{}
|
||||
mi := &file_realm_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RealmInfo) String() string {
|
||||
@ -51,7 +53,7 @@ func (*RealmInfo) ProtoMessage() {}
|
||||
|
||||
func (x *RealmInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -137,9 +139,11 @@ type ListRealmRequest struct {
|
||||
|
||||
func (x *ListRealmRequest) Reset() {
|
||||
*x = ListRealmRequest{}
|
||||
mi := &file_realm_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListRealmRequest) String() string {
|
||||
@ -150,7 +154,7 @@ func (*ListRealmRequest) ProtoMessage() {}
|
||||
|
||||
func (x *ListRealmRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -175,9 +179,11 @@ type LookupUserRealmRequest struct {
|
||||
|
||||
func (x *LookupUserRealmRequest) Reset() {
|
||||
*x = LookupUserRealmRequest{}
|
||||
mi := &file_realm_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[2]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LookupUserRealmRequest) String() string {
|
||||
@ -188,7 +194,7 @@ func (*LookupUserRealmRequest) ProtoMessage() {}
|
||||
|
||||
func (x *LookupUserRealmRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[2]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -223,9 +229,11 @@ type LookupRealmRequest struct {
|
||||
|
||||
func (x *LookupRealmRequest) Reset() {
|
||||
*x = LookupRealmRequest{}
|
||||
mi := &file_realm_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[3]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *LookupRealmRequest) String() string {
|
||||
@ -236,7 +244,7 @@ func (*LookupRealmRequest) ProtoMessage() {}
|
||||
|
||||
func (x *LookupRealmRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[3]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -289,9 +297,11 @@ type ListRealmResponse struct {
|
||||
|
||||
func (x *ListRealmResponse) Reset() {
|
||||
*x = ListRealmResponse{}
|
||||
mi := &file_realm_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[4]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListRealmResponse) String() string {
|
||||
@ -302,7 +312,7 @@ func (*ListRealmResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListRealmResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[4]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -335,9 +345,11 @@ type RealmMemberLookupRequest struct {
|
||||
|
||||
func (x *RealmMemberLookupRequest) Reset() {
|
||||
*x = RealmMemberLookupRequest{}
|
||||
mi := &file_realm_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[5]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RealmMemberLookupRequest) String() string {
|
||||
@ -348,7 +360,7 @@ func (*RealmMemberLookupRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RealmMemberLookupRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[5]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -389,9 +401,11 @@ type RealmMemberInfo struct {
|
||||
|
||||
func (x *RealmMemberInfo) Reset() {
|
||||
*x = RealmMemberInfo{}
|
||||
mi := &file_realm_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[6]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RealmMemberInfo) String() string {
|
||||
@ -402,7 +416,7 @@ func (*RealmMemberInfo) ProtoMessage() {}
|
||||
|
||||
func (x *RealmMemberInfo) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[6]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -448,9 +462,11 @@ type ListRealmMemberResponse struct {
|
||||
|
||||
func (x *ListRealmMemberResponse) Reset() {
|
||||
*x = ListRealmMemberResponse{}
|
||||
mi := &file_realm_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[7]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *ListRealmMemberResponse) String() string {
|
||||
@ -461,7 +477,7 @@ func (*ListRealmMemberResponse) ProtoMessage() {}
|
||||
|
||||
func (x *ListRealmMemberResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[7]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -495,9 +511,11 @@ type CheckRealmPermRequest struct {
|
||||
|
||||
func (x *CheckRealmPermRequest) Reset() {
|
||||
*x = CheckRealmPermRequest{}
|
||||
mi := &file_realm_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[8]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CheckRealmPermRequest) String() string {
|
||||
@ -508,7 +526,7 @@ func (*CheckRealmPermRequest) ProtoMessage() {}
|
||||
|
||||
func (x *CheckRealmPermRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[8]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -554,9 +572,11 @@ type CheckRealmPermResponse struct {
|
||||
|
||||
func (x *CheckRealmPermResponse) Reset() {
|
||||
*x = CheckRealmPermResponse{}
|
||||
mi := &file_realm_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_realm_proto_msgTypes[9]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *CheckRealmPermResponse) String() string {
|
||||
@ -567,7 +587,7 @@ func (*CheckRealmPermResponse) ProtoMessage() {}
|
||||
|
||||
func (x *CheckRealmPermResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_realm_proto_msgTypes[9]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -658,42 +678,43 @@ 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,
|
||||
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,
|
||||
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,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -709,7 +730,7 @@ func file_realm_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_realm_proto_msgTypes = make([]protoimpl.MessageInfo, 10)
|
||||
var file_realm_proto_goTypes = []any{
|
||||
var file_realm_proto_goTypes = []interface{}{
|
||||
(*RealmInfo)(nil), // 0: proto.RealmInfo
|
||||
(*ListRealmRequest)(nil), // 1: proto.ListRealmRequest
|
||||
(*LookupUserRealmRequest)(nil), // 2: proto.LookupUserRealmRequest
|
||||
@ -724,20 +745,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.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
|
||||
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
|
||||
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
|
||||
@ -750,8 +771,130 @@ func file_realm_proto_init() {
|
||||
if File_realm_proto != nil {
|
||||
return
|
||||
}
|
||||
file_realm_proto_msgTypes[3].OneofWrappers = []any{}
|
||||
file_realm_proto_msgTypes[5].OneofWrappers = []any{}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_realm_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RealmInfo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListRealmRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LookupUserRealmRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*LookupRealmRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListRealmResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RealmMemberLookupRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RealmMemberInfo); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*ListRealmMemberResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CheckRealmPermRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*CheckRealmPermResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
file_realm_proto_msgTypes[3].OneofWrappers = []interface{}{}
|
||||
file_realm_proto_msgTypes[5].OneofWrappers = []interface{}{}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
@ -4,7 +4,7 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service Realm {
|
||||
service RealmService {
|
||||
rpc ListCommunityRealm(ListRealmRequest) returns (ListRealmResponse) {}
|
||||
rpc ListAvailableRealm(LookupUserRealmRequest) returns (ListRealmResponse) {}
|
||||
rpc ListOwnedRealm(LookupUserRealmRequest) returns (ListRealmResponse) {}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v5.28.2
|
||||
// source: realm.proto
|
||||
|
||||
@ -15,23 +15,13 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
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"
|
||||
)
|
||||
|
||||
// RealmClient is the client API for Realm service.
|
||||
// RealmServiceClient is the client API for RealmService 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 RealmClient interface {
|
||||
type RealmServiceClient 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 +31,81 @@ type RealmClient interface {
|
||||
CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error)
|
||||
}
|
||||
|
||||
type realmClient struct {
|
||||
type realmServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewRealmClient(cc grpc.ClientConnInterface) RealmClient {
|
||||
return &realmClient{cc}
|
||||
func NewRealmServiceClient(cc grpc.ClientConnInterface) RealmServiceClient {
|
||||
return &realmServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *realmClient) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *realmServiceClient) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
out := new(ListRealmResponse)
|
||||
err := c.cc.Invoke(ctx, Realm_ListCommunityRealm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.RealmService/ListCommunityRealm", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *realmServiceClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
out := new(ListRealmResponse)
|
||||
err := c.cc.Invoke(ctx, Realm_ListAvailableRealm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.RealmService/ListAvailableRealm", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmClient) ListOwnedRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *realmServiceClient) ListOwnedRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
|
||||
out := new(ListRealmResponse)
|
||||
err := c.cc.Invoke(ctx, Realm_ListOwnedRealm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.RealmService/ListOwnedRealm", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *realmServiceClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) {
|
||||
out := new(RealmInfo)
|
||||
err := c.cc.Invoke(ctx, Realm_GetRealm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.RealmService/GetRealm", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmClient) ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *realmServiceClient) ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error) {
|
||||
out := new(ListRealmMemberResponse)
|
||||
err := c.cc.Invoke(ctx, Realm_ListRealmMember_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.RealmService/ListRealmMember", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmClient) GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *realmServiceClient) GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error) {
|
||||
out := new(RealmMemberInfo)
|
||||
err := c.cc.Invoke(ctx, Realm_GetRealmMember_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.RealmService/GetRealmMember", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *realmClient) CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *realmServiceClient) CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error) {
|
||||
out := new(CheckRealmPermResponse)
|
||||
err := c.cc.Invoke(ctx, Realm_CheckRealmMemberPerm_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.RealmService/CheckRealmMemberPerm", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// RealmServer is the http API for Realm service.
|
||||
// All implementations must embed UnimplementedRealmServer
|
||||
// for forward compatibility.
|
||||
type RealmServer interface {
|
||||
// RealmServiceServer is the server API for RealmService service.
|
||||
// All implementations must embed UnimplementedRealmServiceServer
|
||||
// for forward compatibility
|
||||
type RealmServiceServer interface {
|
||||
ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error)
|
||||
ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error)
|
||||
ListOwnedRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error)
|
||||
@ -130,218 +113,207 @@ type RealmServer interface {
|
||||
ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error)
|
||||
GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error)
|
||||
CheckRealmMemberPerm(context.Context, *CheckRealmPermRequest) (*CheckRealmPermResponse, error)
|
||||
mustEmbedUnimplementedRealmServer()
|
||||
mustEmbedUnimplementedRealmServiceServer()
|
||||
}
|
||||
|
||||
// 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 UnimplementedRealmServer struct{}
|
||||
// UnimplementedRealmServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedRealmServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedRealmServer) ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error) {
|
||||
func (UnimplementedRealmServiceServer) ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListCommunityRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServer) ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) {
|
||||
func (UnimplementedRealmServiceServer) ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListAvailableRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServer) ListOwnedRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) {
|
||||
func (UnimplementedRealmServiceServer) ListOwnedRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListOwnedRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServer) GetRealm(context.Context, *LookupRealmRequest) (*RealmInfo, error) {
|
||||
func (UnimplementedRealmServiceServer) GetRealm(context.Context, *LookupRealmRequest) (*RealmInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRealm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServer) ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error) {
|
||||
func (UnimplementedRealmServiceServer) ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method ListRealmMember not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServer) GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error) {
|
||||
func (UnimplementedRealmServiceServer) GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetRealmMember not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServer) CheckRealmMemberPerm(context.Context, *CheckRealmPermRequest) (*CheckRealmPermResponse, error) {
|
||||
func (UnimplementedRealmServiceServer) CheckRealmMemberPerm(context.Context, *CheckRealmPermRequest) (*CheckRealmPermResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method CheckRealmMemberPerm not implemented")
|
||||
}
|
||||
func (UnimplementedRealmServer) mustEmbedUnimplementedRealmServer() {}
|
||||
func (UnimplementedRealmServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedRealmServiceServer) mustEmbedUnimplementedRealmServiceServer() {}
|
||||
|
||||
// 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
|
||||
// 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
|
||||
// result in compilation errors.
|
||||
type UnsafeRealmServer interface {
|
||||
mustEmbedUnimplementedRealmServer()
|
||||
type UnsafeRealmServiceServer interface {
|
||||
mustEmbedUnimplementedRealmServiceServer()
|
||||
}
|
||||
|
||||
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(&Realm_ServiceDesc, srv)
|
||||
func RegisterRealmServiceServer(s grpc.ServiceRegistrar, srv RealmServiceServer) {
|
||||
s.RegisterService(&RealmService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _Realm_ListCommunityRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _RealmService_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.(RealmServer).ListCommunityRealm(ctx, in)
|
||||
return srv.(RealmServiceServer).ListCommunityRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Realm_ListCommunityRealm_FullMethodName,
|
||||
FullMethod: "/proto.RealmService/ListCommunityRealm",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServer).ListCommunityRealm(ctx, req.(*ListRealmRequest))
|
||||
return srv.(RealmServiceServer).ListCommunityRealm(ctx, req.(*ListRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Realm_ListAvailableRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _RealmService_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.(RealmServer).ListAvailableRealm(ctx, in)
|
||||
return srv.(RealmServiceServer).ListAvailableRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Realm_ListAvailableRealm_FullMethodName,
|
||||
FullMethod: "/proto.RealmService/ListAvailableRealm",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServer).ListAvailableRealm(ctx, req.(*LookupUserRealmRequest))
|
||||
return srv.(RealmServiceServer).ListAvailableRealm(ctx, req.(*LookupUserRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Realm_ListOwnedRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _RealmService_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.(RealmServer).ListOwnedRealm(ctx, in)
|
||||
return srv.(RealmServiceServer).ListOwnedRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Realm_ListOwnedRealm_FullMethodName,
|
||||
FullMethod: "/proto.RealmService/ListOwnedRealm",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServer).ListOwnedRealm(ctx, req.(*LookupUserRealmRequest))
|
||||
return srv.(RealmServiceServer).ListOwnedRealm(ctx, req.(*LookupUserRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Realm_GetRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _RealmService_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.(RealmServer).GetRealm(ctx, in)
|
||||
return srv.(RealmServiceServer).GetRealm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Realm_GetRealm_FullMethodName,
|
||||
FullMethod: "/proto.RealmService/GetRealm",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServer).GetRealm(ctx, req.(*LookupRealmRequest))
|
||||
return srv.(RealmServiceServer).GetRealm(ctx, req.(*LookupRealmRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Realm_ListRealmMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _RealmService_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.(RealmServer).ListRealmMember(ctx, in)
|
||||
return srv.(RealmServiceServer).ListRealmMember(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Realm_ListRealmMember_FullMethodName,
|
||||
FullMethod: "/proto.RealmService/ListRealmMember",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServer).ListRealmMember(ctx, req.(*RealmMemberLookupRequest))
|
||||
return srv.(RealmServiceServer).ListRealmMember(ctx, req.(*RealmMemberLookupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Realm_GetRealmMember_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _RealmService_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.(RealmServer).GetRealmMember(ctx, in)
|
||||
return srv.(RealmServiceServer).GetRealmMember(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Realm_GetRealmMember_FullMethodName,
|
||||
FullMethod: "/proto.RealmService/GetRealmMember",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServer).GetRealmMember(ctx, req.(*RealmMemberLookupRequest))
|
||||
return srv.(RealmServiceServer).GetRealmMember(ctx, req.(*RealmMemberLookupRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Realm_CheckRealmMemberPerm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _RealmService_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.(RealmServer).CheckRealmMemberPerm(ctx, in)
|
||||
return srv.(RealmServiceServer).CheckRealmMemberPerm(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Realm_CheckRealmMemberPerm_FullMethodName,
|
||||
FullMethod: "/proto.RealmService/CheckRealmMemberPerm",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(RealmServer).CheckRealmMemberPerm(ctx, req.(*CheckRealmPermRequest))
|
||||
return srv.(RealmServiceServer).CheckRealmMemberPerm(ctx, req.(*CheckRealmPermRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// Realm_ServiceDesc is the grpc.ServiceDesc for Realm service.
|
||||
// RealmService_ServiceDesc is the grpc.ServiceDesc for RealmService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var Realm_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.Realm",
|
||||
HandlerType: (*RealmServer)(nil),
|
||||
var RealmService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.RealmService",
|
||||
HandlerType: (*RealmServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "ListCommunityRealm",
|
||||
Handler: _Realm_ListCommunityRealm_Handler,
|
||||
Handler: _RealmService_ListCommunityRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListAvailableRealm",
|
||||
Handler: _Realm_ListAvailableRealm_Handler,
|
||||
Handler: _RealmService_ListAvailableRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListOwnedRealm",
|
||||
Handler: _Realm_ListOwnedRealm_Handler,
|
||||
Handler: _RealmService_ListOwnedRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRealm",
|
||||
Handler: _Realm_GetRealm_Handler,
|
||||
Handler: _RealmService_GetRealm_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "ListRealmMember",
|
||||
Handler: _Realm_ListRealmMember_Handler,
|
||||
Handler: _RealmService_ListRealmMember_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "GetRealmMember",
|
||||
Handler: _Realm_GetRealmMember_Handler,
|
||||
Handler: _RealmService_GetRealmMember_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "CheckRealmMemberPerm",
|
||||
Handler: _Realm_CheckRealmMemberPerm_Handler,
|
||||
Handler: _RealmService_CheckRealmMemberPerm_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||
// versions:
|
||||
// protoc-gen-go v1.35.1
|
||||
// protoc-gen-go v1.28.1
|
||||
// protoc v5.28.2
|
||||
// source: record.proto
|
||||
|
||||
@ -34,9 +34,11 @@ type RecordEventRequest struct {
|
||||
|
||||
func (x *RecordEventRequest) Reset() {
|
||||
*x = RecordEventRequest{}
|
||||
mi := &file_record_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_record_proto_msgTypes[0]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RecordEventRequest) String() string {
|
||||
@ -47,7 +49,7 @@ func (*RecordEventRequest) ProtoMessage() {}
|
||||
|
||||
func (x *RecordEventRequest) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_record_proto_msgTypes[0]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -107,9 +109,11 @@ type RecordEventResponse struct {
|
||||
|
||||
func (x *RecordEventResponse) Reset() {
|
||||
*x = RecordEventResponse{}
|
||||
mi := &file_record_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
if protoimpl.UnsafeEnabled {
|
||||
mi := &file_record_proto_msgTypes[1]
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
ms.StoreMessageInfo(mi)
|
||||
}
|
||||
}
|
||||
|
||||
func (x *RecordEventResponse) String() string {
|
||||
@ -120,7 +124,7 @@ func (*RecordEventResponse) ProtoMessage() {}
|
||||
|
||||
func (x *RecordEventResponse) ProtoReflect() protoreflect.Message {
|
||||
mi := &file_record_proto_msgTypes[1]
|
||||
if x != nil {
|
||||
if protoimpl.UnsafeEnabled && x != nil {
|
||||
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||
if ms.LoadMessageInfo() == nil {
|
||||
ms.StoreMessageInfo(mi)
|
||||
@ -158,14 +162,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, 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,
|
||||
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,
|
||||
}
|
||||
|
||||
var (
|
||||
@ -181,13 +185,13 @@ func file_record_proto_rawDescGZIP() []byte {
|
||||
}
|
||||
|
||||
var file_record_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||
var file_record_proto_goTypes = []any{
|
||||
var file_record_proto_goTypes = []interface{}{
|
||||
(*RecordEventRequest)(nil), // 0: proto.RecordEventRequest
|
||||
(*RecordEventResponse)(nil), // 1: proto.RecordEventResponse
|
||||
}
|
||||
var file_record_proto_depIdxs = []int32{
|
||||
0, // 0: proto.EventRecorder.RecordEvent:input_type -> proto.RecordEventRequest
|
||||
1, // 1: proto.EventRecorder.RecordEvent:output_type -> proto.RecordEventResponse
|
||||
0, // 0: proto.AuditService.RecordEvent:input_type -> proto.RecordEventRequest
|
||||
1, // 1: proto.AuditService.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
|
||||
@ -200,6 +204,32 @@ func file_record_proto_init() {
|
||||
if File_record_proto != nil {
|
||||
return
|
||||
}
|
||||
if !protoimpl.UnsafeEnabled {
|
||||
file_record_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RecordEventRequest); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
file_record_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||
switch v := v.(*RecordEventResponse); i {
|
||||
case 0:
|
||||
return &v.state
|
||||
case 1:
|
||||
return &v.sizeCache
|
||||
case 2:
|
||||
return &v.unknownFields
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
}
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
@ -4,18 +4,18 @@ option go_package = ".;proto";
|
||||
|
||||
package proto;
|
||||
|
||||
service EventRecorder {
|
||||
rpc RecordEvent(RecordEventRequest) returns (RecordEventResponse) {}
|
||||
service AuditService {
|
||||
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;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
|
||||
// versions:
|
||||
// - protoc-gen-go-grpc v1.5.1
|
||||
// - protoc-gen-go-grpc v1.2.0
|
||||
// - protoc v5.28.2
|
||||
// source: record.proto
|
||||
|
||||
@ -15,105 +15,89 @@ import (
|
||||
|
||||
// This is a compile-time assertion to ensure that this generated file
|
||||
// is compatible with the grpc package it is being compiled against.
|
||||
// Requires gRPC-Go v1.64.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion9
|
||||
// Requires gRPC-Go v1.32.0 or later.
|
||||
const _ = grpc.SupportPackageIsVersion7
|
||||
|
||||
const (
|
||||
EventRecorder_RecordEvent_FullMethodName = "/proto.EventRecorder/RecordEvent"
|
||||
)
|
||||
|
||||
// EventRecorderClient is the client API for EventRecorder service.
|
||||
// AuditServiceClient is the client API for AuditService 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 EventRecorderClient interface {
|
||||
type AuditServiceClient interface {
|
||||
RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error)
|
||||
}
|
||||
|
||||
type eventRecorderClient struct {
|
||||
type auditServiceClient struct {
|
||||
cc grpc.ClientConnInterface
|
||||
}
|
||||
|
||||
func NewEventRecorderClient(cc grpc.ClientConnInterface) EventRecorderClient {
|
||||
return &eventRecorderClient{cc}
|
||||
func NewAuditServiceClient(cc grpc.ClientConnInterface) AuditServiceClient {
|
||||
return &auditServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *eventRecorderClient) RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
func (c *auditServiceClient) RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error) {
|
||||
out := new(RecordEventResponse)
|
||||
err := c.cc.Invoke(ctx, EventRecorder_RecordEvent_FullMethodName, in, out, cOpts...)
|
||||
err := c.cc.Invoke(ctx, "/proto.AuditService/RecordEvent", in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// EventRecorderServer is the http API for EventRecorder service.
|
||||
// All implementations must embed UnimplementedEventRecorderServer
|
||||
// for forward compatibility.
|
||||
type EventRecorderServer interface {
|
||||
// AuditServiceServer is the server API for AuditService service.
|
||||
// All implementations must embed UnimplementedAuditServiceServer
|
||||
// for forward compatibility
|
||||
type AuditServiceServer interface {
|
||||
RecordEvent(context.Context, *RecordEventRequest) (*RecordEventResponse, error)
|
||||
mustEmbedUnimplementedEventRecorderServer()
|
||||
mustEmbedUnimplementedAuditServiceServer()
|
||||
}
|
||||
|
||||
// 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 UnimplementedEventRecorderServer struct{}
|
||||
// UnimplementedAuditServiceServer must be embedded to have forward compatible implementations.
|
||||
type UnimplementedAuditServiceServer struct {
|
||||
}
|
||||
|
||||
func (UnimplementedEventRecorderServer) RecordEvent(context.Context, *RecordEventRequest) (*RecordEventResponse, error) {
|
||||
func (UnimplementedAuditServiceServer) RecordEvent(context.Context, *RecordEventRequest) (*RecordEventResponse, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method RecordEvent not implemented")
|
||||
}
|
||||
func (UnimplementedEventRecorderServer) mustEmbedUnimplementedEventRecorderServer() {}
|
||||
func (UnimplementedEventRecorderServer) testEmbeddedByValue() {}
|
||||
func (UnimplementedAuditServiceServer) mustEmbedUnimplementedAuditServiceServer() {}
|
||||
|
||||
// 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
|
||||
// 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
|
||||
// result in compilation errors.
|
||||
type UnsafeEventRecorderServer interface {
|
||||
mustEmbedUnimplementedEventRecorderServer()
|
||||
type UnsafeAuditServiceServer interface {
|
||||
mustEmbedUnimplementedAuditServiceServer()
|
||||
}
|
||||
|
||||
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(&EventRecorder_ServiceDesc, srv)
|
||||
func RegisterAuditServiceServer(s grpc.ServiceRegistrar, srv AuditServiceServer) {
|
||||
s.RegisterService(&AuditService_ServiceDesc, srv)
|
||||
}
|
||||
|
||||
func _EventRecorder_RecordEvent_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
func _AuditService_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.(EventRecorderServer).RecordEvent(ctx, in)
|
||||
return srv.(AuditServiceServer).RecordEvent(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: EventRecorder_RecordEvent_FullMethodName,
|
||||
FullMethod: "/proto.AuditService/RecordEvent",
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(EventRecorderServer).RecordEvent(ctx, req.(*RecordEventRequest))
|
||||
return srv.(AuditServiceServer).RecordEvent(ctx, req.(*RecordEventRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// EventRecorder_ServiceDesc is the grpc.ServiceDesc for EventRecorder service.
|
||||
// AuditService_ServiceDesc is the grpc.ServiceDesc for AuditService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
var EventRecorder_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.EventRecorder",
|
||||
HandlerType: (*EventRecorderServer)(nil),
|
||||
var AuditService_ServiceDesc = grpc.ServiceDesc{
|
||||
ServiceName: "proto.AuditService",
|
||||
HandlerType: (*AuditServiceServer)(nil),
|
||||
Methods: []grpc.MethodDesc{
|
||||
{
|
||||
MethodName: "RecordEvent",
|
||||
Handler: _EventRecorder_RecordEvent_Handler,
|
||||
Handler: _AuditService_RecordEvent_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
|
Loading…
Reference in New Issue
Block a user