Files
softplayer-go-proto/pkg/accounts/v1/accounts_v1_grpc.pb.go

351 lines
14 KiB
Go

/// Protobuf definitions for the accounts service.
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.2
// - protoc (unknown)
// source: accounts/v1/accounts_v1.proto
package v1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
emptypb "google.golang.org/protobuf/types/known/emptypb"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.64.0 or later.
const _ = grpc.SupportPackageIsVersion9
const (
PublicAccountsService_SignIn_FullMethodName = "/accounts.v1.PublicAccountsService/SignIn"
PublicAccountsService_SignUp_FullMethodName = "/accounts.v1.PublicAccountsService/SignUp"
)
// 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 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)
}
type publicAccountsServiceClient struct {
cc grpc.ClientConnInterface
}
func NewPublicAccountsServiceClient(cc grpc.ClientConnInterface) PublicAccountsServiceClient {
return &publicAccountsServiceClient{cc}
}
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, PublicAccountsService_SignIn_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
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, PublicAccountsService_SignUp_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// 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 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)
}
// 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 UnimplementedPublicAccountsServiceServer struct{}
func (UnimplementedPublicAccountsServiceServer) SignIn(context.Context, *SignInRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method SignIn not implemented")
}
func (UnimplementedPublicAccountsServiceServer) SignUp(context.Context, *SignUpRequest) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method SignUp not implemented")
}
func (UnimplementedPublicAccountsServiceServer) testEmbeddedByValue() {}
// 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 UnsafePublicAccountsServiceServer interface {
mustEmbedUnimplementedPublicAccountsServiceServer()
}
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(&PublicAccountsService_ServiceDesc, srv)
}
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.(PublicAccountsServiceServer).SignIn(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PublicAccountsService_SignIn_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PublicAccountsServiceServer).SignIn(ctx, req.(*SignInRequest))
}
return interceptor(ctx, in, info, handler)
}
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.(PublicAccountsServiceServer).SignUp(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: PublicAccountsService_SignUp_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(PublicAccountsServiceServer).SignUp(ctx, req.(*SignUpRequest))
}
return interceptor(ctx, in, info, handler)
}
// 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 PublicAccountsService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "accounts.v1.PublicAccountsService",
HandlerType: (*PublicAccountsServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "SignIn",
Handler: _PublicAccountsService_SignIn_Handler,
},
{
MethodName: "SignUp",
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"
AccountsService_TokenAuthorization_FullMethodName = "/accounts.v1.AccountsService/TokenAuthorization"
)
// 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)
// Authorize using long living tokens
TokenAuthorization(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
}
func (c *accountsServiceClient) TokenAuthorization(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_TokenAuthorization_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)
// Authorize using long living tokens
TokenAuthorization(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) TokenAuthorization(context.Context, *emptypb.Empty) (*emptypb.Empty, error) {
return nil, status.Error(codes.Unimplemented, "method TokenAuthorization 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)
}
func _AccountsService_TokenAuthorization_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).TokenAuthorization(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: AccountsService_TokenAuthorization_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(AccountsServiceServer).TokenAuthorization(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,
},
{
MethodName: "TokenAuthorization",
Handler: _AccountsService_TokenAuthorization_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "accounts/v1/accounts_v1.proto",
}