// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.6.1
// - protoc             v6.33.1
// source: remote/kv.proto

package remoteproto

import (
	context "context"
	typesproto "github.com/erigontech/erigon/node/gointerfaces/typesproto"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	emptypb "google.golang.org/protobuf/types/known/emptypb"
)

// 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 (
	KV_Version_FullMethodName              = "/remote.KV/Version"
	KV_Tx_FullMethodName                   = "/remote.KV/Tx"
	KV_StateChanges_FullMethodName         = "/remote.KV/StateChanges"
	KV_Snapshots_FullMethodName            = "/remote.KV/Snapshots"
	KV_Range_FullMethodName                = "/remote.KV/Range"
	KV_Sequence_FullMethodName             = "/remote.KV/Sequence"
	KV_GetLatest_FullMethodName            = "/remote.KV/GetLatest"
	KV_HistorySeek_FullMethodName          = "/remote.KV/HistorySeek"
	KV_IndexRange_FullMethodName           = "/remote.KV/IndexRange"
	KV_HistoryRange_FullMethodName         = "/remote.KV/HistoryRange"
	KV_RangeAsOf_FullMethodName            = "/remote.KV/RangeAsOf"
	KV_HasPrefix_FullMethodName            = "/remote.KV/HasPrefix"
	KV_HistoryStartFrom_FullMethodName     = "/remote.KV/HistoryStartFrom"
	KV_CurrentDomainVersion_FullMethodName = "/remote.KV/CurrentDomainVersion"
	KV_StepSize_FullMethodName             = "/remote.KV/StepSize"
)

// KVClient is the client API for KV 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.
//
// Provides methods to access key-value data
type KVClient interface {
	// Version returns the service version number
	Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*typesproto.VersionReply, error)
	// Tx exposes read-only transactions for the key-value store
	//
	// When tx open, client must receive 1 message from server with txID
	// When cursor open, client must receive 1 message from server with cursorID
	// Then only client can initiate messages from server
	Tx(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Cursor, Pair], error)
	StateChanges(ctx context.Context, in *StateChangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StateChangeBatch], error)
	// Snapshots returns list of current snapshot files. Then client can just open all of them.
	Snapshots(ctx context.Context, in *SnapshotsRequest, opts ...grpc.CallOption) (*SnapshotsReply, error)
	// Range [from, to)
	// Range(from, nil) means [from, EndOfTable)
	// Range(nil, to)   means [StartOfTable, to)
	// If orderAscend=false server expecting `from`<`to`. Example: Range("B", "A")
	Range(ctx context.Context, in *RangeReq, opts ...grpc.CallOption) (*Pairs, error)
	Sequence(ctx context.Context, in *SequenceReq, opts ...grpc.CallOption) (*SequenceReply, error)
	// Temporal methods
	GetLatest(ctx context.Context, in *GetLatestReq, opts ...grpc.CallOption) (*GetLatestReply, error)
	HistorySeek(ctx context.Context, in *HistorySeekReq, opts ...grpc.CallOption) (*HistorySeekReply, error)
	IndexRange(ctx context.Context, in *IndexRangeReq, opts ...grpc.CallOption) (*IndexRangeReply, error)
	HistoryRange(ctx context.Context, in *HistoryRangeReq, opts ...grpc.CallOption) (*Pairs, error)
	RangeAsOf(ctx context.Context, in *RangeAsOfReq, opts ...grpc.CallOption) (*Pairs, error)
	HasPrefix(ctx context.Context, in *HasPrefixReq, opts ...grpc.CallOption) (*HasPrefixReply, error)
	HistoryStartFrom(ctx context.Context, in *HistoryStartFromReq, opts ...grpc.CallOption) (*HistoryStartFromReply, error)
	CurrentDomainVersion(ctx context.Context, in *CurrentDomainVersionReq, opts ...grpc.CallOption) (*CurrentDomainVersionReply, error)
	StepSize(ctx context.Context, in *StepSizeReq, opts ...grpc.CallOption) (*StepSizeReply, error)
}

type kVClient struct {
	cc grpc.ClientConnInterface
}

func NewKVClient(cc grpc.ClientConnInterface) KVClient {
	return &kVClient{cc}
}

