2024-07-15 14:20:37 +00:00
|
|
|
package grpc
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
"git.solsynth.dev/hydrogen/dealer/pkg/hyper"
|
|
|
|
"git.solsynth.dev/hydrogen/dealer/pkg/proto"
|
|
|
|
"google.golang.org/grpc"
|
|
|
|
)
|
|
|
|
|
|
|
|
func (v *Server) ListCommunityRealm(ctx context.Context, request *proto.ListRealmRequest) (*proto.ListRealmResponse, error) {
|
|
|
|
return forwardInvokeRequest(
|
|
|
|
hyper.ServiceTypeAuthProvider,
|
|
|
|
func(ctx context.Context, conn *grpc.ClientConn) (*proto.ListRealmResponse, error) {
|
|
|
|
out, err := proto.NewRealmClient(conn).ListCommunityRealm(ctx, request)
|
|
|
|
return out, err
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *Server) ListAvailableRealm(ctx context.Context, request *proto.LookupUserRealmRequest) (*proto.ListRealmResponse, error) {
|
|
|
|
return forwardInvokeRequest(
|
|
|
|
hyper.ServiceTypeAuthProvider,
|
|
|
|
func(ctx context.Context, conn *grpc.ClientConn) (*proto.ListRealmResponse, error) {
|
|
|
|
out, err := proto.NewRealmClient(conn).ListAvailableRealm(ctx, request)
|
|
|
|
return out, err
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *Server) ListOwnedRealm(ctx context.Context, request *proto.LookupUserRealmRequest) (*proto.ListRealmResponse, error) {
|
|
|
|
return forwardInvokeRequest(
|
|
|
|
hyper.ServiceTypeAuthProvider,
|
|
|
|
func(ctx context.Context, conn *grpc.ClientConn) (*proto.ListRealmResponse, error) {
|
|
|
|
out, err := proto.NewRealmClient(conn).ListOwnedRealm(ctx, request)
|
|
|
|
return out, err
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *Server) GetRealm(ctx context.Context, request *proto.LookupRealmRequest) (*proto.RealmInfo, error) {
|
|
|
|
return forwardInvokeRequest(
|
|
|
|
hyper.ServiceTypeAuthProvider,
|
|
|
|
func(ctx context.Context, conn *grpc.ClientConn) (*proto.RealmInfo, error) {
|
|
|
|
out, err := proto.NewRealmClient(conn).GetRealm(ctx, request)
|
|
|
|
return out, err
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *Server) ListRealmMember(ctx context.Context, request *proto.RealmMemberLookupRequest) (*proto.ListRealmMemberResponse, error) {
|
|
|
|
return forwardInvokeRequest(
|
|
|
|
hyper.ServiceTypeAuthProvider,
|
|
|
|
func(ctx context.Context, conn *grpc.ClientConn) (*proto.ListRealmMemberResponse, error) {
|
|
|
|
out, err := proto.NewRealmClient(conn).ListRealmMember(ctx, request)
|
|
|
|
return out, err
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
2024-07-16 04:06:03 +00:00
|
|
|
func (v *Server) GetRealmMember(ctx context.Context, request *proto.RealmMemberLookupRequest) (*proto.RealmMemberInfo, error) {
|
2024-07-15 14:20:37 +00:00
|
|
|
return forwardInvokeRequest(
|
|
|
|
hyper.ServiceTypeAuthProvider,
|
2024-07-16 04:06:03 +00:00
|
|
|
func(ctx context.Context, conn *grpc.ClientConn) (*proto.RealmMemberInfo, error) {
|
2024-07-15 14:20:37 +00:00
|
|
|
out, err := proto.NewRealmClient(conn).GetRealmMember(ctx, request)
|
|
|
|
return out, err
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
func (v *Server) CheckRealmMemberPerm(ctx context.Context, request *proto.CheckRealmPermRequest) (*proto.CheckRealmPermResponse, error) {
|
|
|
|
return forwardInvokeRequest(
|
|
|
|
hyper.ServiceTypeAuthProvider,
|
|
|
|
func(ctx context.Context, conn *grpc.ClientConn) (*proto.CheckRealmPermResponse, error) {
|
|
|
|
out, err := proto.NewRealmClient(conn).CheckRealmMemberPerm(ctx, request)
|
|
|
|
return out, err
|
|
|
|
},
|
|
|
|
)
|
|
|
|
}
|