micro/util/file/proto/file_grpc.pb.go

235 lines
7.6 KiB
Go
Raw Normal View History

// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
package go_micro_server
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.
const _ = grpc.SupportPackageIsVersion6
// FileClient is the client API for File 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 FileClient interface {
Open(ctx context.Context, in *OpenRequest, opts ...grpc.CallOption) (*OpenResponse, error)
Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error)
Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error)
Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error)
Close(ctx context.Context, in *CloseRequest, opts ...grpc.CallOption) (*CloseResponse, error)
}
type fileClient struct {
cc grpc.ClientConnInterface
}
func NewFileClient(cc grpc.ClientConnInterface) FileClient {
return &fileClient{cc}
}
func (c *fileClient) Open(ctx context.Context, in *OpenRequest, opts ...grpc.CallOption) (*OpenResponse, error) {
out := new(OpenResponse)
err := c.cc.Invoke(ctx, "/go.micro.server.File/Open", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) Stat(ctx context.Context, in *StatRequest, opts ...grpc.CallOption) (*StatResponse, error) {
out := new(StatResponse)
err := c.cc.Invoke(ctx, "/go.micro.server.File/Stat", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) Read(ctx context.Context, in *ReadRequest, opts ...grpc.CallOption) (*ReadResponse, error) {
out := new(ReadResponse)
err := c.cc.Invoke(ctx, "/go.micro.server.File/Read", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error) {
out := new(WriteResponse)
err := c.cc.Invoke(ctx, "/go.micro.server.File/Write", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *fileClient) Close(ctx context.Context, in *CloseRequest, opts ...grpc.CallOption) (*CloseResponse, error) {
out := new(CloseResponse)
err := c.cc.Invoke(ctx, "/go.micro.server.File/Close", in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// FileServer is the server API for File service.
// All implementations must embed UnimplementedFileServer
// for forward compatibility
type FileServer interface {
Open(context.Context, *OpenRequest) (*OpenResponse, error)
Stat(context.Context, *StatRequest) (*StatResponse, error)
Read(context.Context, *ReadRequest) (*ReadResponse, error)
Write(context.Context, *WriteRequest) (*WriteResponse, error)
Close(context.Context, *CloseRequest) (*CloseResponse, error)
mustEmbedUnimplementedFileServer()
}
// UnimplementedFileServer must be embedded to have forward compatible implementations.
type UnimplementedFileServer struct {
}
func (*UnimplementedFileServer) Open(context.Context, *OpenRequest) (*OpenResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Open not implemented")
}
func (*UnimplementedFileServer) Stat(context.Context, *StatRequest) (*StatResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Stat not implemented")
}
func (*UnimplementedFileServer) Read(context.Context, *ReadRequest) (*ReadResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Read not implemented")
}
func (*UnimplementedFileServer) Write(context.Context, *WriteRequest) (*WriteResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Write not implemented")
}
func (*UnimplementedFileServer) Close(context.Context, *CloseRequest) (*CloseResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method Close not implemented")
}
func (*UnimplementedFileServer) mustEmbedUnimplementedFileServer() {}
func RegisterFileServer(s *grpc.Server, srv FileServer) {
s.RegisterService(&_File_serviceDesc, srv)
}
func _File_Open_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(OpenRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).Open(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/go.micro.server.File/Open",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).Open(ctx, req.(*OpenRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_Stat_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(StatRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).Stat(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/go.micro.server.File/Stat",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).Stat(ctx, req.(*StatRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_Read_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(ReadRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).Read(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/go.micro.server.File/Read",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).Read(ctx, req.(*ReadRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_Write_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(WriteRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).Write(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/go.micro.server.File/Write",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).Write(ctx, req.(*WriteRequest))
}
return interceptor(ctx, in, info, handler)
}
func _File_Close_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CloseRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(FileServer).Close(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/go.micro.server.File/Close",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(FileServer).Close(ctx, req.(*CloseRequest))
}
return interceptor(ctx, in, info, handler)
}
var _File_serviceDesc = grpc.ServiceDesc{
ServiceName: "go.micro.server.File",
HandlerType: (*FileServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "Open",
Handler: _File_Open_Handler,
},
{
MethodName: "Stat",
Handler: _File_Stat_Handler,
},
{
MethodName: "Read",
Handler: _File_Read_Handler,
},
{
MethodName: "Write",
Handler: _File_Write_Handler,
},
{
MethodName: "Close",
Handler: _File_Close_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "util/file/proto/file.proto",
}