func (c *kVClient) Version(ctx context.Context, in *emptypb.Empty, opts ...grpc.CallOption) (*typesproto.VersionReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(typesproto.VersionReply)
	err := c.cc.Invoke(ctx, KV_Version_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) Tx(ctx context.Context, opts ...grpc.CallOption) (grpc.BidiStreamingClient[Cursor, Pair], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &KV_ServiceDesc.Streams[0], KV_Tx_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[Cursor, Pair]{ClientStream: stream}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type KV_TxClient = grpc.BidiStreamingClient[Cursor, Pair]

func (c *kVClient) StateChanges(ctx context.Context, in *StateChangeRequest, opts ...grpc.CallOption) (grpc.ServerStreamingClient[StateChangeBatch], error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	stream, err := c.cc.NewStream(ctx, &KV_ServiceDesc.Streams[1], KV_StateChanges_FullMethodName, cOpts...)
	if err != nil {
		return nil, err
	}
	x := &grpc.GenericClientStream[StateChangeRequest, StateChangeBatch]{ClientStream: stream}
	if err := x.ClientStream.SendMsg(in); err != nil {
		return nil, err
	}
	if err := x.ClientStream.CloseSend(); err != nil {
		return nil, err
	}
	return x, nil
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type KV_StateChangesClient = grpc.ServerStreamingClient[StateChangeBatch]

func (c *kVClient) Snapshots(ctx context.Context, in *SnapshotsRequest, opts ...grpc.CallOption) (*SnapshotsReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SnapshotsReply)
	err := c.cc.Invoke(ctx, KV_Snapshots_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) Range(ctx context.Context, in *RangeReq, opts ...grpc.CallOption) (*Pairs, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Pairs)
	err := c.cc.Invoke(ctx, KV_Range_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) Sequence(ctx context.Context, in *SequenceReq, opts ...grpc.CallOption) (*SequenceReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(SequenceReply)
	err := c.cc.Invoke(ctx, KV_Sequence_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) GetLatest(ctx context.Context, in *GetLatestReq, opts ...grpc.CallOption) (*GetLatestReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(GetLatestReply)
	err := c.cc.Invoke(ctx, KV_GetLatest_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) HistorySeek(ctx context.Context, in *HistorySeekReq, opts ...grpc.CallOption) (*HistorySeekReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(HistorySeekReply)
	err := c.cc.Invoke(ctx, KV_HistorySeek_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) IndexRange(ctx context.Context, in *IndexRangeReq, opts ...grpc.CallOption) (*IndexRangeReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(IndexRangeReply)
	err := c.cc.Invoke(ctx, KV_IndexRange_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) HistoryRange(ctx context.Context, in *HistoryRangeReq, opts ...grpc.CallOption) (*Pairs, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Pairs)
	err := c.cc.Invoke(ctx, KV_HistoryRange_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) RangeAsOf(ctx context.Context, in *RangeAsOfReq, opts ...grpc.CallOption) (*Pairs, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(Pairs)
	err := c.cc.Invoke(ctx, KV_RangeAsOf_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) HasPrefix(ctx context.Context, in *HasPrefixReq, opts ...grpc.CallOption) (*HasPrefixReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(HasPrefixReply)
	err := c.cc.Invoke(ctx, KV_HasPrefix_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) HistoryStartFrom(ctx context.Context, in *HistoryStartFromReq, opts ...grpc.CallOption) (*HistoryStartFromReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(HistoryStartFromReply)
	err := c.cc.Invoke(ctx, KV_HistoryStartFrom_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) CurrentDomainVersion(ctx context.Context, in *CurrentDomainVersionReq, opts ...grpc.CallOption) (*CurrentDomainVersionReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(CurrentDomainVersionReply)
	err := c.cc.Invoke(ctx, KV_CurrentDomainVersion_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *kVClient) StepSize(ctx context.Context, in *StepSizeReq, opts ...grpc.CallOption) (*StepSizeReply, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(StepSizeReply)
	err := c.cc.Invoke(ctx, KV_StepSize_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// KVServer is the server API for KV service.
// All implementations must embed UnimplementedKVServer
// for forward compatibility.
//
// Provides methods to access key-value data
type KVServer interface {
	// Version returns the service version number
	Version(context.Context, *emptypb.Empty) (*typesproto.VersionReply, error)
	// Tx exposes read-only transactions for the key-value store
	//
	// When tx open, client must receive 1 message from server with txID
	// When cursor open, client must receive 1 message from server with cursorID
	// Then only client can initiate messages from server
	Tx(grpc.BidiStreamingServer[Cursor, Pair]) error
	StateChanges(*StateChangeRequest, grpc.ServerStreamingServer[StateChangeBatch]) error
	// Snapshots returns list of current snapshot files. Then client can just open all of them.
	Snapshots(context.Context, *SnapshotsRequest) (*SnapshotsReply, error)
	// Range [from, to)
	// Range(from, nil) means [from, EndOfTable)
	// Range(nil, to)   means [StartOfTable, to)
	// If orderAscend=false server expecting `from`<`to`. Example: Range("B", "A")
	Range(context.Context, *RangeReq) (*Pairs, error)
	Sequence(context.Context, *SequenceReq) (*SequenceReply, error)
	// Temporal methods
	GetLatest(context.Context, *GetLatestReq) (*GetLatestReply, error)
	HistorySeek(context.Context, *HistorySeekReq) (*HistorySeekReply, error)
	IndexRange(context.Context, *IndexRangeReq) (*IndexRangeReply, error)
	HistoryRange(context.Context, *HistoryRangeReq) (*Pairs, error)
	RangeAsOf(context.Context, *RangeAsOfReq) (*Pairs, error)
	HasPrefix(context.Context, *HasPrefixReq) (*HasPrefixReply, error)
	HistoryStartFrom(context.Context, *HistoryStartFromReq) (*HistoryStartFromReply, error)
	CurrentDomainVersion(context.Context, *CurrentDomainVersionReq) (*CurrentDomainVersionReply, error)
	StepSize(context.Context, *StepSizeReq) (*StepSizeReply, error)
	mustEmbedUnimplementedKVServer()
}

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

func (UnimplementedKVServer) Version(context.Context, *emptypb.Empty) (*typesproto.VersionReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Version not implemented")
}
func (UnimplementedKVServer) Tx(grpc.BidiStreamingServer[Cursor, Pair]) error {
	return status.Error(codes.Unimplemented, "method Tx not implemented")
}
func (UnimplementedKVServer) StateChanges(*StateChangeRequest, grpc.ServerStreamingServer[StateChangeBatch]) error {
	return status.Error(codes.Unimplemented, "method StateChanges not implemented")
}
func (UnimplementedKVServer) Snapshots(context.Context, *SnapshotsRequest) (*SnapshotsReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Snapshots not implemented")
}
func (UnimplementedKVServer) Range(context.Context, *RangeReq) (*Pairs, error) {
	return nil, status.Error(codes.Unimplemented, "method Range not implemented")
}
func (UnimplementedKVServer) Sequence(context.Context, *SequenceReq) (*SequenceReply, error) {
	return nil, status.Error(codes.Unimplemented, "method Sequence not implemented")
}
func (UnimplementedKVServer) GetLatest(context.Context, *GetLatestReq) (*GetLatestReply, error) {
	return nil, status.Error(codes.Unimplemented, "method GetLatest not implemented")
}
func (UnimplementedKVServer) HistorySeek(context.Context, *HistorySeekReq) (*HistorySeekReply, error) {
	return nil, status.Error(codes.Unimplemented, "method HistorySeek not implemented")
}
func (UnimplementedKVServer) IndexRange(context.Context, *IndexRangeReq) (*IndexRangeReply, error) {
	return nil, status.Error(codes.Unimplemented, "method IndexRange not implemented")
}
func (UnimplementedKVServer) HistoryRange(context.Context, *HistoryRangeReq) (*Pairs, error) {
	return nil, status.Error(codes.Unimplemented, "method HistoryRange not implemented")
}
func (UnimplementedKVServer) RangeAsOf(context.Context, *RangeAsOfReq) (*Pairs, error) {
	return nil, status.Error(codes.Unimplemented, "method RangeAsOf not implemented")
}
func (UnimplementedKVServer) HasPrefix(context.Context, *HasPrefixReq) (*HasPrefixReply, error) {
	return nil, status.Error(codes.Unimplemented, "method HasPrefix not implemented")
}
func (UnimplementedKVServer) HistoryStartFrom(context.Context, *HistoryStartFromReq) (*HistoryStartFromReply, error) {
	return nil, status.Error(codes.Unimplemented, "method HistoryStartFrom not implemented")
}
func (UnimplementedKVServer) CurrentDomainVersion(context.Context, *CurrentDomainVersionReq) (*CurrentDomainVersionReply, error) {
	return nil, status.Error(codes.Unimplemented, "method CurrentDomainVersion not implemented")
}
func (UnimplementedKVServer) StepSize(context.Context, *StepSizeReq) (*StepSizeReply, error) {
	return nil, status.Error(codes.Unimplemented, "method StepSize not implemented")
}
func (UnimplementedKVServer) mustEmbedUnimplementedKVServer() {}
func (UnimplementedKVServer) testEmbeddedByValue()            {}

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

func RegisterKVServer(s grpc.ServiceRegistrar, srv KVServer) {
	// If the following call panics, it indicates UnimplementedKVServer 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(&KV_ServiceDesc, srv)
}

func _KV_Version_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(emptypb.Empty)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).Version(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_Version_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).Version(ctx, req.(*emptypb.Empty))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_Tx_Handler(srv interface{}, stream grpc.ServerStream) error {
	return srv.(KVServer).Tx(&grpc.GenericServerStream[Cursor, Pair]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type KV_TxServer = grpc.BidiStreamingServer[Cursor, Pair]

func _KV_StateChanges_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(StateChangeRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(KVServer).StateChanges(m, &grpc.GenericServerStream[StateChangeRequest, StateChangeBatch]{ServerStream: stream})
}

// This type alias is provided for backwards compatibility with existing code that references the prior non-generic stream type by name.
type KV_StateChangesServer = grpc.ServerStreamingServer[StateChangeBatch]

func _KV_Snapshots_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SnapshotsRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).Snapshots(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_Snapshots_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).Snapshots(ctx, req.(*SnapshotsRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_Range_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RangeReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).Range(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_Range_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).Range(ctx, req.(*RangeReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_Sequence_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(SequenceReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).Sequence(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_Sequence_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).Sequence(ctx, req.(*SequenceReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_GetLatest_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(GetLatestReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).GetLatest(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_GetLatest_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).GetLatest(ctx, req.(*GetLatestReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_HistorySeek_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HistorySeekReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).HistorySeek(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_HistorySeek_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).HistorySeek(ctx, req.(*HistorySeekReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_IndexRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(IndexRangeReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).IndexRange(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_IndexRange_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).IndexRange(ctx, req.(*IndexRangeReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_HistoryRange_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HistoryRangeReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).HistoryRange(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_HistoryRange_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).HistoryRange(ctx, req.(*HistoryRangeReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_RangeAsOf_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(RangeAsOfReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).RangeAsOf(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_RangeAsOf_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).RangeAsOf(ctx, req.(*RangeAsOfReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_HasPrefix_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HasPrefixReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).HasPrefix(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_HasPrefix_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).HasPrefix(ctx, req.(*HasPrefixReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_HistoryStartFrom_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(HistoryStartFromReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).HistoryStartFrom(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_HistoryStartFrom_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).HistoryStartFrom(ctx, req.(*HistoryStartFromReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_CurrentDomainVersion_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(CurrentDomainVersionReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).CurrentDomainVersion(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_CurrentDomainVersion_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).CurrentDomainVersion(ctx, req.(*CurrentDomainVersionReq))
	}
	return interceptor(ctx, in, info, handler)
}

func _KV_StepSize_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StepSizeReq)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(KVServer).StepSize(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: KV_StepSize_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(KVServer).StepSize(ctx, req.(*StepSizeReq))
	}
	return interceptor(ctx, in, info, handler)
}

// KV_ServiceDesc is the grpc.ServiceDesc for KV service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var KV_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "remote.KV",
	HandlerType: (*KVServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Version",
			Handler:    _KV_Version_Handler,
		},
		{
			MethodName: "Snapshots",
			Handler:    _KV_Snapshots_Handler,
		},
		{
			MethodName: "Range",
			Handler:    _KV_Range_Handler,
		},
		{
			MethodName: "Sequence",
			Handler:    _KV_Sequence_Handler,
		},
		{
			MethodName: "GetLatest",
			Handler:    _KV_GetLatest_Handler,
		},
		{
			MethodName: "HistorySeek",
			Handler:    _KV_HistorySeek_Handler,
		},
		{
			MethodName: "IndexRange",
			Handler:    _KV_IndexRange_Handler,
		},
		{
			MethodName: "HistoryRange",
			Handler:    _KV_HistoryRange_Handler,
		},
		{
			MethodName: "RangeAsOf",
			Handler:    _KV_RangeAsOf_Handler,
		},
		{
			MethodName: "HasPrefix",
			Handler:    _KV_HasPrefix_Handler,
		},
		{
			MethodName: "HistoryStartFrom",
			Handler:    _KV_HistoryStartFrom_Handler,
		},
		{
			MethodName: "CurrentDomainVersion",
			Handler:    _KV_CurrentDomainVersion_Handler,
		},
		{
			MethodName: "StepSize",
			Handler:    _KV_StepSize_Handler,
		},
	},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Tx",
			Handler:       _KV_Tx_Handler,
			ServerStreams: true,
			ClientStreams: true,
		},
		{
			StreamName:    "StateChanges",
			Handler:       _KV_StateChanges_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "remote/kv.proto",
}
