Support users related rpc calls

This commit is contained in:
LittleSheep 2024-10-31 21:07:53 +08:00
parent 8ff2648e4c
commit 8326c716e3
17 changed files with 698 additions and 490 deletions

View File

@ -4,7 +4,25 @@
<option name="autoReloadType" value="ALL" /> <option name="autoReloadType" value="ALL" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":rewind: Revert &quot;:recycle: Move models.Account to sec.UserInfo&quot; for a better solution&#10;&#10;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="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" /> <option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
@ -38,34 +56,34 @@
<option name="hideEmptyMiddlePackages" value="true" /> <option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" /> <option name="showLibraryContents" value="true" />
</component> </component>
<component name="PropertiesComponent"><![CDATA[{ <component name="PropertiesComponent">{
"keyToString": { &quot;keyToString&quot;: {
"DefaultGoTemplateProperty": "Go File", &quot;DefaultGoTemplateProperty&quot;: &quot;Go File&quot;,
"Go Build.Backend.executor": "Run", &quot;Go Build.Backend.executor&quot;: &quot;Run&quot;,
"Go 构建.Backend.executor": "Run", &quot;Go 构建.Backend.executor&quot;: &quot;Run&quot;,
"RunOnceActivity.ShowReadmeOnStart": "true", &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
"RunOnceActivity.go.formatter.settings.were.checked": "true", &quot;RunOnceActivity.go.formatter.settings.were.checked&quot;: &quot;true&quot;,
"RunOnceActivity.go.migrated.go.modules.settings": "true", &quot;RunOnceActivity.go.migrated.go.modules.settings&quot;: &quot;true&quot;,
"RunOnceActivity.go.modules.automatic.dependencies.download": "true", &quot;RunOnceActivity.go.modules.automatic.dependencies.download&quot;: &quot;true&quot;,
"RunOnceActivity.go.modules.go.list.on.any.changes.was.set": "true", &quot;RunOnceActivity.go.modules.go.list.on.any.changes.was.set&quot;: &quot;true&quot;,
"git-widget-placeholder": "master", &quot;git-widget-placeholder&quot;: &quot;master&quot;,
"go.import.settings.migrated": "true", &quot;go.import.settings.migrated&quot;: &quot;true&quot;,
"go.sdk.automatically.set": "true", &quot;go.sdk.automatically.set&quot;: &quot;true&quot;,
"last_opened_file_path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/keys", &quot;last_opened_file_path&quot;: &quot;/Users/littlesheep/Documents/Projects/Hypernet/Passport&quot;,
"node.js.detected.package.eslint": "true", &quot;node.js.detected.package.eslint&quot;: &quot;true&quot;,
"node.js.selected.package.eslint": "(autodetect)", &quot;node.js.selected.package.eslint&quot;: &quot;(autodetect)&quot;,
"nodejs_package_manager_path": "npm", &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
"run.code.analysis.last.selected.profile": "pProject Default", &quot;run.code.analysis.last.selected.profile&quot;: &quot;pProject Default&quot;,
"settings.editor.selected.configurable": "preferences.intentionPowerPack", &quot;settings.editor.selected.configurable&quot;: &quot;preferences.intentionPowerPack&quot;,
"ts.external.directory.path": "/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib", &quot;ts.external.directory.path&quot;: &quot;/Users/littlesheep/Documents/Projects/Hydrogen/Passport/web/node_modules/typescript/lib&quot;,
"vue.rearranger.settings.migration": "true" &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
}, },
"keyToStringList": { &quot;keyToStringList&quot;: {
"DatabaseDriversLRU": [ &quot;DatabaseDriversLRU&quot;: [
"postgresql" &quot;postgresql&quot;
] ]
} }
}]]></component> }</component>
<component name="RecentsManager"> <component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS"> <key name="CopyFile.RECENT_KEYS">
<recent name="$PROJECT_DIR$/keys" /> <recent name="$PROJECT_DIR$/keys" />
@ -151,7 +169,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> <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=":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=":sparkles: Allow user view and remove notification subscriptions" />
<MESSAGE value=":recycle: Improve notifications mark read system" /> <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=":truck: Auth kit and parser of nexus userinfo token" />
<MESSAGE value="Revert &quot;:recycle: Move models.Account to sec.UserInfo&quot;&#10;&#10;This reverts commit 8fbb7960" /> <MESSAGE value="Revert &quot;:recycle: Move models.Account to sec.UserInfo&quot;&#10;&#10;This reverts commit 8fbb7960" />
<MESSAGE value=":rewind: Revert &quot;:recycle: Move models.Account to sec.UserInfo&quot; for a better solution&#10;&#10;This reverts commit 8fbb7960" /> <MESSAGE value=":rewind: Revert &quot;:recycle: Move models.Account to sec.UserInfo&quot; for a better solution&#10;&#10;This reverts commit 8fbb7960" />
<option name="LAST_COMMIT_MESSAGE" value=":rewind: Revert &quot;:recycle: Move models.Account to sec.UserInfo&quot; for a better solution&#10;&#10;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" /> <option name="GROUP_MULTIFILE_MERGE_BY_DIRECTORY" value="true" />
</component> </component>
<component name="VgoProject"> <component name="VgoProject">

2
go.mod
View File

