Realm operations now available in authkit

This commit is contained in:
LittleSheep 2024-10-31 22:08:51 +08:00
parent 2b4f71e732
commit c3619f6d25
7 changed files with 295 additions and 129 deletions

View File

@ -4,9 +4,14 @@
<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=":technologist: Improve DX by extending authkit"> <list default="true" id="3fefb2c4-b6f9-466b-a523-53352e8d6f95" name="更改" comment=":sparkles: Add list relative method into authkit">
<change afterPath="$PROJECT_DIR$/pkg/authkit/relative.go" afterDir="false" /> <change afterPath="$PROJECT_DIR$/pkg/authkit/realm.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/authkit/models/realms.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/authkit/models/realms.go" afterDir="false" />
<change beforePath="$PROJECT_DIR$/pkg/internal/grpc/realms.go" beforeDir="false" afterPath="$PROJECT_DIR$/pkg/internal/grpc/realms.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" />
</list> </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" />
@ -140,7 +145,7 @@
<entry key="branch"> <entry key="branch">
<value> <value>
<list> <list>
<option value="refactor/nexus" /> <option value="master" />
</list> </list>
</value> </value>
</entry> </entry>
@ -154,7 +159,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: Improve notifications mark read system" />
<MESSAGE value=":bug: Bug fixes on multi-factors based authentication" /> <MESSAGE value=":bug: Bug fixes on multi-factors based authentication" />
<MESSAGE value=":bug: Bug fixes on settings auth preferences" /> <MESSAGE value=":bug: Bug fixes on settings auth preferences" />
<MESSAGE value=":sparkles: Implement event recorder grpc" /> <MESSAGE value=":sparkles: Implement event recorder grpc" />
@ -179,7 +183,8 @@
<MESSAGE value=":truck: Update package name from Hypdrogen to Hypernet" /> <MESSAGE value=":truck: Update package name from Hypdrogen to Hypernet" />
<MESSAGE value=":sparkles: Support users related rpc calls" /> <MESSAGE value=":sparkles: Support users related rpc calls" />
<MESSAGE value=":technologist: Improve DX by extending authkit" /> <MESSAGE value=":technologist: Improve DX by extending authkit" />
<option name="LAST_COMMIT_MESSAGE" value=":technologist: Improve DX by extending authkit" /> <MESSAGE value=":sparkles: Add list relative method into authkit" />
<option name="LAST_COMMIT_MESSAGE" value=":sparkles: Add list relative method into authkit" />
<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">

View File

