Skip to content

Git designed for AI agents.

16.2 KB
Raw Blame
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.12
// 	protoc        v6.30.2
// source: transaction.proto

package gitalypb

import (
	protoreflect "google.golang.org/protobuf/reflect/protoreflect"
	protoimpl "google.golang.org/protobuf/runtime/protoimpl"
	reflect "reflect"
	sync "sync"
	unsafe "unsafe"
)

const (
	// Verify that this generated code is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
	// Verify that runtime/protoimpl is sufficiently up-to-date.
	_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)

// Phase ...
type VoteTransactionRequest_Phase int32

const (
	// UNKNOWN_PHASE is the unknown voting phase. This value has been the
	// default because phases have been introduced. Eventually, using this
	// phase will become unsupported.
	VoteTransactionRequest_UNKNOWN_PHASE VoteTransactionRequest_Phase = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH
	// PREPARED_PHASE is the prepratory phase. The data that is about to change
	// is locked for concurrent modification, but changes have not yet been
	// written to disk.
	VoteTransactionRequest_PREPARED_PHASE VoteTransactionRequest_Phase = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
	// COMMITTED_PHASE is the committing phase. Data has been committed to disk
	// and will be visible in all subsequent requests.
	VoteTransactionRequest_COMMITTED_PHASE VoteTransactionRequest_Phase = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
	// SYNCHRONIZED_PHASE is the synchronizing phase. This is used to synchronize nodes with each other on a
	// specific event.
	VoteTransactionRequest_SYNCHRONIZED_PHASE VoteTransactionRequest_Phase = 3 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
	// PREPARING_PHASE is the phase before PREPARED_PHASE. The data is not yet locked.
	VoteTransactionRequest_PREPARING_PHASE VoteTransactionRequest_Phase = 4 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
)

// Enum value maps for VoteTransactionRequest_Phase.
var (
	VoteTransactionRequest_Phase_name = map[int32]string{
		0: "UNKNOWN_PHASE",
		1: "PREPARED_PHASE",
		2: "COMMITTED_PHASE",
		3: "SYNCHRONIZED_PHASE",
		4: "PREPARING_PHASE",
	}
	VoteTransactionRequest_Phase_value = map[string]int32{
		"UNKNOWN_PHASE":      0,
		"PREPARED_PHASE":     1,
		"COMMITTED_PHASE":    2,
		"SYNCHRONIZED_PHASE": 3,
		"PREPARING_PHASE":    4,
	}
)

func (x VoteTransactionRequest_Phase) Enum() *VoteTransactionRequest_Phase {
	p := new(VoteTransactionRequest_Phase)
	*p = x
	return p
}

func (x VoteTransactionRequest_Phase) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (VoteTransactionRequest_Phase) Descriptor() protoreflect.EnumDescriptor {
	return file_transaction_proto_enumTypes[0].Descriptor()
}

func (VoteTransactionRequest_Phase) Type() protoreflect.EnumType {
	return &file_transaction_proto_enumTypes[0]
}

func (x VoteTransactionRequest_Phase) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use VoteTransactionRequest_Phase.Descriptor instead.
func (VoteTransactionRequest_Phase) EnumDescriptor() ([]byte, []int) {
	return file_transaction_proto_rawDescGZIP(), []int{0, 0}
}

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

const (
	// COMMIT ...
	VoteTransactionResponse_COMMIT VoteTransactionResponse_TransactionState = 0 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX ENUM_FIELD_NAMES_ZERO_VALUE_END_WITH
	// ABORT ...
	VoteTransactionResponse_ABORT VoteTransactionResponse_TransactionState = 1 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
	// STOP ...
	VoteTransactionResponse_STOP VoteTransactionResponse_TransactionState = 2 // protolint:disable:this ENUM_FIELD_NAMES_PREFIX
)

