231 lines
8.5 KiB
Go
231 lines
8.5 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: contributors/v1/service.proto
|
||
|
|
||
|
package contributorsv1
|
||
|
|
||
|
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 (
|
||
|
ContributorService_List_FullMethodName = "/contributors.v1.ContributorService/List"
|
||
|
ContributorService_Create_FullMethodName = "/contributors.v1.ContributorService/Create"
|
||
|
ContributorService_Update_FullMethodName = "/contributors.v1.ContributorService/Update"
|
||
|
ContributorService_Delete_FullMethodName = "/contributors.v1.ContributorService/Delete"
|
||
|
)
|
||
|
|
||
|
// ContributorServiceClient is the client API for ContributorService 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 ContributorServiceClient interface {
|
||
|
List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error)
|
||
|
Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error)
|
||
|
Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error)
|
||
|
Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error)
|
||
|
}
|
||
|
|
||
|
type contributorServiceClient struct {
|
||
|
cc grpc.ClientConnInterface
|
||
|
}
|
||
|
|
||
|
func NewContributorServiceClient(cc grpc.ClientConnInterface) ContributorServiceClient {
|
||
|
return &contributorServiceClient{cc}
|
||
|
}
|
||
|
|
||
|
func (c *contributorServiceClient) List(ctx context.Context, in *ListRequest, opts ...grpc.CallOption) (*ListResponse, error) {
|
||
|
out := new(ListResponse)
|
||
|
err := c.cc.Invoke(ctx, ContributorService_List_FullMethodName, in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *contributorServiceClient) Create(ctx context.Context, in *CreateRequest, opts ...grpc.CallOption) (*CreateResponse, error) {
|
||
|
out := new(CreateResponse)
|
||
|
err := c.cc.Invoke(ctx, ContributorService_Create_FullMethodName, in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *contributorServiceClient) Update(ctx context.Context, in *UpdateRequest, opts ...grpc.CallOption) (*UpdateResponse, error) {
|
||
|
out := new(UpdateResponse)
|
||
|
err := c.cc.Invoke(ctx, ContributorService_Update_FullMethodName, in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
func (c *contributorServiceClient) Delete(ctx context.Context, in *DeleteRequest, opts ...grpc.CallOption) (*DeleteResponse, error) {
|
||
|
out := new(DeleteResponse)
|
||
|
err := c.cc.Invoke(ctx, ContributorService_Delete_FullMethodName, in, out, opts...)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return out, nil
|
||
|
}
|
||
|
|
||
|
// ContributorServiceServer is the server API for ContributorService service.
|
||
|
// All implementations must embed UnimplementedContributorServiceServer
|
||
|
// for forward compatibility
|
||
|
type ContributorServiceServer interface {
|
||
|
List(context.Context, *ListRequest) (*ListResponse, error)
|
||
|
Create(context.Context, *CreateRequest) (*CreateResponse, error)
|
||
|
Update(context.Context, *UpdateRequest) (*UpdateResponse, error)
|
||
|
Delete(context.Context, *DeleteRequest) (*DeleteResponse, error)
|
||
|
mustEmbedUnimplementedContributorServiceServer()
|
||
|
}
|
||
|
|
||
|
// UnimplementedContributorServiceServer must be embedded to have forward compatible implementations.
|
||
|
type UnimplementedContributorServiceServer struct {
|
||
|
}
|
||
|
|
||
|
func (UnimplementedContributorServiceServer) List(context.Context, *ListRequest) (*ListResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method List not implemented")
|
||
|
}
|
||
|
func (UnimplementedContributorServiceServer) Create(context.Context, *CreateRequest) (*CreateResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Create not implemented")
|
||
|
}
|
||
|
func (UnimplementedContributorServiceServer) Update(context.Context, *UpdateRequest) (*UpdateResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Update not implemented")
|
||
|
}
|
||
|
func (UnimplementedContributorServiceServer) Delete(context.Context, *DeleteRequest) (*DeleteResponse, error) {
|
||
|
return nil, status.Errorf(codes.Unimplemented, "method Delete not implemented")
|
||
|
}
|
||
|
func (UnimplementedContributorServiceServer) mustEmbedUnimplementedContributorServiceServer() {}
|
||
|
|
||
|
// UnsafeContributorServiceServer may be embedded to opt out of forward compatibility for this service.
|
||
|
// Use of this interface is not recommended, as added methods to ContributorServiceServer will
|
||
|
// result in compilation errors.
|
||
|
type UnsafeContributorServiceServer interface {
|
||
|
mustEmbedUnimplementedContributorServiceServer()
|
||
|
}
|
||
|
|
||
|
func RegisterContributorServiceServer(s grpc.ServiceRegistrar, srv ContributorServiceServer) {
|
||
|
s.RegisterService(&ContributorService_ServiceDesc, srv)
|
||
|
}
|
||
|
|
||
|
func _ContributorService_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.(ContributorServiceServer).List(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: ContributorService_List_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(ContributorServiceServer).List(ctx, req.(*ListRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _ContributorService_Create_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(CreateRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(ContributorServiceServer).Create(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: ContributorService_Create_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(ContributorServiceServer).Create(ctx, req.(*CreateRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _ContributorService_Update_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(UpdateRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(ContributorServiceServer).Update(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: ContributorService_Update_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(ContributorServiceServer).Update(ctx, req.(*UpdateRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
func _ContributorService_Delete_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||
|
in := new(DeleteRequest)
|
||
|
if err := dec(in); err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
if interceptor == nil {
|
||
|
return srv.(ContributorServiceServer).Delete(ctx, in)
|
||
|
}
|
||
|
info := &grpc.UnaryServerInfo{
|
||
|
Server: srv,
|
||
|
FullMethod: ContributorService_Delete_FullMethodName,
|
||
|
}
|
||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||
|
return srv.(ContributorServiceServer).Delete(ctx, req.(*DeleteRequest))
|
||
|
}
|
||
|
return interceptor(ctx, in, info, handler)
|
||
|
}
|
||
|
|
||
|
// ContributorService_ServiceDesc is the grpc.ServiceDesc for ContributorService service.
|
||
|
// It's only intended for direct use with grpc.RegisterService,
|
||
|
// and not to be introspected or modified (even as a copy)
|
||
|
var ContributorService_ServiceDesc = grpc.ServiceDesc{
|
||
|
ServiceName: "contributors.v1.ContributorService",
|
||
|
HandlerType: (*ContributorServiceServer)(nil),
|
||
|
Methods: []grpc.MethodDesc{
|
||
|
{
|
||
|
MethodName: "List",
|
||
|
Handler: _ContributorService_List_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "Create",
|
||
|
Handler: _ContributorService_Create_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "Update",
|
||
|
Handler: _ContributorService_Update_Handler,
|
||
|
},
|
||
|
{
|
||
|
MethodName: "Delete",
|
||
|
Handler: _ContributorService_Delete_Handler,
|
||
|
},
|
||
|
},
|
||
|
Streams: []grpc.StreamDesc{},
|
||
|
Metadata: "contributors/v1/service.proto",
|
||
|
}
|