Update protobuf definitions: 92ae9a7a

By allanger

Commit link: 92ae9a7a1b

Pipeline link: https://ci.badhouseplants.net/repos/34/pipeline/64
This commit is contained in:
2026-05-10 17:03:41 +00:00
parent fc9f6fe537
commit d06c827862
2 changed files with 193 additions and 130 deletions

View File

@@ -488,10 +488,11 @@ const file_accounts_v1_accounts_v1_proto_rawDesc = "" +
"\bverified\x18\x01 \x01(\bR\bverified\"4\n" +
"\x13RefreshTokenRequest\x12\x1d\n" +
"\n" +
"session_id\x18\x01 \x01(\tR\tsessionId2\xbe\x02\n" +
"\x18AccountManagementService\x12>\n" +
"session_id\x18\x01 \x01(\tR\tsessionId2\x97\x01\n" +
"\x15PublicAccountsService\x12>\n" +
"\x06SignIn\x12\x1a.accounts.v1.SignInRequest\x1a\x16.google.protobuf.Empty\"\x00\x12>\n" +
"\x06SignUp\x12\x1a.accounts.v1.SignUpRequest\x1a\x16.google.protobuf.Empty\"\x00\x12^\n" +
"\x06SignUp\x12\x1a.accounts.v1.SignUpRequest\x1a\x16.google.protobuf.Empty\"\x002\xb5\x01\n" +
"\x0fAccountsService\x12^\n" +
"\x0fIsEmailVerified\x12#.accounts.v1.IsEmailVerifiedRequest\x1a$.accounts.v1.IsEmailVerifiedResponse\"\x00\x12B\n" +
"\x0eRefreshSession\x12\x16.google.protobuf.Empty\x1a\x16.google.protobuf.Empty\"\x00BIZGgitea.badhouseplants.net/softplayer/softplayer-go-proto/pkg/accounts/v1b\x06proto3"
@@ -525,14 +526,14 @@ var file_accounts_v1_accounts_v1_proto_depIdxs = []int32{
1, // 1: accounts.v1.NewPasswordRequest.data:type_name -> accounts.v1.AccountData
0, // 2: accounts.v1.NewPasswordRequest.password:type_name -> accounts.v1.AccountPassword
1, // 3: accounts.v1.IsEmailVerifiedRequest.data:type_name -> accounts.v1.AccountData
3, // 4: accounts.v1.AccountManagementService.SignIn:input_type -> accounts.v1.SignInRequest
2, // 5: accounts.v1.AccountManagementService.SignUp:input_type -> accounts.v1.SignUpRequest
6, // 6: accounts.v1.AccountManagementService.IsEmailVerified:input_type -> accounts.v1.IsEmailVerifiedRequest
9, // 7: accounts.v1.AccountManagementService.RefreshSession:input_type -> google.protobuf.Empty
9, // 8: accounts.v1.AccountManagementService.SignIn:output_type -> google.protobuf.Empty
9, // 9: accounts.v1.AccountManagementService.SignUp:output_type -> google.protobuf.Empty
7, // 10: accounts.v1.AccountManagementService.IsEmailVerified:output_type -> accounts.v1.IsEmailVerifiedResponse
9, // 11: accounts.v1.AccountManagementService.RefreshSession:output_type -> google.protobuf.Empty
3, // 4: accounts.v1.PublicAccountsService.SignIn:input_type -> accounts.v1.SignInRequest
2, // 5: accounts.v1.PublicAccountsService.SignUp:input_type -> accounts.v1.SignUpRequest
6, // 6: accounts.v1.AccountsService.IsEmailVerified:input_type -> accounts.v1.IsEmailVerifiedRequest
9, // 7: accounts.v1.AccountsService.RefreshSession:input_type -> google.protobuf.Empty
9, // 8: accounts.v1.PublicAccountsService.SignIn:output_type -> google.protobuf.Empty
9, // 9: accounts.v1.PublicAccountsService.SignUp:output_type -> google.protobuf.Empty
7, // 10: accounts.v1.AccountsService.IsEmailVerified:output_type -> accounts.v1.IsEmailVerifiedResponse
9, // 11: accounts.v1.AccountsService.RefreshSession:output_type -> google.protobuf.Empty
8, // [8:12] is the sub-list for method output_type
4, // [4:8] is the sub-list for method input_type
4, // [4:4] is the sub-list for extension type_name
@@ -553,7 +554,7 @@ func file_accounts_v1_accounts_v1_proto_init() {
NumEnums: 0,
NumMessages: 9,
NumExtensions: 0,
NumServices: 1,
NumServices: 2,
},
GoTypes: file_accounts_v1_accounts_v1_proto_goTypes,
DependencyIndexes: file_accounts_v1_accounts_v1_proto_depIdxs,

View File

@@ -22,225 +22,287 @@ import (
const _ = grpc.SupportPackageIsVersion9
const (
AccountManagementService_SignIn_FullMethodName = "/accounts.v1.AccountManagementService/SignIn"
AccountManagementService_SignUp_FullMethodName = "/accounts.v1.AccountManagementService/SignUp"
AccountManagementService_IsEmailVerified_FullMethodName = "/accounts.v1.AccountManagementService/IsEmailVerified"
AccountManagementService_RefreshSession_FullMethodName = "/accounts.v1.AccountManagementService/RefreshSession"
PublicAccountsService_SignIn_FullMethodName = "/accounts.v1.PublicAccountsService/SignIn"
PublicAccountsService_SignUp_FullMethodName = "/accounts.v1.PublicAccountsService/SignUp"
)
// AccountManagementServiceClient is the client API for AccountManagementService service.
// PublicAccountsServiceClient is the client API for PublicAccountsService 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.
//
// *
// Service for handling accounts that do not require authentication
type AccountManagementServiceClient interface {
type PublicAccountsServiceClient interface {
// Sing in into an existing account
SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Create a new account
SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
// Is email for the current account verified
IsEmailVerified(ctx context.Context, in *IsEmailVerifiedRequest, opts ...grpc.CallOption) (*IsEmailVerifiedResponse, error)
RefreshSession(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type accountManagementServiceClient struct {
type publicAccountsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAccountManagementServiceClient(cc grpc.ClientConnInterface) AccountManagementServiceClient {
return &accountManagementServiceClient{cc}
func NewPublicAccountsServiceClient(cc grpc.ClientConnInterface) PublicAccountsServiceClient {
return &publicAccountsServiceClient{cc}
}
func (c *accountManagementServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *publicAccountsServiceClient) SignIn(ctx context.Context, in *SignInRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, AccountManagementService_SignIn_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, PublicAccountsService_SignIn_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountManagementServiceClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
func (c *publicAccountsServiceClient) SignUp(ctx context.Context, in *SignUpRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, AccountManagementService_SignUp_FullMethodName, in, out, cOpts...)
err := c.cc.Invoke(ctx, PublicAccountsService_SignUp_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountManagementServiceClient) IsEmailVerified(ctx context.Context, in *IsEmailVerifiedRequest, opts ...grpc.CallOption) (*IsEmailVerifiedResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(IsEmailVerifiedResponse)
err := c.cc.Invoke(ctx, AccountManagementService_IsEmailVerified_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountManagementServiceClient) RefreshSession(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, AccountManagementService_RefreshSession_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AccountManagementServiceServer is the server API for AccountManagementService service.
// All implementations should embed UnimplementedAccountManagementServiceServer
// PublicAccountsServiceServer is the server API for PublicAccountsService service.
// All implementations should embed UnimplementedPublicAccountsServiceServer
// for forward compatibility.
//
// *
// Service for handling accounts that do not require authentication
type AccountManagementServiceServer interface {
type PublicAccountsServiceServer interface {
// Sing in into an existing account
SignIn(context.Context, *SignInRequest) (*emptypb.Empty, error)
// Create a new account
SignUp(context.Context, *SignUpRequest) (*emptypb.Empty, error)
// Is email for the current account verified
IsEmailVerified(context.Context, *IsEmailVerifiedRequest) (*IsEmailVerifiedResponse, error)
RefreshSession(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
}
// UnimplementedAccountManagementServiceServer should be embedded to have
// UnimplementedPublicAccountsServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAccountManagementServiceServer struct{}
type UnimplementedPublicAccountsServiceServer struct{}
func (UnimplementedAccountManagementServiceServer) SignIn(context.Context, *SignInRequest) (*emptypb.Empty, error) {
func (UnimplementedPublicAccountsServiceServer) SignIn(context.Context, *SignInRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method SignIn not implemented")
}
func (UnimplementedAccountManagementServiceServer) SignUp(context.Context, *SignUpRequest) (*emptypb.Empty, error) {
func (UnimplementedPublicAccountsServiceServer) SignUp(context.Context, *SignUpRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method SignUp not implemented")
}
func (UnimplementedAccountManagementServiceServer) IsEmailVerified(context.Context, *IsEmailVerifiedRequest) (*IsEmailVerifiedResponse, error) {
return nil, status.Error(codes.Unimplemented, "method IsEmailVerified not implemented")
}
func (UnimplementedAccountManagementServiceServer) RefreshSession(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method RefreshSession not implemented")
}
func (UnimplementedAccountManagementServiceServer) testEmbeddedByValue() {}
func (UnimplementedPublicAccountsServiceServer) testEmbeddedByValue() {}
// UnsafeAccountManagementServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AccountManagementServiceServer will
// UnsafePublicAccountsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to PublicAccountsServiceServer will
// result in compilation errors.
type UnsafeAccountManagementServiceServer interface {
mustEmbedUnimplementedAccountManagementServiceServer()
type UnsafePublicAccountsServiceServer interface {
mustEmbedUnimplementedPublicAccountsServiceServer()
}
func RegisterAccountManagementServiceServer(s grpc.ServiceRegistrar, srv AccountManagementServiceServer) {
// If the following call panics, it indicates UnimplementedAccountManagementServiceServer was
func RegisterPublicAccountsServiceServer(s grpc.ServiceRegistrar, srv PublicAccountsServiceServer) {
// If the following call panics, it indicates UnimplementedPublicAccountsServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&AccountManagementService_ServiceDesc, srv)
s.RegisterService(&PublicAccountsService_ServiceDesc, srv)
}
func _AccountManagementService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _PublicAccountsService_SignIn_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignInRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountManagementServiceServer).SignIn(ctx, in)
return srv.(PublicAccountsServiceServer).SignIn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountManagementService_SignIn_FullMethodName,
FullMethod: PublicAccountsService_SignIn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountManagementServiceServer).SignIn(ctx, req.(*SignInRequest))
return srv.(PublicAccountsServiceServer).SignIn(ctx, req.(*SignInRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountManagementService_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
func _PublicAccountsService_SignUp_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SignUpRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountManagementServiceServer).SignUp(ctx, in)
return srv.(PublicAccountsServiceServer).SignUp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountManagementService_SignUp_FullMethodName,
FullMethod: PublicAccountsService_SignUp_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountManagementServiceServer).SignUp(ctx, req.(*SignUpRequest))
return srv.(PublicAccountsServiceServer).SignUp(ctx, req.(*SignUpRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountManagementService_IsEmailVerified_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IsEmailVerifiedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountManagementServiceServer).IsEmailVerified(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountManagementService_IsEmailVerified_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountManagementServiceServer).IsEmailVerified(ctx, req.(*IsEmailVerifiedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountManagementService_RefreshSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountManagementServiceServer).RefreshSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountManagementService_RefreshSession_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountManagementServiceServer).RefreshSession(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
// AccountManagementService_ServiceDesc is the grpc.ServiceDesc for AccountManagementService service.
// PublicAccountsService_ServiceDesc is the grpc.ServiceDesc for PublicAccountsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AccountManagementService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "accounts.v1.AccountManagementService",
HandlerType: (*AccountManagementServiceServer)(nil),
var PublicAccountsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "accounts.v1.PublicAccountsService",
HandlerType: (*PublicAccountsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SignIn",
Handler: _AccountManagementService_SignIn_Handler,
Handler: _PublicAccountsService_SignIn_Handler,
},
{
MethodName: "SignUp",
Handler: _AccountManagementService_SignUp_Handler,
},
{
MethodName: "IsEmailVerified",
Handler: _AccountManagementService_IsEmailVerified_Handler,
},
{
MethodName: "RefreshSession",
Handler: _AccountManagementService_RefreshSession_Handler,
Handler: _PublicAccountsService_SignUp_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "accounts/v1/accounts_v1.proto",
}
const (
AccountsService_IsEmailVerified_FullMethodName = "/accounts.v1.AccountsService/IsEmailVerified"
AccountsService_RefreshSession_FullMethodName = "/accounts.v1.AccountsService/RefreshSession"
)
// AccountsServiceClient is the client API for AccountsService service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type AccountsServiceClient interface {
// Is email for the current account verified
IsEmailVerified(ctx context.Context, in *IsEmailVerifiedRequest, opts ...grpc.CallOption) (*IsEmailVerifiedResponse, error)
RefreshSession(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error)
}
type accountsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewAccountsServiceClient(cc grpc.ClientConnInterface) AccountsServiceClient {
return &accountsServiceClient{cc}
}
func (c *accountsServiceClient) IsEmailVerified(ctx context.Context, in *IsEmailVerifiedRequest, opts ...grpc.CallOption) (*IsEmailVerifiedResponse, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(IsEmailVerifiedResponse)
err := c.cc.Invoke(ctx, AccountsService_IsEmailVerified_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *accountsServiceClient) RefreshSession(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*emptypb.Empty, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(emptypb.Empty)
err := c.cc.Invoke(ctx, AccountsService_RefreshSession_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// AccountsServiceServer is the server API for AccountsService service.
// All implementations should embed UnimplementedAccountsServiceServer
// for forward compatibility.
type AccountsServiceServer interface {
// Is email for the current account verified
IsEmailVerified(context.Context, *IsEmailVerifiedRequest) (*IsEmailVerifiedResponse, error)
RefreshSession(context.Context, *emptypb.Empty) (*emptypb.Empty, error)
}
// UnimplementedAccountsServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAccountsServiceServer struct{}
func (UnimplementedAccountsServiceServer) IsEmailVerified(context.Context, *IsEmailVerifiedRequest) (*IsEmailVerifiedResponse, error) {
return nil, status.Error(codes.Unimplemented, "method IsEmailVerified not implemented")
}
func (UnimplementedAccountsServiceServer) RefreshSession(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method RefreshSession not implemented")
}
func (UnimplementedAccountsServiceServer) testEmbeddedByValue() {}
// UnsafeAccountsServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AccountsServiceServer will
// result in compilation errors.
type UnsafeAccountsServiceServer interface {
mustEmbedUnimplementedAccountsServiceServer()
}
func RegisterAccountsServiceServer(s grpc.ServiceRegistrar, srv AccountsServiceServer) {
// If the following call panics, it indicates UnimplementedAccountsServiceServer was
// embedded by pointer and is nil. This will cause panics if an
// unimplemented method is ever invoked, so we test this at initialization
// time to prevent it from happening at runtime later due to I/O.
if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
t.testEmbeddedByValue()
}
s.RegisterService(&AccountsService_ServiceDesc, srv)
}
func _AccountsService_IsEmailVerified_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(IsEmailVerifiedRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountsServiceServer).IsEmailVerified(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountsService_IsEmailVerified_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountsServiceServer).IsEmailVerified(ctx, req.(*IsEmailVerifiedRequest))
}
return interceptor(ctx, in, info, handler)
}
func _AccountsService_RefreshSession_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(emptypb.Empty)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(AccountsServiceServer).RefreshSession(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountsService_RefreshSession_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountsServiceServer).RefreshSession(ctx, req.(*emptypb.Empty))
}
return interceptor(ctx, in, info, handler)
}
// AccountsService_ServiceDesc is the grpc.ServiceDesc for AccountsService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AccountsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "accounts.v1.AccountsService",
HandlerType: (*AccountsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "IsEmailVerified",
Handler: _AccountsService_IsEmailVerified_Handler,
},
{
MethodName: "RefreshSession",
Handler: _AccountsService_RefreshSession_Handler,
},
},
Streams: []grpc.StreamDesc{},