// Enum value maps for VoteTransactionResponse_TransactionState.
var (
	VoteTransactionResponse_TransactionState_name = map[int32]string{
		0: "COMMIT",
		1: "ABORT",
		2: "STOP",
	}
	VoteTransactionResponse_TransactionState_value = map[string]int32{
		"COMMIT": 0,
		"ABORT":  1,
		"STOP":   2,
	}
)

func (x VoteTransactionResponse_TransactionState) Enum() *VoteTransactionResponse_TransactionState {
	p := new(VoteTransactionResponse_TransactionState)
	*p = x
	return p
}

func (x VoteTransactionResponse_TransactionState) String() string {
	return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
}

func (VoteTransactionResponse_TransactionState) Descriptor() protoreflect.EnumDescriptor {
	return file_transaction_proto_enumTypes[1].Descriptor()
}

func (VoteTransactionResponse_TransactionState) Type() protoreflect.EnumType {
	return &file_transaction_proto_enumTypes[1]
}

func (x VoteTransactionResponse_TransactionState) Number() protoreflect.EnumNumber {
	return protoreflect.EnumNumber(x)
}

// Deprecated: Use VoteTransactionResponse_TransactionState.Descriptor instead.
func (VoteTransactionResponse_TransactionState) EnumDescriptor() ([]byte, []int) {
	return file_transaction_proto_rawDescGZIP(), []int{1, 0}
}

// VoteTransactionRequest ...
type VoteTransactionRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// repository ...
	Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
	// transaction_id is the ID of the transaction we're processing.
	TransactionId uint64 `protobuf:"varint,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	// node is the name of the Gitaly node that's voting on a transaction.
	Node string `protobuf:"bytes,3,opt,name=node,proto3" json:"node,omitempty"`
	// reference_updates_hash is the 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"`
	// phase is the voting phase.
	Phase         VoteTransactionRequest_Phase `protobuf:"varint,5,opt,name=phase,proto3,enum=gitaly.VoteTransactionRequest_Phase" json:"phase,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *VoteTransactionRequest) Reset() {
	*x = VoteTransactionRequest{}
	mi := &file_transaction_proto_msgTypes[0]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *VoteTransactionRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*VoteTransactionRequest) ProtoMessage() {}

func (x *VoteTransactionRequest) ProtoReflect() protoreflect.Message {
	mi := &file_transaction_proto_msgTypes[0]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use VoteTransactionRequest.ProtoReflect.Descriptor instead.
func (*VoteTransactionRequest) Descriptor() ([]byte, []int) {
	return file_transaction_proto_rawDescGZIP(), []int{0}
}

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

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

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

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

func (x *VoteTransactionRequest) GetPhase() VoteTransactionRequest_Phase {
	if x != nil {
		return x.Phase
	}
	return VoteTransactionRequest_UNKNOWN_PHASE
}

// VoteTransactionResponse ...
type VoteTransactionResponse struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// state ...
	State         VoteTransactionResponse_TransactionState `protobuf:"varint,1,opt,name=state,proto3,enum=gitaly.VoteTransactionResponse_TransactionState" json:"state,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *VoteTransactionResponse) Reset() {
	*x = VoteTransactionResponse{}
	mi := &file_transaction_proto_msgTypes[1]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *VoteTransactionResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*VoteTransactionResponse) ProtoMessage() {}

