// Code generated by protoc-gen-gogo. DO NOT EDIT.
// source: gateway.proto

package storegatewaypb

import (
	context "context"
	fmt "fmt"
	proto "github.com/gogo/protobuf/proto"
	storepb "github.com/thanos-io/thanos/pkg/store/storepb"
	grpc "google.golang.org/grpc"
	codes "google.golang.org/grpc/codes"
	status "google.golang.org/grpc/status"
	math "math"
)

// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf

// This is a compile-time assertion to ensure that this generated file
// is compatible with the proto package it is being compiled against.
// A compilation error at this line likely means your copy of the
// proto package needs to be updated.
const _ = proto.GoGoProtoPackageIsVersion3 // please upgrade the proto package

func init() { proto.RegisterFile("gateway.proto", fileDescriptor_f1a937782ebbded5) }

var fileDescriptor_f1a937782ebbded5 = []byte{
	// 204 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4d, 0x4f, 0x2c, 0x49,
	0x2d, 0x4f, 0xac, 0xd4, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0xe2, 0x84, 0x72, 0x0b, 0x92, 0xa4,
	0xcc, 0xd3, 0x33, 0x4b, 0x32, 0x4a, 0x93, 0xf4, 0x92, 0xf3, 0x73, 0xf5, 0x4b, 0x32, 0x12, 0xf3,
	0xf2, 0x8b, 0x75, 0x33, 0xf3, 0xa1, 0x2c, 0xfd, 0x82, 0xec, 0x74, 0xfd, 0xe2, 0x92, 0xfc, 0xa2,
	0x54, 0x08, 0x59, 0x90, 0xa4, 0x5f, 0x54, 0x90, 0x0c, 0x31, 0xc3, 0xc8, 0x93, 0x8b, 0x27, 0x18,
	0x24, 0xe8, 0x0e, 0x31, 0x4a, 0xc8, 0x92, 0x8b, 0x2d, 0x38, 0xb5, 0x28, 0x33, 0xb5, 0x58, 0x48,
	0x54, 0x0f, 0xa2, 0x5d, 0x0f, 0xc2, 0x0f, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x91, 0x12, 0x43,
	0x17, 0x2e, 0x2e, 0xc8, 0xcf, 0x2b, 0x4e, 0x35, 0x60, 0x74, 0x72, 0xb9, 0xf0, 0x50, 0x8e, 0xe1,
	0xc6, 0x43, 0x39, 0x86, 0x0f, 0x0f, 0xe5, 0x18, 0x1b, 0x1e, 0xc9, 0x31, 0xae, 0x78, 0x24, 0xc7,
	0x78, 0xe2, 0x91, 0x1c, 0xe3, 0x85, 0x47, 0x72, 0x8c, 0x0f, 0x1e, 0xc9, 0x31, 0xbe, 0x78, 0x24,
	0xc7, 0xf0, 0xe1, 0x91, 0x1c, 0xe3, 0x84, 0xc7, 0x72, 0x0c, 0x17, 0x1e, 0xcb, 0x31, 0xdc, 0x78,
	0x2c, 0xc7, 0x10, 0xc5, 0x07, 0x76, 0x13, 0xdc, 0x27, 0x49, 0x6c, 0x60, 0x77, 0x19, 0x03, 0x02,
	0x00, 0x00, 0xff, 0xff, 0xc5, 0x38, 0xd0, 0xf6, 0xec, 0x00, 0x00, 0x00,
}

// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn

// 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.SupportPackageIsVersion4

// StoreGatewayClient is the client API for StoreGateway service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type StoreGatewayClient interface {
	// Series streams each Series for given label matchers and time range.
	//
	// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain
	// partition of the single series, but once a new series is started to be streamed it means that no more data will
	// be sent for previous one.
	//
	// Series are sorted.
	Series(ctx context.Context, in *storepb.SeriesRequest, opts ...grpc.CallOption) (StoreGateway_SeriesClient, error)
}

type storeGatewayClient struct {
	cc *grpc.ClientConn
}

func NewStoreGatewayClient(cc *grpc.ClientConn) StoreGatewayClient {
	return &storeGatewayClient{cc}
}

func (c *storeGatewayClient) Series(ctx context.Context, in *storepb.SeriesRequest, opts ...grpc.CallOption) (StoreGateway_SeriesClient, error) {
	stream, err := c.cc.NewStream(ctx, &_StoreGateway_serviceDesc.Streams[0], "/gatewaypb.StoreGateway/Series", opts...)
	if err != nil {
		return nil, err
	}
	x := &storeGatewaySeriesClient{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
}

type StoreGateway_SeriesClient interface {
	Recv() (*storepb.SeriesResponse, error)
	grpc.ClientStream
}

type storeGatewaySeriesClient struct {
	grpc.ClientStream
}

func (x *storeGatewaySeriesClient) Recv() (*storepb.SeriesResponse, error) {
	m := new(storepb.SeriesResponse)
	if err := x.ClientStream.RecvMsg(m); err != nil {
		return nil, err
	}
	return m, nil
}

// StoreGatewayServer is the server API for StoreGateway service.
type StoreGatewayServer interface {
	// Series streams each Series for given label matchers and time range.
	//
	// Series should strictly stream full series after series, optionally split by time. This means that a single frame can contain
	// partition of the single series, but once a new series is started to be streamed it means that no more data will
	// be sent for previous one.
	//
	// Series are sorted.
	Series(*storepb.SeriesRequest, StoreGateway_SeriesServer) error
}

// UnimplementedStoreGatewayServer can be embedded to have forward compatible implementations.
type UnimplementedStoreGatewayServer struct {
}

func (*UnimplementedStoreGatewayServer) Series(req *storepb.SeriesRequest, srv StoreGateway_SeriesServer) error {
	return status.Errorf(codes.Unimplemented, "method Series not implemented")
}

func RegisterStoreGatewayServer(s *grpc.Server, srv StoreGatewayServer) {
	s.RegisterService(&_StoreGateway_serviceDesc, srv)
}

func _StoreGateway_Series_Handler(srv interface{}, stream grpc.ServerStream) error {
	m := new(storepb.SeriesRequest)
	if err := stream.RecvMsg(m); err != nil {
		return err
	}
	return srv.(StoreGatewayServer).Series(m, &storeGatewaySeriesServer{stream})
}

type StoreGateway_SeriesServer interface {
	Send(*storepb.SeriesResponse) error
	grpc.ServerStream
}

type storeGatewaySeriesServer struct {
	grpc.ServerStream
}

func (x *storeGatewaySeriesServer) Send(m *storepb.SeriesResponse) error {
	return x.ServerStream.SendMsg(m)
}

var _StoreGateway_serviceDesc = grpc.ServiceDesc{
	ServiceName: "gatewaypb.StoreGateway",
	HandlerType: (*StoreGatewayServer)(nil),
	Methods:     []grpc.MethodDesc{},
	Streams: []grpc.StreamDesc{
		{
			StreamName:    "Series",
			Handler:       _StoreGateway_Series_Handler,
			ServerStreams: true,
		},
	},
	Metadata: "gateway.proto",
}
