// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v5.29.3
// source: tstore/tstore.proto

package tstore

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	TStore_ReadFile_FullMethodName = "/tstore.TStore/ReadFile"
	TStore_Copy_FullMethodName     = "/tstore.TStore/Copy"
	TStore_Glob_FullMethodName     = "/tstore.TStore/Glob"
)

// TStoreClient is the client API for TStore 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.
//
// TStore implement a service running on a container that have shared volume with other services
// TStore help to investigate the file being written to the shared storage in order to make some
// checking for tests.
//
// # TStore is used only for the purpose of testing
//
// # How to generate go files
//
// Download, install protoc and add its bin directory to the path
//
//	https://github.com/protocolbuffers/protobuf/releases
//
// Install go plugin for protoc
//
//	GOFLAGS='-mod=mod' go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
//	GOFLAGS='-mod=mod' go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
//
// From the parent of this directory, generate proto files :
//
//	rm -f tstore/tstore.pb.go tstore/tstore_grpc.pb.go && protoc --go_out=. --go-grpc_out=. tstore/tstore.proto
type TStoreClient interface {
	// ReadFile read a file and return its binary content
	ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error)
	// Copies a file from srcPath to destPath
	Copy(ctx context.Context, in *CopyRequest, opts ...grpc.CallOption) (*CopyResponse, error)
	// Globs files under the rootPath.
	Glob(ctx context.Context, in *GlobRequest, opts ...grpc.CallOption) (*GlobResponse, error)
}

type tStoreClient struct {
	cc grpc.ClientConnInterface
}

func NewTStoreClient(cc grpc.ClientConnInterface) TStoreClient {
	return &tStoreClient{cc}
}

func (c *tStoreClient) ReadFile(ctx context.Context, in *ReadFileRequest, opts ...grpc.CallOption) (*ReadFileResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(ReadFileResponse)
	err := c.cc.Invoke(ctx, TStore_ReadFile_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tStoreClient) Copy(ctx context.Context, in *CopyRequest, opts ...grpc.CallOption) (*CopyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CopyResponse)
	err := c.cc.Invoke(ctx, TStore_Copy_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *tStoreClient) Glob(ctx context.Context, in *GlobRequest, opts ...grpc.CallOption) (*GlobResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GlobResponse)
	err := c.cc.Invoke(ctx, TStore_Glob_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// TStoreServer is the server API for TStore service.
// All implementations must embed UnimplementedTStoreServer
// for forward compatibility.
//
// TStore implement a service running on a container that have shared volume with other services
// TStore help to investigate the file being written to the shared storage in order to make some
// checking for tests.
//
// # TStore is used only for the purpose of testing
//
// # How to generate go files
//
// Download, install protoc and add its bin directory to the path
//
//	https://github.com/protocolbuffers/protobuf/releases
//
// Install go plugin for protoc
//
//	GOFLAGS='-mod=mod' go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
//	GOFLAGS='-mod=mod' go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
//
// From the parent of this directory, generate proto files :
//
//	rm -f tstore/tstore.pb.go tstore/tstore_grpc.pb.go && protoc --go_out=. --go-grpc_out=. tstore/tstore.proto
type TStoreServer interface {
	// ReadFile read a file and return its binary content
	ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error)
	// Copies a file from srcPath to destPath
	Copy(context.Context, *CopyRequest) (*CopyResponse, error)
	// Globs files under the rootPath.
	Glob(context.Context, *GlobRequest) (*GlobResponse, error)
	mustEmbedUnimplementedTStoreServer()
}

// UnimplementedTStoreServer must 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 UnimplementedTStoreServer struct{}

func (UnimplementedTStoreServer) ReadFile(context.Context, *ReadFileRequest) (*ReadFileResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method ReadFile not implemented")
}
func (UnimplementedTStoreServer) Copy(context.Context, *CopyRequest) (*CopyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Copy not implemented")
}
func (UnimplementedTStoreServer) Glob(context.Context, *GlobRequest) (*GlobResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Glob not implemented")
}
func (UnimplementedTStoreServer) mustEmbedUnimplementedTStoreServer() {}
func (UnimplementedTStoreServer) testEmbeddedByValue()                {}

// UnsafeTStoreServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to TStoreServer will
// result in compilation errors.
type UnsafeTStoreServer interface {
	mustEmbedUnimplementedTStoreServer()
}

func RegisterTStoreServer(s grpc.ServiceRegistrar, srv TStoreServer) {
	// If the following call pancis, it indicates UnimplementedTStoreServer 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(&TStore_ServiceDesc, srv)
}

func _TStore_ReadFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(ReadFileRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TStoreServer).ReadFile(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TStore_ReadFile_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TStoreServer).ReadFile(ctx, req.(*ReadFileRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TStore_Copy_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CopyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TStoreServer).Copy(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TStore_Copy_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TStoreServer).Copy(ctx, req.(*CopyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _TStore_Glob_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GlobRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(TStoreServer).Glob(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: TStore_Glob_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(TStoreServer).Glob(ctx, req.(*GlobRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// TStore_ServiceDesc is the grpc.ServiceDesc for TStore service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var TStore_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "tstore.TStore",
	HandlerType: (*TStoreServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "ReadFile",
			Handler:    _TStore_ReadFile_Handler,
		},
		{
			MethodName: "Copy",
			Handler:    _TStore_Copy_Handler,
		},
		{
			MethodName: "Glob",
			Handler:    _TStore_Glob_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "tstore/tstore.proto",
}
