// Code generated by protoc-gen-go. DO NOT EDIT.
// source: transaction.proto

package gitalypb

import (
	context "context"
	fmt "fmt"
	proto "github.com/golang/protobuf/proto"
	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.ProtoPackageIsVersion3 // please upgrade the proto package

// The outcome of the given transaction telling the client whether the
// transaction should be committed or rolled back.
type VoteTransactionResponse_TransactionState int32

const (
	VoteTransactionResponse_COMMIT VoteTransactionResponse_TransactionState = 0
	VoteTransactionResponse_ABORT  VoteTransactionResponse_TransactionState = 1
	VoteTransactionResponse_STOP   VoteTransactionResponse_TransactionState = 2
)

var VoteTransactionResponse_TransactionState_name = map[int32]string{
	0: "COMMIT",
	1: "ABORT",
	2: "STOP",
}

var VoteTransactionResponse_TransactionState_value = map[string]int32{
	"COMMIT": 0,
	"ABORT":  1,
	"STOP":   2,
}

func (x VoteTransactionResponse_TransactionState) String() string {
	return proto.EnumName(VoteTransactionResponse_TransactionState_name, int32(x))
}

func (VoteTransactionResponse_TransactionState) EnumDescriptor() ([]byte, []int) {
	return fileDescriptor_2cc4e03d2c28c490, []int{1, 0}
}

type VoteTransactionRequest struct {
	Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
	// ID of the transaction we're processing
	TransactionId uint64 `protobuf:"varint,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	// Name of the Gitaly node that's voting on a transaction.
	Node string `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"`
	// SHA1 of the references that are to be updated
	ReferenceUpdatesHash []byte   `protobuf:"bytes,4,opt,name=reference_updates_hash,json=referenceUpdatesHash,proto3" json:"reference_updates_hash,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *VoteTransactionRequest) Reset()         { *m = VoteTransactionRequest{} }
func (m *VoteTransactionRequest) String() string { return proto.CompactTextString(m) }
func (*VoteTransactionRequest) ProtoMessage()    {}
func (*VoteTransactionRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_2cc4e03d2c28c490, []int{0}
}

func (m *VoteTransactionRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_VoteTransactionRequest.Unmarshal(m, b)
}
func (m *VoteTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_VoteTransactionRequest.Marshal(b, m, deterministic)
}
func (m *VoteTransactionRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_VoteTransactionRequest.Merge(m, src)
}
func (m *VoteTransactionRequest) XXX_Size() int {
	return xxx_messageInfo_VoteTransactionRequest.Size(m)
}
func (m *VoteTransactionRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_VoteTransactionRequest.DiscardUnknown(m)
}

var xxx_messageInfo_VoteTransactionRequest proto.InternalMessageInfo

func (m *VoteTransactionRequest) GetRepository() *Repository {
	if m != nil {
		return m.Repository
	}
	return nil
}

func (m *VoteTransactionRequest) GetTransactionId() uint64 {
	if m != nil {
		return m.TransactionId
	}
	return 0
}

func (m *VoteTransactionRequest) GetNode() string {
	if m != nil {
		return m.Node
	}
	return ""
}

func (m *VoteTransactionRequest) GetReferenceUpdatesHash() []byte {
	if m != nil {
		return m.ReferenceUpdatesHash
	}
	return nil
}

type VoteTransactionResponse struct {
	State                VoteTransactionResponse_TransactionState `protobuf:"varint,1,opt,name=state,proto3,enum=gitaly.VoteTransactionResponse_TransactionState" json:"state,omitempty"`
	XXX_NoUnkeyedLiteral struct{}                                 `json:"-"`
	XXX_unrecognized     []byte                                   `json:"-"`
	XXX_sizecache        int32                                    `json:"-"`
}

func (m *VoteTransactionResponse) Reset()         { *m = VoteTransactionResponse{} }
func (m *VoteTransactionResponse) String() string { return proto.CompactTextString(m) }
func (*VoteTransactionResponse) ProtoMessage()    {}
func (*VoteTransactionResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_2cc4e03d2c28c490, []int{1}
}

func (m *VoteTransactionResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_VoteTransactionResponse.Unmarshal(m, b)
}
func (m *VoteTransactionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_VoteTransactionResponse.Marshal(b, m, deterministic)
}
func (m *VoteTransactionResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_VoteTransactionResponse.Merge(m, src)
}
func (m *VoteTransactionResponse) XXX_Size() int {
	return xxx_messageInfo_VoteTransactionResponse.Size(m)
}
func (m *VoteTransactionResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_VoteTransactionResponse.DiscardUnknown(m)
}

var xxx_messageInfo_VoteTransactionResponse proto.InternalMessageInfo

func (m *VoteTransactionResponse) GetState() VoteTransactionResponse_TransactionState {
	if m != nil {
		return m.State
	}
	return VoteTransactionResponse_COMMIT
}

type StopTransactionRequest struct {
	Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
	// ID of the transaction we're processing
	TransactionId        uint64   `protobuf:"varint,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *StopTransactionRequest) Reset()         { *m = StopTransactionRequest{} }
func (m *StopTransactionRequest) String() string { return proto.CompactTextString(m) }
func (*StopTransactionRequest) ProtoMessage()    {}
func (*StopTransactionRequest) Descriptor() ([]byte, []int) {
	return fileDescriptor_2cc4e03d2c28c490, []int{2}
}

func (m *StopTransactionRequest) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_StopTransactionRequest.Unmarshal(m, b)
}
func (m *StopTransactionRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_StopTransactionRequest.Marshal(b, m, deterministic)
}
func (m *StopTransactionRequest) XXX_Merge(src proto.Message) {
	xxx_messageInfo_StopTransactionRequest.Merge(m, src)
}
func (m *StopTransactionRequest) XXX_Size() int {
	return xxx_messageInfo_StopTransactionRequest.Size(m)
}
func (m *StopTransactionRequest) XXX_DiscardUnknown() {
	xxx_messageInfo_StopTransactionRequest.DiscardUnknown(m)
}

var xxx_messageInfo_StopTransactionRequest proto.InternalMessageInfo

func (m *StopTransactionRequest) GetRepository() *Repository {
	if m != nil {
		return m.Repository
	}
	return nil
}

func (m *StopTransactionRequest) GetTransactionId() uint64 {
	if m != nil {
		return m.TransactionId
	}
	return 0
}

type StopTransactionResponse struct {
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (m *StopTransactionResponse) Reset()         { *m = StopTransactionResponse{} }
func (m *StopTransactionResponse) String() string { return proto.CompactTextString(m) }
func (*StopTransactionResponse) ProtoMessage()    {}
func (*StopTransactionResponse) Descriptor() ([]byte, []int) {
	return fileDescriptor_2cc4e03d2c28c490, []int{3}
}

func (m *StopTransactionResponse) XXX_Unmarshal(b []byte) error {
	return xxx_messageInfo_StopTransactionResponse.Unmarshal(m, b)
}
func (m *StopTransactionResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
	return xxx_messageInfo_StopTransactionResponse.Marshal(b, m, deterministic)
}
func (m *StopTransactionResponse) XXX_Merge(src proto.Message) {
	xxx_messageInfo_StopTransactionResponse.Merge(m, src)
}
func (m *StopTransactionResponse) XXX_Size() int {
	return xxx_messageInfo_StopTransactionResponse.Size(m)
}
func (m *StopTransactionResponse) XXX_DiscardUnknown() {
	xxx_messageInfo_StopTransactionResponse.DiscardUnknown(m)
}

var xxx_messageInfo_StopTransactionResponse proto.InternalMessageInfo

func init() {
	proto.RegisterEnum("gitaly.VoteTransactionResponse_TransactionState", VoteTransactionResponse_TransactionState_name, VoteTransactionResponse_TransactionState_value)
	proto.RegisterType((*VoteTransactionRequest)(nil), "gitaly.VoteTransactionRequest")
	proto.RegisterType((*VoteTransactionResponse)(nil), "gitaly.VoteTransactionResponse")
	proto.RegisterType((*StopTransactionRequest)(nil), "gitaly.StopTransactionRequest")
	proto.RegisterType((*StopTransactionResponse)(nil), "gitaly.StopTransactionResponse")
}

func init() { proto.RegisterFile("transaction.proto", fileDescriptor_2cc4e03d2c28c490) }

var fileDescriptor_2cc4e03d2c28c490 = []byte{
	// 389 bytes of a gzipped FileDescriptorProto
	0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xc4, 0x52, 0xc1, 0xae, 0xd2, 0x40,
	0x14, 0x75, 0xb0, 0x34, 0x70, 0x45, 0xac, 0x13, 0x03, 0x95, 0x85, 0x36, 0x4d, 0x4c, 0xba, 0xd0,
	0x56, 0x0b, 0x0b, 0xb7, 0x62, 0x62, 0x64, 0x41, 0x30, 0x43, 0x75, 0xc1, 0x86, 0x0c, 0x74, 0x68,
	0x9b, 0x60, 0xa7, 0xce, 0x0c, 0x26, 0xfc, 0x88, 0xfa, 0x3f, 0x26, 0xc6, 0x6f, 0x7a, 0xab, 0x17,
	0x3a, 0x0f, 0x68, 0xe0, 0x91, 0xb7, 0x7c, 0xbb, 0xdb, 0x73, 0xee, 0x39, 0xbd, 0xe7, 0x64, 0xe0,
	0xa9, 0x12, 0x34, 0x97, 0x74, 0xa9, 0x32, 0x9e, 0xfb, 0x85, 0xe0, 0x8a, 0x63, 0x33, 0xc9, 0x14,
	0x5d, 0x6f, 0x7b, 0xb0, 0xce, 0x72, 0xa5, 0xb1, 0x5e, 0x4b, 0xa6, 0x54, 0xb0, 0x58, 0x7f, 0xb9,
	0x7f, 0x11, 0x74, 0xbe, 0x71, 0xc5, 0xa2, 0xa3, 0x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15, 0x0a, 0xcf,
	0xe0, 0xc9, 0x49, 0x21, 0xf8, 0xc5, 0xc5, 0xa6, 0xca, 0x04, 0xbd, 0x97, 0x77, 0x34, 0xe9, 0x9a,
	0x57, 0xbf, 0xbd, 0x5a, 0x03, 0xed, 0xbc, 0x4f, 0x2e, 0x39, 0x7a, 0xdf, 0xde, 0xce, 0xd1, 0xfb,
	0x42, 0x84, 0xbd, 0xf7, 0x70, 0x30, 0x0b, 0x93, 0x4c, 0xad, 0xe9, 0xc2, 0x5f, 0xf2, 0xef, 0x81,
	0x1e, 0xdf, 0x70, 0x91, 0x04, 0x5a, 0x1f, 0xfc, 0x7c, 0x37, 0x08, 0xca, 0x97, 0x1e, 0x24, 0xfc,
	0x06, 0x2b, 0x16, 0x0b, 0xb3, 0x84, 0xfa, 0xd7, 0x01, 0x00, 0x00, 0xff, 0xff, 0x02, 0x85, 0x5c,
	0xce, 0x33, 0x03, 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

// RefTransactionClient is the client API for RefTransaction service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
type RefTransactionClient interface {
	VoteTransaction(ctx context.Context, in *VoteTransactionRequest, opts ...grpc.CallOption) (*VoteTransactionResponse, error)
	StopTransaction(ctx context.Context, in *StopTransactionRequest, opts ...grpc.CallOption) (*StopTransactionResponse, error)
}

type refTransactionClient struct {
	cc *grpc.ClientConn
}

func NewRefTransactionClient(cc *grpc.ClientConn) RefTransactionClient {
	return &refTransactionClient{cc}
}

func (c *refTransactionClient) VoteTransaction(ctx context.Context, in *VoteTransactionRequest, opts ...grpc.CallOption) (*VoteTransactionResponse, error) {
	out := new(VoteTransactionResponse)
	err := c.cc.Invoke(ctx, "/gitaly.RefTransaction/VoteTransaction", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *refTransactionClient) StopTransaction(ctx context.Context, in *StopTransactionRequest, opts ...grpc.CallOption) (*StopTransactionResponse, error) {
	out := new(StopTransactionResponse)
	err := c.cc.Invoke(ctx, "/gitaly.RefTransaction/StopTransaction", in, out, opts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// RefTransactionServer is the server API for RefTransaction service.
type RefTransactionServer interface {
	VoteTransaction(context.Context, *VoteTransactionRequest) (*VoteTransactionResponse, error)
	StopTransaction(context.Context, *StopTransactionRequest) (*StopTransactionResponse, error)
}

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

func (*UnimplementedRefTransactionServer) VoteTransaction(ctx context.Context, req *VoteTransactionRequest) (*VoteTransactionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method VoteTransaction not implemented")
}
func (*UnimplementedRefTransactionServer) StopTransaction(ctx context.Context, req *StopTransactionRequest) (*StopTransactionResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method StopTransaction not implemented")
}

func RegisterRefTransactionServer(s *grpc.Server, srv RefTransactionServer) {
	s.RegisterService(&_RefTransaction_serviceDesc, srv)
}

func _RefTransaction_VoteTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(VoteTransactionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RefTransactionServer).VoteTransaction(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gitaly.RefTransaction/VoteTransaction",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RefTransactionServer).VoteTransaction(ctx, req.(*VoteTransactionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _RefTransaction_StopTransaction_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(StopTransactionRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(RefTransactionServer).StopTransaction(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: "/gitaly.RefTransaction/StopTransaction",
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(RefTransactionServer).StopTransaction(ctx, req.(*StopTransactionRequest))
	}
	return interceptor(ctx, in, info, handler)
}

var _RefTransaction_serviceDesc = grpc.ServiceDesc{
	ServiceName: "gitaly.RefTransaction",
	HandlerType: (*RefTransactionServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "VoteTransaction",
			Handler:    _RefTransaction_VoteTransaction_Handler,
		},
		{
			MethodName: "StopTransaction",
			Handler:    _RefTransaction_StopTransaction_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "transaction.proto",
}