@ -1,6 +1,10 @@
package models package models
import "gorm.io/datatypes" import (
"git.solsynth.dev/hypernet/nexus/pkg/nex"
"git.solsynth.dev/hypernet/passport/pkg/proto"
"gorm.io/datatypes"
)
type Realm struct { type Realm struct {
BaseModel BaseModel
@ -17,6 +21,22 @@ type Realm struct {
AccountID uint `json:"account_id"` AccountID uint `json:"account_id"`
} }
func NewRealmFromProto(proto *proto.RealmInfo) Realm {
return Realm{
BaseModel: BaseModel{
ID: uint(proto.GetId()),
},
Alias: proto.GetAlias(),
Name: proto.GetName(),
Description: proto.GetDescription(),
Avatar: &proto.Avatar,
Banner: &proto.Banner,
IsPublic: proto.GetIsPublic(),
IsCommunity: proto.GetIsCommunity(),
AccessPolicy: nex.DecodeMap(proto.GetAccessPolicy()),
}
}
type RealmMember struct { type RealmMember struct {
BaseModel BaseModel
@ -26,3 +46,14 @@ type RealmMember struct {
Account Account `json:"account"` Account Account `json:"account"`
PowerLevel int `json:"power_level"` PowerLevel int `json:"power_level"`
} }
func NewRealmMemberFromProto(proto *proto.RealmMemberInfo) RealmMember {
return RealmMember{
BaseModel: BaseModel{
ID: uint(proto.GetId()),
},
RealmID: uint(proto.GetRealmId()),
AccountID: uint(proto.GetUserId()),
PowerLevel: int(proto.GetPowerLevel()),
}
}

108
pkg/authkit/realm.go Normal file
View File

@ -0,0 +1,108 @@
package authkit
import (
"git.solsynth.dev/hypernet/nexus/pkg/nex"
"git.solsynth.dev/hypernet/passport/pkg/authkit/models"
"git.solsynth.dev/hypernet/passport/pkg/proto"
"github.com/samber/lo"
)
func GetRealm(nx *nex.Conn, id uint) (models.Realm, error) {
var realm models.Realm
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
if err != nil {
return realm, err
}
resp, err := proto.NewRealmServiceClient(conn).GetRealm(nil, &proto.LookupRealmRequest{
Id: lo.ToPtr(uint64(id)),
})
if err != nil {
return realm, err
}
return models.NewRealmFromProto(resp), nil
}
func GetRealmByAlias(nx *nex.Conn, alias string) (models.Realm, error) {
var realm models.Realm
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
if err != nil {
return realm, err
}
resp, err := proto.NewRealmServiceClient(conn).GetRealm(nil, &proto.LookupRealmRequest{
Alias: &alias,
})
if err != nil {
return realm, err
}
return models.NewRealmFromProto(resp), nil
}
func ListRealm(nx *nex.Conn, id []uint) ([]models.Realm, error) {
var realms []models.Realm
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
if err != nil {
return realms, err
}
resp, err := proto.NewRealmServiceClient(conn).ListRealm(nil, &proto.ListRealmRequest{
Id: lo.Map(id, func(item uint, _ int) uint64 {
return uint64(item)
}),
})
if err != nil {
return realms, err
}
for _, realm := range resp.GetData() {
realms = append(realms, models.NewRealmFromProto(realm))
}
return realms, nil
}
func GetRealmMember(nx *nex.Conn, realmID, userID uint) (models.RealmMember, error) {
var member models.RealmMember
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
if err != nil {
return member, err
}
resp, err := proto.NewRealmServiceClient(conn).GetRealmMember(nil, &proto.RealmMemberLookupRequest{
RealmId: lo.ToPtr(uint64(realmID)),
UserId: lo.ToPtr(uint64(userID)),
})
if err != nil {
return member, err
}
return models.NewRealmMemberFromProto(resp), nil
}
func ListRealmMember(nx *nex.Conn, realmID uint) ([]models.RealmMember, error) {
var members []models.RealmMember
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
if err != nil {
return members, err
}
resp, err := proto.NewRealmServiceClient(conn).ListRealmMember(nil, &proto.RealmMemberLookupRequest{
RealmId: lo.ToPtr(uint64(realmID)),
})
if err != nil {
return members, err
}
for _, member := range resp.GetData() {
members = append(members, models.NewRealmMemberFromProto(member))
}
return members, nil
}
func CheckRealmMemberPerm(nx *nex.Conn, realmID uint, userID, power int) bool {
conn, err := nx.GetClientGrpcConn(nex.ServiceTypeAuth)
if err != nil {
return false
}
resp, err := proto.NewRealmServiceClient(conn).CheckRealmMemberPerm(nil, &proto.CheckRealmPermRequest{
RealmId: uint64(realmID),
UserId: uint64(userID),
PowerLevel: int32(power),
})
if err != nil {
return false
}
return resp.GetIsSuccess()
}

View File

@ -12,34 +12,6 @@ import (
"github.com/samber/lo" "github.com/samber/lo"
) )
func (v *App) ListCommunityRealm(ctx context.Context, empty *proto.ListRealmRequest) (*proto.ListRealmResponse, error) {
realms, err := services.ListCommunityRealm()
if err != nil {
return nil, err
}
return &proto.ListRealmResponse{
Data: lo.Map(realms, func(item models.Realm, index int) *proto.RealmInfo {
info := &proto.RealmInfo{
Id: uint64(item.ID),
Alias: item.Alias,
Name: item.Name,
Description: item.Description,
IsPublic: item.IsPublic,
IsCommunity: item.IsCommunity,
AccessPolicy: nex.EncodeMap(item.AccessPolicy),
}
if item.Avatar != nil {
info.Avatar = *item.Avatar
}
if item.Banner != nil {
info.Banner = *item.Banner
}
return info
}),
}, nil
}
func (v *App) ListAvailableRealm(ctx context.Context, request *proto.LookupUserRealmRequest) (*proto.ListRealmResponse, error) { func (v *App) ListAvailableRealm(ctx context.Context, request *proto.LookupUserRealmRequest) (*proto.ListRealmResponse, error) {
account, err := services.GetAccount(uint(request.GetUserId())) account, err := services.GetAccount(uint(request.GetUserId()))
if err != nil { if err != nil {
@ -104,6 +76,34 @@ func (v *App) ListOwnedRealm(ctx context.Context, request *proto.LookupUserRealm
}, nil }, nil
} }
func (v *App) ListRealm(ctx context.Context, request *proto.ListRealmRequest) (*proto.ListRealmResponse, error) {
var realms []models.Realm
if err := database.C.Where("id IN ?", request.GetId()).Find(&realms).Error; err != nil {
return nil, err
}
return &proto.ListRealmResponse{
Data: lo.Map(realms, func(item models.Realm, index int) *proto.RealmInfo {
info := &proto.RealmInfo{
Id: uint64(item.ID),
Alias: item.Alias,
Name: item.Name,
Description: item.Description,
IsPublic: item.IsPublic,
IsCommunity: item.IsCommunity,
AccessPolicy: nex.EncodeMap(item.AccessPolicy),
}
if item.Avatar != nil {
info.Avatar = *item.Avatar
}
if item.Banner != nil {
info.Banner = *item.Banner
}
return info
}),
}, nil
}
func (v *App) GetRealm(ctx context.Context, request *proto.LookupRealmRequest) (*proto.RealmInfo, error) { func (v *App) GetRealm(ctx context.Context, request *proto.LookupRealmRequest) (*proto.RealmInfo, error) {
var realm models.Realm var realm models.Realm
@ -163,6 +163,7 @@ func (v *App) ListRealmMember(ctx context.Context, request *proto.RealmMemberLoo
return &proto.ListRealmMemberResponse{ return &proto.ListRealmMemberResponse{
Data: lo.Map(members, func(item models.RealmMember, index int) *proto.RealmMemberInfo { Data: lo.Map(members, func(item models.RealmMember, index int) *proto.RealmMemberInfo {
return &proto.RealmMemberInfo{ return &proto.RealmMemberInfo{
Id: uint64(item.ID),
RealmId: uint64(item.RealmID), RealmId: uint64(item.RealmID),
UserId: uint64(item.AccountID), UserId: uint64(item.AccountID),
PowerLevel: int32(item.PowerLevel), PowerLevel: int32(item.PowerLevel),
@ -189,6 +190,7 @@ func (v *App) GetRealmMember(ctx context.Context, request *proto.RealmMemberLook
} }
return &proto.RealmMemberInfo{ return &proto.RealmMemberInfo{
Id: uint64(member.ID),
RealmId: uint64(member.RealmID), RealmId: uint64(member.RealmID),
UserId: uint64(member.AccountID), UserId: uint64(member.AccountID),
PowerLevel: int32(member.PowerLevel), PowerLevel: int32(member.PowerLevel),

View File

@ -133,6 +133,8 @@ type ListRealmRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
Id []uint64 `protobuf:"varint,1,rep,packed,name=id,proto3" json:"id,omitempty"`
} }
func (x *ListRealmRequest) Reset() { func (x *ListRealmRequest) Reset() {
@ -165,6 +167,13 @@ func (*ListRealmRequest) Descriptor() ([]byte, []int) {
return file_realm_proto_rawDescGZIP(), []int{1} return file_realm_proto_rawDescGZIP(), []int{1}
} }
func (x *ListRealmRequest) GetId() []uint64 {
if x != nil {
return x.Id
}
return nil
}
type LookupUserRealmRequest struct { type LookupUserRealmRequest struct {
state protoimpl.MessageState state protoimpl.MessageState
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
@ -382,9 +391,10 @@ type RealmMemberInfo struct {
sizeCache protoimpl.SizeCache sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
RealmId uint64 `protobuf:"varint,1,opt,name=realm_id,json=realmId,proto3" json:"realm_id,omitempty"` Id uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
UserId uint64 `protobuf:"varint,2,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"` RealmId uint64 `protobuf:"varint,2,opt,name=realm_id,json=realmId,proto3" json:"realm_id,omitempty"`
PowerLevel int32 `protobuf:"varint,3,opt,name=power_level,json=powerLevel,proto3" json:"power_level,omitempty"` UserId uint64 `protobuf:"varint,3,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
PowerLevel int32 `protobuf:"varint,4,opt,name=power_level,json=powerLevel,proto3" json:"power_level,omitempty"`
} }
func (x *RealmMemberInfo) Reset() { func (x *RealmMemberInfo) Reset() {
@ -417,6 +427,13 @@ func (*RealmMemberInfo) Descriptor() ([]byte, []int) {
return file_realm_proto_rawDescGZIP(), []int{6} return file_realm_proto_rawDescGZIP(), []int{6}
} }
func (x *RealmMemberInfo) GetId() uint64 {
if x != nil {
return x.Id
}
return 0
}
func (x *RealmMemberInfo) GetRealmId() uint64 { func (x *RealmMemberInfo) GetRealmId() uint64 {
if x != nil { if x != nil {
return x.RealmId return x.RealmId
@ -609,8 +626,9 @@ var file_realm_proto_rawDesc = []byte{
0x08, 0x52, 0x0b, 0x69, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x12, 0x23, 0x08, 0x52, 0x0b, 0x69, 0x73, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x79, 0x12, 0x23,
0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18, 0x0a, 0x0d, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x5f, 0x70, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x18,
0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c, 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x61, 0x63, 0x63, 0x65, 0x73, 0x73, 0x50, 0x6f, 0x6c,
0x69, 0x63, 0x79, 0x22, 0x12, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x69, 0x63, 0x79, 0x22, 0x22, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d,
0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x31, 0x0a, 0x16, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,
0x03, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x22, 0x31, 0x0a, 0x16, 0x4c, 0x6f, 0x6f, 0x6b, 0x75,
0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,
0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x74, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xbe, 0x01, 0x0a, 0x12, 0x4c, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x22, 0xbe, 0x01, 0x0a, 0x12, 0x4c,
@ -636,13 +654,14 @@ var file_realm_proto_rawDesc = []byte{
0x01, 0x01, 0x12, 0x1c, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x01, 0x12, 0x1c, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20,
0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01, 0x01, 0x28, 0x04, 0x48, 0x01, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x88, 0x01, 0x01,
0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x5f, 0x69, 0x64, 0x42, 0x0a, 0x0a, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x5f, 0x69, 0x64, 0x42, 0x0a, 0x0a,
0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x22, 0x66, 0x0a, 0x0f, 0x52, 0x65, 0x61, 0x08, 0x5f, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x69, 0x64, 0x22, 0x76, 0x0a, 0x0f, 0x52, 0x65, 0x61,
0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x19, 0x0a, 0x08, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x12, 0x0e, 0x0a, 0x02,
0x72, 0x65, 0x61, 0x6c, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x04, 0x52, 0x02, 0x69, 0x64, 0x12, 0x19, 0x0a, 0x08,
0x72, 0x65, 0x61, 0x6c, 0x6d, 0x5f, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07,
0x72, 0x65, 0x61, 0x6c, 0x6d, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x65, 0x61, 0x6c, 0x6d, 0x49, 0x64, 0x12, 0x17, 0x0a, 0x07, 0x75, 0x73, 0x65, 0x72, 0x5f,
0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64, 0x69, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x04, 0x52, 0x06, 0x75, 0x73, 0x65, 0x72, 0x49, 0x64,
0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18,
0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0a, 0x70, 0x6f, 0x77, 0x65, 0x72, 0x4c, 0x65, 0x76, 0x65,
0x6c, 0x22, 0x45, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6c, 0x22, 0x45, 0x0a, 0x17, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65,
0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2a, 0x0a, 0x04,
0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x70, 0x72, 0x6f,
@ -658,43 +677,42 @@ 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,
0xac, 0x04, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0xa3, 0x04, 0x0a, 0x0c, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65,
0x12, 0x49, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x43, 0x6f, 0x6d, 0x6d, 0x75, 0x6e, 0x69, 0x74, 0x12, 0x4f, 0x0a, 0x12, 0x4c, 0x69, 0x73, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c,
0x79, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x65, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c,
0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65,
0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69,
0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4f, 0x0a, 0x12, 0x4c, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x69, 0x73, 0x74, 0x41, 0x76, 0x61, 0x69, 0x6c, 0x61, 0x62, 0x6c, 0x65, 0x52, 0x65, 0x61, 0x6c, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x64, 0x52, 0x65,
0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x61, 0x6c, 0x6d, 0x12, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b,
0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x75, 0x70, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65,
0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52,
0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x40,
0x4c, 0x69, 0x73, 0x74, 0x4f, 0x77, 0x6e, 0x65, 0x64, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x1d, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x17, 0x2e, 0x70, 0x72,
0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x55, 0x73, 0x65, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71,
0x72, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x18, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00,
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x39, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x12, 0x39, 0x0a, 0x08, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x19, 0x2e, 0x70,
0x52, 0x65, 0x61, 0x6c, 0x6d, 0x12, 0x19, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x61, 0x6c, 0x6d,
0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e,
0x1a, 0x10, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x49, 0x6e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x4c,
0x66, 0x6f, 0x22, 0x00, 0x12, 0x54, 0x0a, 0x0f, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f,
0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62,
0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c,
0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x47, 0x65, 0x00, 0x12, 0x4b, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d,
0x74, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x62, 0x65, 0x72, 0x12, 0x1f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c,
0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71,
0x4c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x55,
0x72, 0x49, 0x6e, 0x66, 0x6f, 0x22, 0x00, 0x12, 0x55, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x0a, 0x14, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62,
0x52, 0x65, 0x61, 0x6c, 0x6d, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x12, 0x65, 0x72, 0x50, 0x65, 0x72, 0x6d, 0x12, 0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43,
0x1c, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x71,
0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1d, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x2e, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x63, 0x6b, 0x52, 0x65, 0x61, 0x6c, 0x6d, 0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f,
0x50, 0x65, 0x72, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x6e, 0x73, 0x65, 0x22, 0x00, 0x42, 0x09, 0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f,
0x5a, 0x07, 0x2e, 0x3b, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x33,
} }
var ( var (
@ -725,16 +743,16 @@ 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.RealmService.ListCommunityRealm:input_type -> proto.ListRealmRequest 2, // 2: proto.RealmService.ListAvailableRealm:input_type -> proto.LookupUserRealmRequest
2, // 3: proto.RealmService.ListAvailableRealm:input_type -> proto.LookupUserRealmRequest 2, // 3: proto.RealmService.ListOwnedRealm:input_type -> proto.LookupUserRealmRequest
2, // 4: proto.RealmService.ListOwnedRealm:input_type -> proto.LookupUserRealmRequest 1, // 4: proto.RealmService.ListRealm:input_type -> proto.ListRealmRequest
3, // 5: proto.RealmService.GetRealm:input_type -> proto.LookupRealmRequest 3, // 5: proto.RealmService.GetRealm:input_type -> proto.LookupRealmRequest
5, // 6: proto.RealmService.ListRealmMember:input_type -> proto.RealmMemberLookupRequest 5, // 6: proto.RealmService.ListRealmMember:input_type -> proto.RealmMemberLookupRequest
5, // 7: proto.RealmService.GetRealmMember:input_type -> proto.RealmMemberLookupRequest 5, // 7: proto.RealmService.GetRealmMember:input_type -> proto.RealmMemberLookupRequest
8, // 8: proto.RealmService.CheckRealmMemberPerm:input_type -> proto.CheckRealmPermRequest 8, // 8: proto.RealmService.CheckRealmMemberPerm:input_type -> proto.CheckRealmPermRequest
4, // 9: proto.RealmService.ListCommunityRealm:output_type -> proto.ListRealmResponse 4, // 9: proto.RealmService.ListAvailableRealm:output_type -> proto.ListRealmResponse
4, // 10: proto.RealmService.ListAvailableRealm:output_type -> proto.ListRealmResponse 4, // 10: proto.RealmService.ListOwnedRealm:output_type -> proto.ListRealmResponse
4, // 11: proto.RealmService.ListOwnedRealm:output_type -> proto.ListRealmResponse 4, // 11: proto.RealmService.ListRealm:output_type -> proto.ListRealmResponse
0, // 12: proto.RealmService.GetRealm:output_type -> proto.RealmInfo 0, // 12: proto.RealmService.GetRealm:output_type -> proto.RealmInfo
7, // 13: proto.RealmService.ListRealmMember:output_type -> proto.ListRealmMemberResponse 7, // 13: proto.RealmService.ListRealmMember:output_type -> proto.ListRealmMemberResponse
6, // 14: proto.RealmService.GetRealmMember:output_type -> proto.RealmMemberInfo 6, // 14: proto.RealmService.GetRealmMember:output_type -> proto.RealmMemberInfo

View File

@ -5,9 +5,9 @@ option go_package = ".;proto";
package proto; package proto;
service RealmService { service RealmService {
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) {}
rpc ListRealm(ListRealmRequest) returns (ListRealmResponse) {}
rpc GetRealm(LookupRealmRequest) returns (RealmInfo) {} rpc GetRealm(LookupRealmRequest) returns (RealmInfo) {}
rpc ListRealmMember(RealmMemberLookupRequest) returns (ListRealmMemberResponse) {} rpc ListRealmMember(RealmMemberLookupRequest) returns (ListRealmMemberResponse) {}
rpc GetRealmMember(RealmMemberLookupRequest) returns (RealmMemberInfo) {} rpc GetRealmMember(RealmMemberLookupRequest) returns (RealmMemberInfo) {}
@ -27,6 +27,7 @@ message RealmInfo {
} }
message ListRealmRequest { message ListRealmRequest {
repeated uint64 id = 1;
} }
message LookupUserRealmRequest { message LookupUserRealmRequest {
@ -50,9 +51,10 @@ message RealmMemberLookupRequest {
} }
message RealmMemberInfo { message RealmMemberInfo {
uint64 realm_id = 1; uint64 id = 1;
uint64 user_id = 2; uint64 realm_id = 2;
int32 power_level = 3; uint64 user_id = 3;
int32 power_level = 4;
} }
message ListRealmMemberResponse { message ListRealmMemberResponse {

View File

@ -19,9 +19,9 @@ import (
const _ = grpc.SupportPackageIsVersion9 const _ = grpc.SupportPackageIsVersion9
const ( const (
RealmService_ListCommunityRealm_FullMethodName = "/proto.RealmService/ListCommunityRealm"
RealmService_ListAvailableRealm_FullMethodName = "/proto.RealmService/ListAvailableRealm" RealmService_ListAvailableRealm_FullMethodName = "/proto.RealmService/ListAvailableRealm"
RealmService_ListOwnedRealm_FullMethodName = "/proto.RealmService/ListOwnedRealm" RealmService_ListOwnedRealm_FullMethodName = "/proto.RealmService/ListOwnedRealm"
RealmService_ListRealm_FullMethodName = "/proto.RealmService/ListRealm"
RealmService_GetRealm_FullMethodName = "/proto.RealmService/GetRealm" RealmService_GetRealm_FullMethodName = "/proto.RealmService/GetRealm"
RealmService_ListRealmMember_FullMethodName = "/proto.RealmService/ListRealmMember" RealmService_ListRealmMember_FullMethodName = "/proto.RealmService/ListRealmMember"
RealmService_GetRealmMember_FullMethodName = "/proto.RealmService/GetRealmMember" RealmService_GetRealmMember_FullMethodName = "/proto.RealmService/GetRealmMember"
@ -32,9 +32,9 @@ const (
// //
// 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 RealmServiceClient interface { type RealmServiceClient interface {
ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error)
ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) 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)
ListRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error)
GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error)
ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error) ListRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*ListRealmMemberResponse, error)
GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error) GetRealmMember(ctx context.Context, in *RealmMemberLookupRequest, opts ...grpc.CallOption) (*RealmMemberInfo, error)
@ -49,16 +49,6 @@ func NewRealmServiceClient(cc grpc.ClientConnInterface) RealmServiceClient {
return &realmServiceClient{cc} return &realmServiceClient{cc}
} }
func (c *realmServiceClient) ListCommunityRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRealmResponse)
err := c.cc.Invoke(ctx, RealmService_ListCommunityRealm_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *realmServiceClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) { func (c *realmServiceClient) ListAvailableRealm(ctx context.Context, in *LookupUserRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRealmResponse) out := new(ListRealmResponse)
@ -79,6 +69,16 @@ func (c *realmServiceClient) ListOwnedRealm(ctx context.Context, in *LookupUserR
return out, nil return out, nil
} }
func (c *realmServiceClient) ListRealm(ctx context.Context, in *ListRealmRequest, opts ...grpc.CallOption) (*ListRealmResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(ListRealmResponse)
err := c.cc.Invoke(ctx, RealmService_ListRealm_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *realmServiceClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) { func (c *realmServiceClient) GetRealm(ctx context.Context, in *LookupRealmRequest, opts ...grpc.CallOption) (*RealmInfo, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...) cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(RealmInfo) out := new(RealmInfo)
@ -123,9 +123,9 @@ func (c *realmServiceClient) CheckRealmMemberPerm(ctx context.Context, in *Check
// All implementations must embed UnimplementedRealmServiceServer // All implementations must embed UnimplementedRealmServiceServer
// for forward compatibility. // for forward compatibility.
type RealmServiceServer interface { type RealmServiceServer interface {
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)
ListRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error)
GetRealm(context.Context, *LookupRealmRequest) (*RealmInfo, error) GetRealm(context.Context, *LookupRealmRequest) (*RealmInfo, error)
ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error) ListRealmMember(context.Context, *RealmMemberLookupRequest) (*ListRealmMemberResponse, error)
GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error) GetRealmMember(context.Context, *RealmMemberLookupRequest) (*RealmMemberInfo, error)
@ -140,15 +140,15 @@ type RealmServiceServer interface {
// pointer dereference when methods are called. // pointer dereference when methods are called.
type UnimplementedRealmServiceServer struct{} type UnimplementedRealmServiceServer struct{}
func (UnimplementedRealmServiceServer) ListCommunityRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListCommunityRealm not implemented")
}
func (UnimplementedRealmServiceServer) ListAvailableRealm(context.Context, *LookupUserRealmRequest) (*ListRealmResponse, error) { func (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 (UnimplementedRealmServiceServer) 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 (UnimplementedRealmServiceServer) ListRealm(context.Context, *ListRealmRequest) (*ListRealmResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListRealm not implemented")
}
func (UnimplementedRealmServiceServer) 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")
} }
@ -182,24 +182,6 @@ func RegisterRealmServiceServer(s grpc.ServiceRegistrar, srv RealmServiceServer)
s.RegisterService(&RealmService_ServiceDesc, srv) s.RegisterService(&RealmService_ServiceDesc, srv)
} }
func _RealmService_ListCommunityRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListRealmRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RealmServiceServer).ListCommunityRealm(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RealmService_ListCommunityRealm_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RealmServiceServer).ListCommunityRealm(ctx, req.(*ListRealmRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RealmService_ListAvailableRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _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 {
@ -236,6 +218,24 @@ func _RealmService_ListOwnedRealm_Handler(srv interface{}, ctx context.Context,
return interceptor(ctx, in, info, handler) return interceptor(ctx, in, info, handler)
} }
func _RealmService_ListRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListRealmRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(RealmServiceServer).ListRealm(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: RealmService_ListRealm_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(RealmServiceServer).ListRealm(ctx, req.(*ListRealmRequest))
}
return interceptor(ctx, in, info, handler)
}
func _RealmService_GetRealm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) { func _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 {
@ -315,10 +315,6 @@ var RealmService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "proto.RealmService", ServiceName: "proto.RealmService",
HandlerType: (*RealmServiceServer)(nil), HandlerType: (*RealmServiceServer)(nil),
Methods: []grpc.MethodDesc{ Methods: []grpc.MethodDesc{
{
MethodName: "ListCommunityRealm",
Handler: _RealmService_ListCommunityRealm_Handler,
},
{ {
MethodName: "ListAvailableRealm", MethodName: "ListAvailableRealm",
Handler: _RealmService_ListAvailableRealm_Handler, Handler: _RealmService_ListAvailableRealm_Handler,
@ -327,6 +323,10 @@ var RealmService_ServiceDesc = grpc.ServiceDesc{
MethodName: "ListOwnedRealm", MethodName: "ListOwnedRealm",
Handler: _RealmService_ListOwnedRealm_Handler, Handler: _RealmService_ListOwnedRealm_Handler,
}, },
{
MethodName: "ListRealm",
Handler: _RealmService_ListRealm_Handler,
},
{ {
MethodName: "GetRealm", MethodName: "GetRealm",
Handler: _RealmService_GetRealm_Handler, Handler: _RealmService_GetRealm_Handler,