1
api-go/licenses/v1/service_grpc.pb.go

194 lines
6.9 KiB
Go

// Copyright (C) 2023 The Licensing Authors
// SPDX-License-Identifier: MIT
//
// This file attempts to follow common styles and design patterns described by
// Google Cloud based on their extensive use of protocol buffers.
//
// - See here for more: https://cloud.google.com/apis/design/design_patterns
//
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: licenses/v1/service.proto
package licensesv1
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// 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.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
LicenseService_List_FullMethodName = "/licenses.v1.LicenseService/List"
LicenseService_Purchase_FullMethodName = "/licenses.v1.LicenseService/Purchase"
LicenseService_Cancel_FullMethodName = "/licenses.v1.LicenseService/Cancel"
)
// LicenseServiceClient is the client API for LicenseService 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 LicenseServiceClient interface {
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
Purchase(ctx context.Context, in *PurchaseRequest, opts ...grpc.CallOption) (*PurchaseResponse, error)
Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error)
}
type licenseServiceClient struct {
cc grpc.ClientConnInterface
}
func NewLicenseServiceClient(cc grpc.ClientConnInterface) LicenseServiceClient {
return &licenseServiceClient{cc}
}
func (c *licenseServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
out := new(ListResponse)
err := c.cc.Invoke(ctx, LicenseService_List_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *licenseServiceClient) Purchase(ctx context.Context, in *PurchaseRequest, opts ...grpc.CallOption) (*PurchaseResponse, error) {
out := new(PurchaseResponse)
err := c.cc.Invoke(ctx, LicenseService_Purchase_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *licenseServiceClient) Cancel(ctx context.Context, in *CancelRequest, opts ...grpc.CallOption) (*CancelResponse, error) {
out := new(CancelResponse)
err := c.cc.Invoke(ctx, LicenseService_Cancel_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// LicenseServiceServer is the server API for LicenseService service.
// All implementations must embed UnimplementedLicenseServiceServer
// for forward compatibility
type LicenseServiceServer interface {
List(context.Context, *ListRequest) (*ListResponse, error)
Purchase(context.Context, *PurchaseRequest) (*PurchaseResponse, error)
Cancel(context.Context, *CancelRequest) (*CancelResponse, error)
mustEmbedUnimplementedLicenseServiceServer()
}
// UnimplementedLicenseServiceServer must be embedded to have forward compatible implementations.
type UnimplementedLicenseServiceServer struct {
}
func (UnimplementedLicenseServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
}
func (UnimplementedLicenseServiceServer) Purchase(context.Context, *PurchaseRequest) (*PurchaseResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Purchase not implemented")
}
func (UnimplementedLicenseServiceServer) Cancel(context.Context, *CancelRequest) (*CancelResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Cancel not implemented")
}
func (UnimplementedLicenseServiceServer) mustEmbedUnimplementedLicenseServiceServer() {}
// UnsafeLicenseServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to LicenseServiceServer will
// result in compilation errors.
type UnsafeLicenseServiceServer interface {
mustEmbedUnimplementedLicenseServiceServer()
}
func RegisterLicenseServiceServer(s grpc.ServiceRegistrar, srv LicenseServiceServer) {
s.RegisterService(&LicenseService_ServiceDesc, srv)
}
func _LicenseService_List_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ListRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LicenseServiceServer).List(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LicenseService_List_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LicenseServiceServer).List(ctx, req.(*ListRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LicenseService_Purchase_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(PurchaseRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LicenseServiceServer).Purchase(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LicenseService_Purchase_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LicenseServiceServer).Purchase(ctx, req.(*PurchaseRequest))
}
return interceptor(ctx, in, info, handler)
}
func _LicenseService_Cancel_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CancelRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(LicenseServiceServer).Cancel(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: LicenseService_Cancel_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(LicenseServiceServer).Cancel(ctx, req.(*CancelRequest))
}
return interceptor(ctx, in, info, handler)
}
// LicenseService_ServiceDesc is the grpc.ServiceDesc for LicenseService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var LicenseService_ServiceDesc = grpc.ServiceDesc{
ServiceName: "licenses.v1.LicenseService",
HandlerType: (*LicenseServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "List",
Handler: _LicenseService_List_Handler,
},
{
MethodName: "Purchase",
Handler: _LicenseService_Purchase_Handler,
},
{
MethodName: "Cancel",
Handler: _LicenseService_Cancel_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "licenses/v1/service.proto",
}