@ -3,7 +3,7 @@ module git.solsynth.dev/hypernet/passport
go 1.23.2 go 1.23.2
require ( 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 git.solsynth.dev/hypernet/pusher v0.0.0-20241026153052-cd2c326efa4e
github.com/dgraph-io/ristretto v0.1.1 github.com/dgraph-io/ristretto v0.1.1
github.com/eko/gocache/lib/v4 v4.1.6 github.com/eko/gocache/lib/v4 v4.1.6

2
go.sum
View File

@ -35,6 +35,8 @@ filippo.io/edwards25519 v1.1.0 h1:FNf4tywRC1HmFuKW5xopWpigGjJKiJSV0Cqo0cJWDaA=
filippo.io/edwards25519 v1.1.0/go.mod h1:BxyFTGdWcka3PhytdK4V28tE5sGfRvvvRV7EaN4VDT4= 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 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-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 h1:DtHhMjgxS/spUt/KEdbRFtaVnepI6Vx8pbHdJaNH1hs=
git.solsynth.dev/hypernet/pusher v0.0.0-20241026153052-cd2c326efa4e/go.mod h1:XHTqFU/vBe4JiuAjl87GUcL8+w/IizSNoqH6n3WkQFc= 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= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=

View File

@ -2,6 +2,8 @@ package models
import ( import (
"fmt" "fmt"
"git.solsynth.dev/hypernet/nexus/pkg/nex"
"git.solsynth.dev/hypernet/nexus/pkg/proto"
"gorm.io/datatypes" "gorm.io/datatypes"
"time" "time"
@ -58,6 +60,15 @@ func (v Account) GetPrimaryEmail() AccountContact {
return val 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 type AccountContactType = int8
const ( const (

View File

@ -5,19 +5,12 @@ import (
"git.solsynth.dev/hypernet/nexus/pkg/nex" "git.solsynth.dev/hypernet/nexus/pkg/nex"
"git.solsynth.dev/hypernet/passport/pkg/authkit/models" "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" "git.solsynth.dev/hypernet/passport/pkg/internal/services"
jsoniter "github.com/json-iterator/go" jsoniter "github.com/json-iterator/go"
"git.solsynth.dev/hypernet/nexus/pkg/proto" "git.solsynth.dev/hypernet/nexus/pkg/proto"
) )
type authenticateServer struct {
proto.UnimplementedAuthServiceServer
}
func (v *App) Authenticate(_ context.Context, in *proto.AuthRequest) (*proto.AuthReply, error) { func (v *App) Authenticate(_ context.Context, in *proto.AuthRequest) (*proto.AuthReply, error) {
ticket, perms, err := services.Authenticate(uint(in.GetSessionId())) ticket, perms, err := services.Authenticate(uint(in.GetSessionId()))
if err != nil { if err != nil {
@ -81,55 +74,3 @@ func (v *App) EnsureUserPermGranted(_ context.Context, in *proto.CheckUserPermRe
IsValid: valid, IsValid: valid,
}, nil }, 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
}

View File

@ -16,9 +16,10 @@ import (
type App struct { type App struct {
nroto.UnimplementedAuthServiceServer nroto.UnimplementedAuthServiceServer
nroto.UnimplementedDirectoryServiceServer nroto.UnimplementedDirectoryServiceServer
proto.UnimplementedNotifierServer nroto.UnimplementedUserServiceServer
proto.UnimplementedRealmServer proto.UnimplementedRealmServiceServer
proto.UnimplementedEventRecorderServer proto.UnimplementedAuditServiceServer
proto.UnimplementedNotifyServiceServer
health.UnimplementedHealthServer health.UnimplementedHealthServer
srv *grpc.Server srv *grpc.Server
@ -30,9 +31,10 @@ func NewServer() *App {
} }
nroto.RegisterAuthServiceServer(server.srv, server) nroto.RegisterAuthServiceServer(server.srv, server)
proto.RegisterNotifierServer(server.srv, server) nroto.RegisterUserServiceServer(server.srv, server)
proto.RegisterRealmServer(server.srv, server) proto.RegisterNotifyServiceServer(server.srv, server)
proto.RegisterEventRecorderServer(server.srv, server) proto.RegisterRealmServiceServer(server.srv, server)
proto.RegisterAuditServiceServer(server.srv, server)
health.RegisterHealthServer(server.srv, server) health.RegisterHealthServer(server.srv, server)
reflection.Register(server.srv) reflection.Register(server.srv)

66
pkg/internal/grpc/user.go Normal file
View 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
}

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.35.1 // protoc-gen-go v1.28.1
// protoc v5.28.2 // protoc v5.28.2
// source: notify.proto // source: notify.proto
@ -31,9 +31,11 @@ type NotifyUserRequest struct {
func (x *NotifyUserRequest) Reset() { func (x *NotifyUserRequest) Reset() {
*x = NotifyUserRequest{} *x = NotifyUserRequest{}
mi := &file_notify_proto_msgTypes[0] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_notify_proto_msgTypes[0]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *NotifyUserRequest) String() string { func (x *NotifyUserRequest) String() string {
@ -44,7 +46,7 @@ func (*NotifyUserRequest) ProtoMessage() {}
func (x *NotifyUserRequest) ProtoReflect() protoreflect.Message { func (x *NotifyUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_notify_proto_msgTypes[0] mi := &file_notify_proto_msgTypes[0]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -84,9 +86,11 @@ type NotifyUserBatchRequest struct {
func (x *NotifyUserBatchRequest) Reset() { func (x *NotifyUserBatchRequest) Reset() {
*x = NotifyUserBatchRequest{} *x = NotifyUserBatchRequest{}
mi := &file_notify_proto_msgTypes[1] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_notify_proto_msgTypes[1]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *NotifyUserBatchRequest) String() string { func (x *NotifyUserBatchRequest) String() string {
@ -97,7 +101,7 @@ func (*NotifyUserBatchRequest) ProtoMessage() {}
func (x *NotifyUserBatchRequest) ProtoReflect() protoreflect.Message { func (x *NotifyUserBatchRequest) ProtoReflect() protoreflect.Message {
mi := &file_notify_proto_msgTypes[1] mi := &file_notify_proto_msgTypes[1]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -142,9 +146,11 @@ type NotifyRequest struct {
func (x *NotifyRequest) Reset() { func (x *NotifyRequest) Reset() {
*x = NotifyRequest{} *x = NotifyRequest{}
mi := &file_notify_proto_msgTypes[2] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_notify_proto_msgTypes[2]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *NotifyRequest) String() string { func (x *NotifyRequest) String() string {
@ -155,7 +161,7 @@ func (*NotifyRequest) ProtoMessage() {}
func (x *NotifyRequest) ProtoReflect() protoreflect.Message { func (x *NotifyRequest) ProtoReflect() protoreflect.Message {
mi := &file_notify_proto_msgTypes[2] mi := &file_notify_proto_msgTypes[2]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -230,9 +236,11 @@ type NotifyResponse struct {
func (x *NotifyResponse) Reset() { func (x *NotifyResponse) Reset() {
*x = NotifyResponse{} *x = NotifyResponse{}
mi := &file_notify_proto_msgTypes[3] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_notify_proto_msgTypes[3]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *NotifyResponse) String() string { func (x *NotifyResponse) String() string {
@ -243,7 +251,7 @@ func (*NotifyResponse) ProtoMessage() {}
func (x *NotifyResponse) ProtoReflect() protoreflect.Message { func (x *NotifyResponse) ProtoReflect() protoreflect.Message {
mi := &file_notify_proto_msgTypes[3] mi := &file_notify_proto_msgTypes[3]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) 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, 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, 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, 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, 0x75, 0x6e, 0x74, 0x32, 0xdb, 0x01, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x53, 0x65,
0x12, 0x3f, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x12, 0x18, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x3f, 0x0a, 0x0a, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x73, 0x65, 0x72, 0x12, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69,
0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 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, 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, 0x00, 0x12, 0x3e, 0x0a, 0x0d, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x41, 0x6c, 0x6c, 0x55, 0x73,
0x61, 0x74, 0x63, 0x68, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66,
0x69, 0x66, 0x79, 0x55, 0x73, 0x65, 0x72, 0x42, 0x61, 0x74, 0x63, 0x68, 0x52, 0x65, 0x71, 0x75, 0x79, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x2e, 0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x66, 0x79, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x3e, 0x0a, 0x0d, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72,
0x4e, 0x6f, 0x74, 0x69, 0x66, 0x79, 0x41, 0x6c, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x12, 0x14, 0x2e, 0x6f, 0x74, 0x6f, 0x33,
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 ( var (
@ -337,7 +346,7 @@ func file_notify_proto_rawDescGZIP() []byte {
} }
var file_notify_proto_msgTypes = make([]protoimpl.MessageInfo, 4) 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 (*NotifyUserRequest)(nil), // 0: proto.NotifyUserRequest
(*NotifyUserBatchRequest)(nil), // 1: proto.NotifyUserBatchRequest (*NotifyUserBatchRequest)(nil), // 1: proto.NotifyUserBatchRequest
(*NotifyRequest)(nil), // 2: proto.NotifyRequest (*NotifyRequest)(nil), // 2: proto.NotifyRequest
@ -346,12 +355,12 @@ var file_notify_proto_goTypes = []any{
var file_notify_proto_depIdxs = []int32{ var file_notify_proto_depIdxs = []int32{
2, // 0: proto.NotifyUserRequest.notify:type_name -> proto.NotifyRequest 2, // 0: proto.NotifyUserRequest.notify:type_name -> proto.NotifyRequest
2, // 1: proto.NotifyUserBatchRequest.notify:type_name -> proto.NotifyRequest 2, // 1: proto.NotifyUserBatchRequest.notify:type_name -> proto.NotifyRequest
0, // 2: proto.Notifier.NotifyUser:input_type -> proto.NotifyUserRequest 0, // 2: proto.NotifyService.NotifyUser:input_type -> proto.NotifyUserRequest
1, // 3: proto.Notifier.NotifyUserBatch:input_type -> proto.NotifyUserBatchRequest 1, // 3: proto.NotifyService.NotifyUserBatch:input_type -> proto.NotifyUserBatchRequest
2, // 4: proto.Notifier.NotifyAllUser:input_type -> proto.NotifyRequest 2, // 4: proto.NotifyService.NotifyAllUser:input_type -> proto.NotifyRequest
3, // 5: proto.Notifier.NotifyUser:output_type -> proto.NotifyResponse 3, // 5: proto.NotifyService.NotifyUser:output_type -> proto.NotifyResponse
3, // 6: proto.Notifier.NotifyUserBatch:output_type -> proto.NotifyResponse 3, // 6: proto.NotifyService.NotifyUserBatch:output_type -> proto.NotifyResponse
3, // 7: proto.Notifier.NotifyAllUser:output_type -> proto.NotifyResponse 3, // 7: proto.NotifyService.NotifyAllUser:output_type -> proto.NotifyResponse
5, // [5:8] is the sub-list for method output_type 5, // [5:8] is the sub-list for method output_type
2, // [2:5] is the sub-list for method input_type 2, // [2:5] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name 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 { if File_notify_proto != nil {
return 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{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{

View File

@ -4,7 +4,7 @@ option go_package = ".;proto";
package proto; package proto;
service Notifier { service NotifyService {
rpc NotifyUser(NotifyUserRequest) returns (NotifyResponse) {} rpc NotifyUser(NotifyUserRequest) returns (NotifyResponse) {}
rpc NotifyUserBatch(NotifyUserBatchRequest) returns (NotifyResponse) {} rpc NotifyUserBatch(NotifyUserBatchRequest) returns (NotifyResponse) {}
rpc NotifyAllUser(NotifyRequest) returns(NotifyResponse) {} rpc NotifyAllUser(NotifyRequest) returns(NotifyResponse) {}

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.2.0
// - protoc v5.28.2 // - protoc v5.28.2
// source: notify.proto // source: notify.proto
@ -15,181 +15,161 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( // NotifyServiceClient is the client API for NotifyService service.
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.
// //
// 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. // 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) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, 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) NotifyAllUser(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error)
} }
type notifierClient struct { type notifyServiceClient struct {
cc grpc.ClientConnInterface cc grpc.ClientConnInterface
} }
func NewNotifierClient(cc grpc.ClientConnInterface) NotifierClient { func NewNotifyServiceClient(cc grpc.ClientConnInterface) NotifyServiceClient {
return &notifierClient{cc} return &notifyServiceClient{cc}
} }
func (c *notifierClient) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error) { func (c *notifyServiceClient) NotifyUser(ctx context.Context, in *NotifyUserRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NotifyResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *notifierClient) NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error) { func (c *notifyServiceClient) NotifyUserBatch(ctx context.Context, in *NotifyUserBatchRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NotifyResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *notifierClient) NotifyAllUser(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) { func (c *notifyServiceClient) NotifyAllUser(ctx context.Context, in *NotifyRequest, opts ...grpc.CallOption) (*NotifyResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(NotifyResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
// NotifierServer is the http API for Notifier service. // NotifyServiceServer is the server API for NotifyService service.
// All implementations must embed UnimplementedNotifierServer // All implementations must embed UnimplementedNotifyServiceServer
// for forward compatibility. // for forward compatibility
type NotifierServer interface { type NotifyServiceServer interface {
NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error) NotifyUser(context.Context, *NotifyUserRequest) (*NotifyResponse, error)
NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error) NotifyUserBatch(context.Context, *NotifyUserBatchRequest) (*NotifyResponse, error)
NotifyAllUser(context.Context, *NotifyRequest) (*NotifyResponse, error) NotifyAllUser(context.Context, *NotifyRequest) (*NotifyResponse, error)
mustEmbedUnimplementedNotifierServer() mustEmbedUnimplementedNotifyServiceServer()
} }
// UnimplementedNotifierServer must be embedded to have // UnimplementedNotifyServiceServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedNotifyServiceServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedNotifierServer 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") 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") 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") return nil, status.Errorf(codes.Unimplemented, "method NotifyAllUser not implemented")
} }
func (UnimplementedNotifierServer) mustEmbedUnimplementedNotifierServer() {} func (UnimplementedNotifyServiceServer) mustEmbedUnimplementedNotifyServiceServer() {}
func (UnimplementedNotifierServer) testEmbeddedByValue() {}
// UnsafeNotifierServer may be embedded to opt out of forward compatibility for this service. // UnsafeNotifyServiceServer 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 // Use of this interface is not recommended, as added methods to NotifyServiceServer will
// result in compilation errors. // result in compilation errors.
type UnsafeNotifierServer interface { type UnsafeNotifyServiceServer interface {
mustEmbedUnimplementedNotifierServer() mustEmbedUnimplementedNotifyServiceServer()
} }
func RegisterNotifierServer(s grpc.ServiceRegistrar, srv NotifierServer) { func RegisterNotifyServiceServer(s grpc.ServiceRegistrar, srv NotifyServiceServer) {
// If the following call pancis, it indicates UnimplementedNotifierServer was s.RegisterService(&NotifyService_ServiceDesc, srv)
// 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 _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) in := new(NotifyUserRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(NotifierServer).NotifyUser(ctx, in) return srv.(NotifyServiceServer).NotifyUser(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Notifier_NotifyUser_FullMethodName, FullMethod: "/proto.NotifyService/NotifyUser",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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) in := new(NotifyUserBatchRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(NotifierServer).NotifyUserBatch(ctx, in) return srv.(NotifyServiceServer).NotifyUserBatch(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Notifier_NotifyUserBatch_FullMethodName, FullMethod: "/proto.NotifyService/NotifyUserBatch",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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) in := new(NotifyRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(NotifierServer).NotifyAllUser(ctx, in) return srv.(NotifyServiceServer).NotifyAllUser(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Notifier_NotifyAllUser_FullMethodName, FullMethod: "/proto.NotifyService/NotifyAllUser",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
var Notifier_ServiceDesc = grpc.ServiceDesc{ var NotifyService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proto.Notifier", ServiceName: "proto.NotifyService",
HandlerType: (*NotifierServer)(nil), HandlerType: (*NotifyServiceServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "NotifyUser", MethodName: "NotifyUser",
Handler: _Notifier_NotifyUser_Handler, Handler: _NotifyService_NotifyUser_Handler,
}, },
{ {
MethodName: "NotifyUserBatch", MethodName: "NotifyUserBatch",
Handler: _Notifier_NotifyUserBatch_Handler, Handler: _NotifyService_NotifyUserBatch_Handler,
}, },
{ {
MethodName: "NotifyAllUser", MethodName: "NotifyAllUser",
Handler: _Notifier_NotifyAllUser_Handler, Handler: _NotifyService_NotifyAllUser_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.35.1 // protoc-gen-go v1.28.1
// protoc v5.28.2 // protoc v5.28.2
// source: realm.proto // source: realm.proto
@ -38,9 +38,11 @@ type RealmInfo struct {
func (x *RealmInfo) Reset() { func (x *RealmInfo) Reset() {
*x = RealmInfo{} *x = RealmInfo{}
mi := &file_realm_proto_msgTypes[0] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[0]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *RealmInfo) String() string { func (x *RealmInfo) String() string {
@ -51,7 +53,7 @@ func (*RealmInfo) ProtoMessage() {}
func (x *RealmInfo) ProtoReflect() protoreflect.Message { func (x *RealmInfo) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[0] mi := &file_realm_proto_msgTypes[0]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -137,9 +139,11 @@ type ListRealmRequest struct {
func (x *ListRealmRequest) Reset() { func (x *ListRealmRequest) Reset() {
*x = ListRealmRequest{} *x = ListRealmRequest{}
mi := &file_realm_proto_msgTypes[1] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[1]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *ListRealmRequest) String() string { func (x *ListRealmRequest) String() string {
@ -150,7 +154,7 @@ func (*ListRealmRequest) ProtoMessage() {}
func (x *ListRealmRequest) ProtoReflect() protoreflect.Message { func (x *ListRealmRequest) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[1] mi := &file_realm_proto_msgTypes[1]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -175,9 +179,11 @@ type LookupUserRealmRequest struct {
func (x *LookupUserRealmRequest) Reset() { func (x *LookupUserRealmRequest) Reset() {
*x = LookupUserRealmRequest{} *x = LookupUserRealmRequest{}
mi := &file_realm_proto_msgTypes[2] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[2]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *LookupUserRealmRequest) String() string { func (x *LookupUserRealmRequest) String() string {
@ -188,7 +194,7 @@ func (*LookupUserRealmRequest) ProtoMessage() {}
func (x *LookupUserRealmRequest) ProtoReflect() protoreflect.Message { func (x *LookupUserRealmRequest) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[2] mi := &file_realm_proto_msgTypes[2]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -223,9 +229,11 @@ type LookupRealmRequest struct {
func (x *LookupRealmRequest) Reset() { func (x *LookupRealmRequest) Reset() {
*x = LookupRealmRequest{} *x = LookupRealmRequest{}
mi := &file_realm_proto_msgTypes[3] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[3]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *LookupRealmRequest) String() string { func (x *LookupRealmRequest) String() string {
@ -236,7 +244,7 @@ func (*LookupRealmRequest) ProtoMessage() {}
func (x *LookupRealmRequest) ProtoReflect() protoreflect.Message { func (x *LookupRealmRequest) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[3] mi := &file_realm_proto_msgTypes[3]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -289,9 +297,11 @@ type ListRealmResponse struct {
func (x *ListRealmResponse) Reset() { func (x *ListRealmResponse) Reset() {
*x = ListRealmResponse{} *x = ListRealmResponse{}
mi := &file_realm_proto_msgTypes[4] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[4]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *ListRealmResponse) String() string { func (x *ListRealmResponse) String() string {
@ -302,7 +312,7 @@ func (*ListRealmResponse) ProtoMessage() {}
func (x *ListRealmResponse) ProtoReflect() protoreflect.Message { func (x *ListRealmResponse) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[4] mi := &file_realm_proto_msgTypes[4]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -335,9 +345,11 @@ type RealmMemberLookupRequest struct {
func (x *RealmMemberLookupRequest) Reset() { func (x *RealmMemberLookupRequest) Reset() {
*x = RealmMemberLookupRequest{} *x = RealmMemberLookupRequest{}
mi := &file_realm_proto_msgTypes[5] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[5]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *RealmMemberLookupRequest) String() string { func (x *RealmMemberLookupRequest) String() string {
@ -348,7 +360,7 @@ func (*RealmMemberLookupRequest) ProtoMessage() {}
func (x *RealmMemberLookupRequest) ProtoReflect() protoreflect.Message { func (x *RealmMemberLookupRequest) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[5] mi := &file_realm_proto_msgTypes[5]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -389,9 +401,11 @@ type RealmMemberInfo struct {
func (x *RealmMemberInfo) Reset() { func (x *RealmMemberInfo) Reset() {
*x = RealmMemberInfo{} *x = RealmMemberInfo{}
mi := &file_realm_proto_msgTypes[6] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[6]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *RealmMemberInfo) String() string { func (x *RealmMemberInfo) String() string {
@ -402,7 +416,7 @@ func (*RealmMemberInfo) ProtoMessage() {}
func (x *RealmMemberInfo) ProtoReflect() protoreflect.Message { func (x *RealmMemberInfo) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[6] mi := &file_realm_proto_msgTypes[6]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -448,9 +462,11 @@ type ListRealmMemberResponse struct {
func (x *ListRealmMemberResponse) Reset() { func (x *ListRealmMemberResponse) Reset() {
*x = ListRealmMemberResponse{} *x = ListRealmMemberResponse{}
mi := &file_realm_proto_msgTypes[7] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[7]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *ListRealmMemberResponse) String() string { func (x *ListRealmMemberResponse) String() string {
@ -461,7 +477,7 @@ func (*ListRealmMemberResponse) ProtoMessage() {}
func (x *ListRealmMemberResponse) ProtoReflect() protoreflect.Message { func (x *ListRealmMemberResponse) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[7] mi := &file_realm_proto_msgTypes[7]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -495,9 +511,11 @@ type CheckRealmPermRequest struct {
func (x *CheckRealmPermRequest) Reset() { func (x *CheckRealmPermRequest) Reset() {
*x = CheckRealmPermRequest{} *x = CheckRealmPermRequest{}
mi := &file_realm_proto_msgTypes[8] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[8]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *CheckRealmPermRequest) String() string { func (x *CheckRealmPermRequest) String() string {
@ -508,7 +526,7 @@ func (*CheckRealmPermRequest) ProtoMessage() {}
func (x *CheckRealmPermRequest) ProtoReflect() protoreflect.Message { func (x *CheckRealmPermRequest) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[8] mi := &file_realm_proto_msgTypes[8]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -554,9 +572,11 @@ type CheckRealmPermResponse struct {
func (x *CheckRealmPermResponse) Reset() { func (x *CheckRealmPermResponse) Reset() {
*x = CheckRealmPermResponse{} *x = CheckRealmPermResponse{}
mi := &file_realm_proto_msgTypes[9] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_realm_proto_msgTypes[9]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *CheckRealmPermResponse) String() string { func (x *CheckRealmPermResponse) String() string {
@ -567,7 +587,7 @@ func (*CheckRealmPermResponse) ProtoMessage() {}
func (x *CheckRealmPermResponse) ProtoReflect() protoreflect.Message { func (x *CheckRealmPermResponse) ProtoReflect() protoreflect.Message {
mi := &file_realm_proto_msgTypes[9] mi := &file_realm_proto_msgTypes[9]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) 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, 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, 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, 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, 0xac, 0x04, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x12, 0x49, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74,
0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x79, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c,
0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c,
0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x12, 0x4c,
0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x69, 0x73, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x61, 0x6c,
0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70,
0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61,
0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x77, 0x6e, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e,
0x65, 0x64, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x1d,
0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e,
0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52,
0x22, 0x00, 0x12, 0x39, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x19, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x08, 0x47, 0x65, 0x74,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x61, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f,
0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x49, 0x6e,
0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c,
0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x6d, 0x62, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75,
0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x47, 0x65,
0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70,
0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e,
0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65,
0x12, 0x55, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63, 0x6b,
0x6d, 0x62, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x12,
0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61,
0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e,
0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d,
0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09,
0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x33,
} }
var ( var (
@ -709,7 +730,7 @@ func file_realm_proto_rawDescGZIP() []byte {
} }
var file_realm_proto_msgTypes = make([]protoimpl.MessageInfo, 10) 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 (*RealmInfo)(nil), // 0: proto.RealmInfo
(*ListRealmRequest)(nil), // 1: proto.ListRealmRequest (*ListRealmRequest)(nil), // 1: proto.ListRealmRequest
(*LookupUserRealmRequest)(nil), // 2: proto.LookupUserRealmRequest (*LookupUserRealmRequest)(nil), // 2: proto.LookupUserRealmRequest
@ -724,20 +745,20 @@ var file_realm_proto_goTypes = []any{
var file_realm_proto_depIdxs = []int32{ var file_realm_proto_depIdxs = []int32{
0, // 0: proto.ListRealmResponse.data:type_name -> proto.RealmInfo 0, // 0: proto.ListRealmResponse.data:type_name -> proto.RealmInfo
6, // 1: proto.ListRealmMemberResponse.data:type_name -> proto.RealmMemberInfo 6, // 1: proto.ListRealmMemberResponse.data:type_name -> proto.RealmMemberInfo
1, // 2: proto.Realm.ListCommunityRealm:input_type -> proto.ListRealmRequest 1, // 2: proto.RealmService.ListCommunityRealm:input_type -> proto.ListRealmRequest
2, // 3: proto.Realm.ListAvailableRealm:input_type -> proto.LookupUserRealmRequest 2, // 3: proto.RealmService.ListAvailableRealm:input_type -> proto.LookupUserRealmRequest
2, // 4: proto.Realm.ListOwnedRealm:input_type -> proto.LookupUserRealmRequest 2, // 4: proto.RealmService.ListOwnedRealm:input_type -> proto.LookupUserRealmRequest
3, // 5: proto.Realm.GetRealm:input_type -> proto.LookupRealmRequest 3, // 5: proto.RealmService.GetRealm:input_type -> proto.LookupRealmRequest
5, // 6: proto.Realm.ListRealmMember:input_type -> proto.RealmMemberLookupRequest 5, // 6: proto.RealmService.ListRealmMember:input_type -> proto.RealmMemberLookupRequest
5, // 7: proto.Realm.GetRealmMember:input_type -> proto.RealmMemberLookupRequest 5, // 7: proto.RealmService.GetRealmMember:input_type -> proto.RealmMemberLookupRequest
8, // 8: proto.Realm.CheckRealmMemberPerm:input_type -> proto.CheckRealmPermRequest 8, // 8: proto.RealmService.CheckRealmMemberPerm:input_type -> proto.CheckRealmPermRequest
4, // 9: proto.Realm.ListCommunityRealm:output_type -> proto.ListRealmResponse 4, // 9: proto.RealmService.ListCommunityRealm:output_type -> proto.ListRealmResponse
4, // 10: proto.Realm.ListAvailableRealm:output_type -> proto.ListRealmResponse 4, // 10: proto.RealmService.ListAvailableRealm:output_type -> proto.ListRealmResponse
4, // 11: proto.Realm.ListOwnedRealm:output_type -> proto.ListRealmResponse 4, // 11: proto.RealmService.ListOwnedRealm:output_type -> proto.ListRealmResponse
0, // 12: proto.Realm.GetRealm:output_type -> proto.RealmInfo 0, // 12: proto.RealmService.GetRealm:output_type -> proto.RealmInfo
7, // 13: proto.Realm.ListRealmMember:output_type -> proto.ListRealmMemberResponse 7, // 13: proto.RealmService.ListRealmMember:output_type -> proto.ListRealmMemberResponse
6, // 14: proto.Realm.GetRealmMember:output_type -> proto.RealmMemberInfo 6, // 14: proto.RealmService.GetRealmMember:output_type -> proto.RealmMemberInfo
9, // 15: proto.Realm.CheckRealmMemberPerm:output_type -> proto.CheckRealmPermResponse 9, // 15: proto.RealmService.CheckRealmMemberPerm:output_type -> proto.CheckRealmPermResponse
9, // [9:16] is the sub-list for method output_type 9, // [9:16] is the sub-list for method output_type
2, // [2:9] is the sub-list for method input_type 2, // [2:9] is the sub-list for method input_type
2, // [2:2] is the sub-list for extension type_name 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 { if File_realm_proto != nil {
return return
} }
file_realm_proto_msgTypes[3].OneofWrappers = []any{} if !protoimpl.UnsafeEnabled {
file_realm_proto_msgTypes[5].OneofWrappers = []any{} 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{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{

View File

@ -4,7 +4,7 @@ option go_package = ".;proto";
package proto; package proto;
service Realm { service RealmService {
rpc ListCommunityRealm(ListRealmRequest) returns (ListRealmResponse) {} rpc ListCommunityRealm(ListRealmRequest) returns (ListRealmResponse) {}
rpc ListAvailableRealm(LookupUserRealmRequest) returns (ListRealmResponse) {} rpc ListAvailableRealm(LookupUserRealmRequest) returns (ListRealmResponse) {}
rpc ListOwnedRealm(LookupUserRealmRequest) returns (ListRealmResponse) {} rpc ListOwnedRealm(LookupUserRealmRequest) returns (ListRealmResponse) {}

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.2.0
// - protoc v5.28.2 // - protoc v5.28.2
// source: realm.proto // source: realm.proto
@ -15,23 +15,13 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( // RealmServiceClient is the client API for RealmService service.
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.
// //
// 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. // 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) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error)
ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, 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) 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) CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error)
} }
type realmClient struct { type realmServiceClient struct {
cc grpc.ClientConnInterface cc grpc.ClientConnInterface
} }
func NewRealmClient(cc grpc.ClientConnInterface) RealmClient { func NewRealmServiceClient(cc grpc.ClientConnInterface) RealmServiceClient {
return &realmClient{cc} return &realmServiceClient{cc}
} }
func (c *realmClient) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) { func (c *realmServiceClient) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRealmResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *realmClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) { func (c *realmServiceClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRealmResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *realmClient) ListOwnedRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) { func (c *realmServiceClient) ListOwnedRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRealmResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *realmClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) { func (c *realmServiceClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RealmInfo) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *realmClient) ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error) { func (c *realmServiceClient) ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRealmMemberResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *realmClient) GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error) { func (c *realmServiceClient) GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RealmMemberInfo) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
func (c *realmClient) CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error) { func (c *realmServiceClient) CheckRealmMemberPerm(ctx context.Context, in *CheckRealmPermRequest, opts ...grpc.CallOption) (*CheckRealmPermResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(CheckRealmPermResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
// RealmServer is the http API for Realm service. // RealmServiceServer is the server API for RealmService service.
// All implementations must embed UnimplementedRealmServer // All implementations must embed UnimplementedRealmServiceServer
// for forward compatibility. // for forward compatibility
type RealmServer interface { type RealmServiceServer interface {
ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error) ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error)
ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error)
ListOwnedRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) ListOwnedRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error)
@ -130,218 +113,207 @@ type RealmServer interface {
ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error) ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error)
GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error) GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error)
CheckRealmMemberPerm(context.Context, *CheckRealmPermRequest) (*CheckRealmPermResponse, error) CheckRealmMemberPerm(context.Context, *CheckRealmPermRequest) (*CheckRealmPermResponse, error)
mustEmbedUnimplementedRealmServer() mustEmbedUnimplementedRealmServiceServer()
} }
// UnimplementedRealmServer must be embedded to have // UnimplementedRealmServiceServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedRealmServiceServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedRealmServer 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") 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") 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") 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") 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") 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") 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") return nil, status.Errorf(codes.Unimplemented, "method CheckRealmMemberPerm not implemented")
} }
func (UnimplementedRealmServer) mustEmbedUnimplementedRealmServer() {} func (UnimplementedRealmServiceServer) mustEmbedUnimplementedRealmServiceServer() {}
func (UnimplementedRealmServer) testEmbeddedByValue() {}
// UnsafeRealmServer may be embedded to opt out of forward compatibility for this service. // UnsafeRealmServiceServer 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 // Use of this interface is not recommended, as added methods to RealmServiceServer will
// result in compilation errors. // result in compilation errors.
type UnsafeRealmServer interface { type UnsafeRealmServiceServer interface {
mustEmbedUnimplementedRealmServer() mustEmbedUnimplementedRealmServiceServer()
} }
func RegisterRealmServer(s grpc.ServiceRegistrar, srv RealmServer) { func RegisterRealmServiceServer(s grpc.ServiceRegistrar, srv RealmServiceServer) {
// If the following call pancis, it indicates UnimplementedRealmServer was s.RegisterService(&RealmService_ServiceDesc, srv)
// 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 _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) in := new(ListRealmRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(RealmServer).ListCommunityRealm(ctx, in) return srv.(RealmServiceServer).ListCommunityRealm(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Realm_ListCommunityRealm_FullMethodName, FullMethod: "/proto.RealmService/ListCommunityRealm",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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) in := new(LookupUserRealmRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(RealmServer).ListAvailableRealm(ctx, in) return srv.(RealmServiceServer).ListAvailableRealm(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Realm_ListAvailableRealm_FullMethodName, FullMethod: "/proto.RealmService/ListAvailableRealm",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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) in := new(LookupUserRealmRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(RealmServer).ListOwnedRealm(ctx, in) return srv.(RealmServiceServer).ListOwnedRealm(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Realm_ListOwnedRealm_FullMethodName, FullMethod: "/proto.RealmService/ListOwnedRealm",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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) in := new(LookupRealmRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(RealmServer).GetRealm(ctx, in) return srv.(RealmServiceServer).GetRealm(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Realm_GetRealm_FullMethodName, FullMethod: "/proto.RealmService/GetRealm",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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) in := new(RealmMemberLookupRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(RealmServer).ListRealmMember(ctx, in) return srv.(RealmServiceServer).ListRealmMember(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Realm_ListRealmMember_FullMethodName, FullMethod: "/proto.RealmService/ListRealmMember",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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) in := new(RealmMemberLookupRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(RealmServer).GetRealmMember(ctx, in) return srv.(RealmServiceServer).GetRealmMember(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Realm_GetRealmMember_FullMethodName, FullMethod: "/proto.RealmService/GetRealmMember",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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) in := new(CheckRealmPermRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(RealmServer).CheckRealmMemberPerm(ctx, in) return srv.(RealmServiceServer).CheckRealmMemberPerm(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: Realm_CheckRealmMemberPerm_FullMethodName, FullMethod: "/proto.RealmService/CheckRealmMemberPerm",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
var Realm_ServiceDesc = grpc.ServiceDesc{ var RealmService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proto.Realm", ServiceName: "proto.RealmService",
HandlerType: (*RealmServer)(nil), HandlerType: (*RealmServiceServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "ListCommunityRealm", MethodName: "ListCommunityRealm",
Handler: _Realm_ListCommunityRealm_Handler, Handler: _RealmService_ListCommunityRealm_Handler,
}, },
{ {
MethodName: "ListAvailableRealm", MethodName: "ListAvailableRealm",
Handler: _Realm_ListAvailableRealm_Handler, Handler: _RealmService_ListAvailableRealm_Handler,
}, },
{ {
MethodName: "ListOwnedRealm", MethodName: "ListOwnedRealm",
Handler: _Realm_ListOwnedRealm_Handler, Handler: _RealmService_ListOwnedRealm_Handler,
}, },
{ {
MethodName: "GetRealm", MethodName: "GetRealm",
Handler: _Realm_GetRealm_Handler, Handler: _RealmService_GetRealm_Handler,
}, },
{ {
MethodName: "ListRealmMember", MethodName: "ListRealmMember",
Handler: _Realm_ListRealmMember_Handler, Handler: _RealmService_ListRealmMember_Handler,
}, },
{ {
MethodName: "GetRealmMember", MethodName: "GetRealmMember",
Handler: _Realm_GetRealmMember_Handler, Handler: _RealmService_GetRealmMember_Handler,
}, },
{ {
MethodName: "CheckRealmMemberPerm", MethodName: "CheckRealmMemberPerm",
Handler: _Realm_CheckRealmMemberPerm_Handler, Handler: _RealmService_CheckRealmMemberPerm_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go. DO NOT EDIT. // Code generated by protoc-gen-go. DO NOT EDIT.
// versions: // versions:
// protoc-gen-go v1.35.1 // protoc-gen-go v1.28.1
// protoc v5.28.2 // protoc v5.28.2
// source: record.proto // source: record.proto
@ -34,9 +34,11 @@ type RecordEventRequest struct {
func (x *RecordEventRequest) Reset() { func (x *RecordEventRequest) Reset() {
*x = RecordEventRequest{} *x = RecordEventRequest{}
mi := &file_record_proto_msgTypes[0] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_record_proto_msgTypes[0]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *RecordEventRequest) String() string { func (x *RecordEventRequest) String() string {
@ -47,7 +49,7 @@ func (*RecordEventRequest) ProtoMessage() {}
func (x *RecordEventRequest) ProtoReflect() protoreflect.Message { func (x *RecordEventRequest) ProtoReflect() protoreflect.Message {
mi := &file_record_proto_msgTypes[0] mi := &file_record_proto_msgTypes[0]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) ms.StoreMessageInfo(mi)
@ -107,9 +109,11 @@ type RecordEventResponse struct {
func (x *RecordEventResponse) Reset() { func (x *RecordEventResponse) Reset() {
*x = RecordEventResponse{} *x = RecordEventResponse{}
mi := &file_record_proto_msgTypes[1] if protoimpl.UnsafeEnabled {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) mi := &file_record_proto_msgTypes[1]
ms.StoreMessageInfo(mi) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} }
func (x *RecordEventResponse) String() string { func (x *RecordEventResponse) String() string {
@ -120,7 +124,7 @@ func (*RecordEventResponse) ProtoMessage() {}
func (x *RecordEventResponse) ProtoReflect() protoreflect.Message { func (x *RecordEventResponse) ProtoReflect() protoreflect.Message {
mi := &file_record_proto_msgTypes[1] mi := &file_record_proto_msgTypes[1]
if x != nil { if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil { if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi) 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, 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, 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, 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, 0x09, 0x69, 0x73, 0x53, 0x75, 0x63, 0x63, 0x65, 0x73, 0x73, 0x32, 0x56, 0x0a, 0x0c, 0x41, 0x75,
0x65, 0x6e, 0x74, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x65, 0x72, 0x12, 0x46, 0x0a, 0x0b, 0x52, 0x64, 0x69, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x46, 0x0a, 0x0b, 0x52, 0x65,
0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x6f, 0x2e, 0x52, 0x65, 0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x71,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x63,
0x63, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x6f, 0x72, 0x64, 0x45, 0x76, 0x65, 0x6e, 0x74, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
@ -181,13 +185,13 @@ func file_record_proto_rawDescGZIP() []byte {
} }
var file_record_proto_msgTypes = make([]protoimpl.MessageInfo, 2) 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 (*RecordEventRequest)(nil), // 0: proto.RecordEventRequest
(*RecordEventResponse)(nil), // 1: proto.RecordEventResponse (*RecordEventResponse)(nil), // 1: proto.RecordEventResponse
} }
var file_record_proto_depIdxs = []int32{ var file_record_proto_depIdxs = []int32{
0, // 0: proto.EventRecorder.RecordEvent:input_type -> proto.RecordEventRequest 0, // 0: proto.AuditService.RecordEvent:input_type -> proto.RecordEventRequest
1, // 1: proto.EventRecorder.RecordEvent:output_type -> proto.RecordEventResponse 1, // 1: proto.AuditService.RecordEvent:output_type -> proto.RecordEventResponse
1, // [1:2] is the sub-list for method output_type 1, // [1:2] is the sub-list for method output_type
0, // [0:1] is the sub-list for method input_type 0, // [0:1] is the sub-list for method input_type
0, // [0:0] is the sub-list for extension type_name 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 { if File_record_proto != nil {
return 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{} type x struct{}
out := protoimpl.TypeBuilder{ out := protoimpl.TypeBuilder{
File: protoimpl.DescBuilder{ File: protoimpl.DescBuilder{

View File

@ -4,18 +4,18 @@ option go_package = ".;proto";
package proto; package proto;
service EventRecorder { service AuditService {
rpc RecordEvent(RecordEventRequest) returns (RecordEventResponse) {} rpc RecordEvent(RecordEventRequest) returns (RecordEventResponse) {}
} }
message RecordEventRequest { message RecordEventRequest {
uint64 user_id = 1; uint64 user_id = 1;
string action = 2; string action = 2;
string target = 3; string target = 3;
string ip = 4; string ip = 4;
string user_agent = 5; string user_agent = 5;
} }
message RecordEventResponse { message RecordEventResponse {
bool is_success = 1; bool is_success = 1;
} }

View File

@ -1,6 +1,6 @@
// Code generated by protoc-gen-go-grpc. DO NOT EDIT. // Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions: // versions:
// - protoc-gen-go-grpc v1.5.1 // - protoc-gen-go-grpc v1.2.0
// - protoc v5.28.2 // - protoc v5.28.2
// source: record.proto // source: record.proto
@ -15,105 +15,89 @@ import (
// This is a compile-time assertion to ensure that this generated file // This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against. // is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later. // Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion7
const ( // AuditServiceClient is the client API for AuditService service.
EventRecorder_RecordEvent_FullMethodName = "/proto.EventRecorder/RecordEvent"
)
// EventRecorderClient is the client API for EventRecorder service.
// //
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream. // 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) RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error)
} }
type eventRecorderClient struct { type auditServiceClient struct {
cc grpc.ClientConnInterface cc grpc.ClientConnInterface
} }
func NewEventRecorderClient(cc grpc.ClientConnInterface) EventRecorderClient { func NewAuditServiceClient(cc grpc.ClientConnInterface) AuditServiceClient {
return &eventRecorderClient{cc} return &auditServiceClient{cc}
} }
func (c *eventRecorderClient) RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error) { func (c *auditServiceClient) RecordEvent(ctx context.Context, in *RecordEventRequest, opts ...grpc.CallOption) (*RecordEventResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RecordEventResponse) 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 { if err != nil {
return nil, err return nil, err
} }
return out, nil return out, nil
} }
// EventRecorderServer is the http API for EventRecorder service. // AuditServiceServer is the server API for AuditService service.
// All implementations must embed UnimplementedEventRecorderServer // All implementations must embed UnimplementedAuditServiceServer
// for forward compatibility. // for forward compatibility
type EventRecorderServer interface { type AuditServiceServer interface {
RecordEvent(context.Context, *RecordEventRequest) (*RecordEventResponse, error) RecordEvent(context.Context, *RecordEventRequest) (*RecordEventResponse, error)
mustEmbedUnimplementedEventRecorderServer() mustEmbedUnimplementedAuditServiceServer()
} }
// UnimplementedEventRecorderServer must be embedded to have // UnimplementedAuditServiceServer must be embedded to have forward compatible implementations.
// forward compatible implementations. type UnimplementedAuditServiceServer struct {
// }
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedEventRecorderServer 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") return nil, status.Errorf(codes.Unimplemented, "method RecordEvent not implemented")
} }
func (UnimplementedEventRecorderServer) mustEmbedUnimplementedEventRecorderServer() {} func (UnimplementedAuditServiceServer) mustEmbedUnimplementedAuditServiceServer() {}
func (UnimplementedEventRecorderServer) testEmbeddedByValue() {}
// UnsafeEventRecorderServer may be embedded to opt out of forward compatibility for this service. // UnsafeAuditServiceServer 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 // Use of this interface is not recommended, as added methods to AuditServiceServer will
// result in compilation errors. // result in compilation errors.
type UnsafeEventRecorderServer interface { type UnsafeAuditServiceServer interface {
mustEmbedUnimplementedEventRecorderServer() mustEmbedUnimplementedAuditServiceServer()
} }
func RegisterEventRecorderServer(s grpc.ServiceRegistrar, srv EventRecorderServer) { func RegisterAuditServiceServer(s grpc.ServiceRegistrar, srv AuditServiceServer) {
// If the following call pancis, it indicates UnimplementedEventRecorderServer was s.RegisterService(&AuditService_ServiceDesc, srv)
// 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 _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) in := new(RecordEventRequest)
if err := dec(in); err != nil { if err := dec(in); err != nil {
return nil, err return nil, err
} }
if interceptor == nil { if interceptor == nil {
return srv.(EventRecorderServer).RecordEvent(ctx, in) return srv.(AuditServiceServer).RecordEvent(ctx, in)
} }
info := &grpc.UnaryServerInfo{ info := &grpc.UnaryServerInfo{
Server: srv, Server: srv,
FullMethod: EventRecorder_RecordEvent_FullMethodName, FullMethod: "/proto.AuditService/RecordEvent",
} }
handler := func(ctx context.Context, req interface{}) (interface{}, error) { 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) 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, // It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy) // and not to be introspected or modified (even as a copy)
var EventRecorder_ServiceDesc = grpc.ServiceDesc{ var AuditService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proto.EventRecorder", ServiceName: "proto.AuditService",
HandlerType: (*EventRecorderServer)(nil), HandlerType: (*AuditServiceServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{ {
MethodName: "RecordEvent", MethodName: "RecordEvent",
Handler: _EventRecorder_RecordEvent_Handler, Handler: _AuditService_RecordEvent_Handler,
}, },
}, },
Streams: []grpc.StreamDesc{}, Streams: []grpc.StreamDesc{},