mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-04 04:23:16 +00:00
chore: update subscription service
This commit is contained in:
@ -21,14 +21,19 @@ const _ = grpc.SupportPackageIsVersion9
|
||||
const (
|
||||
SubscriptionService_GetSubscription_FullMethodName = "/slash.api.v1.SubscriptionService/GetSubscription"
|
||||
SubscriptionService_UpdateSubscription_FullMethodName = "/slash.api.v1.SubscriptionService/UpdateSubscription"
|
||||
SubscriptionService_DeleteSubscription_FullMethodName = "/slash.api.v1.SubscriptionService/DeleteSubscription"
|
||||
)
|
||||
|
||||
// SubscriptionServiceClient is the client API for SubscriptionService 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 SubscriptionServiceClient interface {
|
||||
GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*GetSubscriptionResponse, error)
|
||||
UpdateSubscription(ctx context.Context, in *UpdateSubscriptionRequest, opts ...grpc.CallOption) (*UpdateSubscriptionResponse, error)
|
||||
// GetSubscription gets the current subscription of Slash instance.
|
||||
GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
|
||||
// UpdateSubscription updates the subscription.
|
||||
UpdateSubscription(ctx context.Context, in *UpdateSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
|
||||
// DeleteSubscription deletes the subscription.
|
||||
DeleteSubscription(ctx context.Context, in *DeleteSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error)
|
||||
}
|
||||
|
||||
type subscriptionServiceClient struct {
|
||||
@ -39,9 +44,9 @@ func NewSubscriptionServiceClient(cc grpc.ClientConnInterface) SubscriptionServi
|
||||
return &subscriptionServiceClient{cc}
|
||||
}
|
||||
|
||||
func (c *subscriptionServiceClient) GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*GetSubscriptionResponse, error) {
|
||||
func (c *subscriptionServiceClient) GetSubscription(ctx context.Context, in *GetSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(GetSubscriptionResponse)
|
||||
out := new(Subscription)
|
||||
err := c.cc.Invoke(ctx, SubscriptionService_GetSubscription_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -49,9 +54,9 @@ func (c *subscriptionServiceClient) GetSubscription(ctx context.Context, in *Get
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *subscriptionServiceClient) UpdateSubscription(ctx context.Context, in *UpdateSubscriptionRequest, opts ...grpc.CallOption) (*UpdateSubscriptionResponse, error) {
|
||||
func (c *subscriptionServiceClient) UpdateSubscription(ctx context.Context, in *UpdateSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(UpdateSubscriptionResponse)
|
||||
out := new(Subscription)
|
||||
err := c.cc.Invoke(ctx, SubscriptionService_UpdateSubscription_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@ -59,12 +64,26 @@ func (c *subscriptionServiceClient) UpdateSubscription(ctx context.Context, in *
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *subscriptionServiceClient) DeleteSubscription(ctx context.Context, in *DeleteSubscriptionRequest, opts ...grpc.CallOption) (*Subscription, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(Subscription)
|
||||
err := c.cc.Invoke(ctx, SubscriptionService_DeleteSubscription_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
// SubscriptionServiceServer is the server API for SubscriptionService service.
|
||||
// All implementations must embed UnimplementedSubscriptionServiceServer
|
||||
// for forward compatibility.
|
||||
type SubscriptionServiceServer interface {
|
||||
GetSubscription(context.Context, *GetSubscriptionRequest) (*GetSubscriptionResponse, error)
|
||||
UpdateSubscription(context.Context, *UpdateSubscriptionRequest) (*UpdateSubscriptionResponse, error)
|
||||
// GetSubscription gets the current subscription of Slash instance.
|
||||
GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error)
|
||||
// UpdateSubscription updates the subscription.
|
||||
UpdateSubscription(context.Context, *UpdateSubscriptionRequest) (*Subscription, error)
|
||||
// DeleteSubscription deletes the subscription.
|
||||
DeleteSubscription(context.Context, *DeleteSubscriptionRequest) (*Subscription, error)
|
||||
mustEmbedUnimplementedSubscriptionServiceServer()
|
||||
}
|
||||
|
||||
@ -75,12 +94,15 @@ type SubscriptionServiceServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSubscriptionServiceServer struct{}
|
||||
|
||||
func (UnimplementedSubscriptionServiceServer) GetSubscription(context.Context, *GetSubscriptionRequest) (*GetSubscriptionResponse, error) {
|
||||
func (UnimplementedSubscriptionServiceServer) GetSubscription(context.Context, *GetSubscriptionRequest) (*Subscription, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method GetSubscription not implemented")
|
||||
}
|
||||
func (UnimplementedSubscriptionServiceServer) UpdateSubscription(context.Context, *UpdateSubscriptionRequest) (*UpdateSubscriptionResponse, error) {
|
||||
func (UnimplementedSubscriptionServiceServer) UpdateSubscription(context.Context, *UpdateSubscriptionRequest) (*Subscription, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UpdateSubscription not implemented")
|
||||
}
|
||||
func (UnimplementedSubscriptionServiceServer) DeleteSubscription(context.Context, *DeleteSubscriptionRequest) (*Subscription, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteSubscription not implemented")
|
||||
}
|
||||
func (UnimplementedSubscriptionServiceServer) mustEmbedUnimplementedSubscriptionServiceServer() {}
|
||||
func (UnimplementedSubscriptionServiceServer) testEmbeddedByValue() {}
|
||||
|
||||
@ -138,6 +160,24 @@ func _SubscriptionService_UpdateSubscription_Handler(srv interface{}, ctx contex
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _SubscriptionService_DeleteSubscription_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(DeleteSubscriptionRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(SubscriptionServiceServer).DeleteSubscription(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: SubscriptionService_DeleteSubscription_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SubscriptionServiceServer).DeleteSubscription(ctx, req.(*DeleteSubscriptionRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
// SubscriptionService_ServiceDesc is the grpc.ServiceDesc for SubscriptionService service.
|
||||
// It's only intended for direct use with grpc.RegisterService,
|
||||
// and not to be introspected or modified (even as a copy)
|
||||
@ -153,6 +193,10 @@ var SubscriptionService_ServiceDesc = grpc.ServiceDesc{
|
||||
MethodName: "UpdateSubscription",
|
||||
Handler: _SubscriptionService_UpdateSubscription_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DeleteSubscription",
|
||||
Handler: _SubscriptionService_DeleteSubscription_Handler,
|
||||
},
|
||||
},
|
||||
Streams: []grpc.StreamDesc{},
|
||||
Metadata: "api/v1/subscription_service.proto",
|
||||
|
Reference in New Issue
Block a user