func (x *VoteTransactionResponse) ProtoReflect() protoreflect.Message {
	mi := &file_transaction_proto_msgTypes[1]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use VoteTransactionResponse.ProtoReflect.Descriptor instead.
func (*VoteTransactionResponse) Descriptor() ([]byte, []int) {
	return file_transaction_proto_rawDescGZIP(), []int{1}
}

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

// StopTransactionRequest ...
type StopTransactionRequest struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// repository ...
	Repository *Repository `protobuf:"bytes,1,opt,name=repository,proto3" json:"repository,omitempty"`
	// transaction_id is the ID of the transaction we're processing.
	TransactionId uint64 `protobuf:"varint,2,opt,name=transaction_id,json=transactionId,proto3" json:"transaction_id,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *StopTransactionRequest) Reset() {
	*x = StopTransactionRequest{}
	mi := &file_transaction_proto_msgTypes[2]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *StopTransactionRequest) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*StopTransactionRequest) ProtoMessage() {}

func (x *StopTransactionRequest) ProtoReflect() protoreflect.Message {
	mi := &file_transaction_proto_msgTypes[2]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use StopTransactionRequest.ProtoReflect.Descriptor instead.
func (*StopTransactionRequest) Descriptor() ([]byte, []int) {
	return file_transaction_proto_rawDescGZIP(), []int{2}
}

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

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

// StopTransactionResponse ...
type StopTransactionResponse struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

func (x *StopTransactionResponse) Reset() {
	*x = StopTransactionResponse{}
	mi := &file_transaction_proto_msgTypes[3]
	ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
	ms.StoreMessageInfo(mi)
}

func (x *StopTransactionResponse) String() string {
	return protoimpl.X.MessageStringOf(x)
}

func (*StopTransactionResponse) ProtoMessage() {}

func (x *StopTransactionResponse) ProtoReflect() protoreflect.Message {
	mi := &file_transaction_proto_msgTypes[3]
	if x != nil {
		ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
		if ms.LoadMessageInfo() == nil {
			ms.StoreMessageInfo(mi)
		}
		return ms
	}
	return mi.MessageOf(x)
}

// Deprecated: Use StopTransactionResponse.ProtoReflect.Descriptor instead.
func (*StopTransactionResponse) Descriptor() ([]byte, []int) {
	return file_transaction_proto_rawDescGZIP(), []int{3}
}

var File_transaction_proto protoreflect.FileDescriptor

const file_transaction_proto_rawDesc = "" +
	"\n" +
	"\x11transaction.proto\x12\x06gitaly\x1a\n" +
	"lint.proto\x1a\fshared.proto\"\xf1\x02\n" +
	"\x16VoteTransactionRequest\x128\n" +
	"\n" +
	"repository\x18\x01 \x01(\v2\x12.gitaly.RepositoryB\x04\x98\xc6,\x01R\n" +
	"repository\x12%\n" +
	"\x0etransaction_id\x18\x02 \x01(\x04R\rtransactionId\x12\x12\n" +
	"\x04node\x18\x03 \x01(\tR\x04node\x124\n" +
	"\x16reference_updates_hash\x18\x04 \x01(\fR\x14referenceUpdatesHash\x12:\n" +
	"\x05phase\x18\x05 \x01(\x0e2$.gitaly.VoteTransactionRequest.PhaseR\x05phase\"p\n" +
	"\x05Phase\x12\x11\n" +
	"\rUNKNOWN_PHASE\x10\x00\x12\x12\n" +
	"\x0ePREPARED_PHASE\x10\x01\x12\x13\n" +
	"\x0fCOMMITTED_PHASE\x10\x02\x12\x16\n" +
	"\x12SYNCHRONIZED_PHASE\x10\x03\x12\x13\n" +
	"\x0fPREPARING_PHASE\x10\x04\"\x96\x01\n" +
	"\x17VoteTransactionResponse\x12F\n" +
	"\x05state\x18\x01 \x01(\x0e20.gitaly.VoteTransactionResponse.TransactionStateR\x05state\"3\n" +
	"\x10TransactionState\x12\n" +
	"\n" +
	"\x06COMMIT\x10\x00\x12\t\n" +
	"\x05ABORT\x10\x01\x12\b\n" +
	"\x04STOP\x10\x02\"y\n" +
	"\x16StopTransactionRequest\x128\n" +
	"\n" +
	"repository\x18\x01 \x01(\v2\x12.gitaly.RepositoryB\x04\x98\xc6,\x01R\n" +
	"repository\x12%\n" +
	"\x0etransaction_id\x18\x02 \x01(\x04R\rtransactionId\"\x19\n" +
	"\x17StopTransactionResponse2\xbe\x01\n" +
	"\x0eRefTransaction\x12R\n" +
	"\x0fVoteTransaction\x12\x1e.gitaly.VoteTransactionRequest\x1a\x1f.gitaly.VoteTransactionResponse\x12R\n" +
	"\x0fStopTransaction\x12\x1e.gitaly.StopTransactionRequest\x1a\x1f.gitaly.StopTransactionResponse\x1a\x04\xf0\x97(\x01B.Z,github.com/feder-cr/git-ai/proto/go/gitalypbb\x06proto3"

var (
	file_transaction_proto_rawDescOnce sync.Once
	file_transaction_proto_rawDescData []byte
)

func file_transaction_proto_rawDescGZIP() []byte {
	file_transaction_proto_rawDescOnce.Do(func() {
		file_transaction_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_transaction_proto_rawDesc), len(file_transaction_proto_rawDesc)))
	})
	return file_transaction_proto_rawDescData
}

var file_transaction_proto_enumTypes = make([]protoimpl.EnumInfo, 2)
var file_transaction_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_transaction_proto_goTypes = []any{
	(VoteTransactionRequest_Phase)(0),             // 0: gitaly.VoteTransactionRequest.Phase
	(VoteTransactionResponse_TransactionState)(0), // 1: gitaly.VoteTransactionResponse.TransactionState
	(*VoteTransactionRequest)(nil),                // 2: gitaly.VoteTransactionRequest
	(*VoteTransactionResponse)(nil),               // 3: gitaly.VoteTransactionResponse
	(*StopTransactionRequest)(nil),                // 4: gitaly.StopTransactionRequest
	(*StopTransactionResponse)(nil),               // 5: gitaly.StopTransactionResponse
	(*Repository)(nil),                            // 6: gitaly.Repository
}
var file_transaction_proto_depIdxs = []int32{
	6, // 0: gitaly.VoteTransactionRequest.repository:type_name -> gitaly.Repository
	0, // 1: gitaly.VoteTransactionRequest.phase:type_name -> gitaly.VoteTransactionRequest.Phase
	1, // 2: gitaly.VoteTransactionResponse.state:type_name -> gitaly.VoteTransactionResponse.TransactionState
	6, // 3: gitaly.StopTransactionRequest.repository:type_name -> gitaly.Repository
	2, // 4: gitaly.RefTransaction.VoteTransaction:input_type -> gitaly.VoteTransactionRequest
	4, // 5: gitaly.RefTransaction.StopTransaction:input_type -> gitaly.StopTransactionRequest
	3, // 6: gitaly.RefTransaction.VoteTransaction:output_type -> gitaly.VoteTransactionResponse
	5, // 7: gitaly.RefTransaction.StopTransaction:output_type -> gitaly.StopTransactionResponse
	6, // [6:8] is the sub-list for method output_type
	4, // [4:6] is the sub-list for method input_type
	4, // [4:4] is the sub-list for extension type_name
	4, // [4:4] is the sub-list for extension extendee
	0, // [0:4] is the sub-list for field type_name
}

func init() { file_transaction_proto_init() }
func file_transaction_proto_init() {
	if File_transaction_proto != nil {
		return
	}
	file_lint_proto_init()
	file_shared_proto_init()
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_transaction_proto_rawDesc), len(file_transaction_proto_rawDesc)),
			NumEnums:      2,
			NumMessages:   4,
			NumExtensions: 0,
			NumServices:   1,
		},
		GoTypes:           file_transaction_proto_goTypes,
		DependencyIndexes: file_transaction_proto_depIdxs,
		EnumInfos:         file_transaction_proto_enumTypes,
		MessageInfos:      file_transaction_proto_msgTypes,
	}.Build()
	File_transaction_proto = out.File
	file_transaction_proto_goTypes = nil
	file_transaction_proto_depIdxs = nil
}