// Copyright 2018 Google LLC. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// 	protoc-gen-go v1.36.10
// 	protoc        v3.20.1
// source: trillian/migrillian/configpb/config.proto

package configpb

import (
	configpb "github.com/google/certificate-transparency-go/trillian/ctfe/configpb"
	keyspb "github.com/google/trillian/crypto/keyspb"
	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)
)

// IdentityFunction specifies how Trillian identity hash is computed.
type IdentityFunction int32

const (
	IdentityFunction_UNKNOWN_IDENTITY_FUNCTION IdentityFunction = 0
	// Returns SHA256 hash of the certificate DER. This is the same function that
	// CTFE uses when submitting add-[pre-]chain entries to Trillian.
	//
	// For example, it can be used when migrating a CT log to Trillian. Using the
	// same function as CTFE makes any newly submitted entries compatible with the
	// ones that migrated from the source log.
	IdentityFunction_SHA256_CERT_DATA IdentityFunction = 1
	// Returns SHA256 hash of the leaf index.
	//
	// For example, this function can be used for mirroring CT logs. Since the
	// source logs might have duplicates of different kinds (depends on the
	// operator), this function allows storing them all (unlike SHA256_CERT_DATA).
	// Note that the CTFE log must stay read-only (mirror), as CTFE's identity
	// hash is incompatible.
	IdentityFunction_SHA256_LEAF_INDEX IdentityFunction = 2
)

// Enum value maps for IdentityFunction.
var (
	IdentityFunction_name = map[int32]string{
		0: "UNKNOWN_IDENTITY_FUNCTION",
		1: "SHA256_CERT_DATA",
		2: "SHA256_LEAF_INDEX",
	}
	IdentityFunction_value = map[string]int32{
		"UNKNOWN_IDENTITY_FUNCTION": 0,
		"SHA256_CERT_DATA":          1,
		"SHA256_LEAF_INDEX":         2,
	}
)

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

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

func (IdentityFunction) Descriptor() protoreflect.EnumDescriptor {
	return file_trillian_migrillian_configpb_config_proto_enumTypes[0].Descriptor()
}

func (IdentityFunction) Type() protoreflect.EnumType {
	return &file_trillian_migrillian_configpb_config_proto_enumTypes[0]
}

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

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

// MigrationConfig describes the configuration options for a single CT log
// migration instance.
type MigrationConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The URI of the source CT log, e.g. "https://ct.googleapis.com/pilot".
	SourceUri string `protobuf:"bytes,1,opt,name=source_uri,json=sourceUri,proto3" json:"source_uri,omitempty"`
	// The public key of the source log.
	PublicKey *keyspb.PublicKey `protobuf:"bytes,2,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
	// The name of the backend which this log migrates to. The name must be one of
	// those defined in the LogBackendSet.
	//
	// Deprecated. TODO(pavelkalinnikov): Remove it.
	//
	// Deprecated: Marked as deprecated in trillian/migrillian/configpb/config.proto.
	LogBackendName string `protobuf:"bytes,3,opt,name=log_backend_name,json=logBackendName,proto3" json:"log_backend_name,omitempty"`
	// The ID of a Trillian PREORDERED_LOG tree that stores the log data.
	LogId int64 `protobuf:"varint,4,opt,name=log_id,json=logId,proto3" json:"log_id,omitempty"`
	// Max number of entries per get-entries request from the source log.
	BatchSize int32 `protobuf:"varint,5,opt,name=batch_size,json=batchSize,proto3" json:"batch_size,omitempty"`
	// Determines whether the migration should run continuously, i.e. watch and
	// follow the updates of the source log's STH. For example, this mode can be
	// used to support a mirror CT log.
	IsContinuous bool `protobuf:"varint,6,opt,name=is_continuous,json=isContinuous,proto3" json:"is_continuous,omitempty"`
	// The log entry index to start fetching at. If negative, then it is assumed
	// equal to the current Trillian tree size.
	// Ignored in continuous mode which starts at the point where it stopped (e.g.
	// the current Trillian tree size in a simple case).
	StartIndex int64 `protobuf:"varint,7,opt,name=start_index,json=startIndex,proto3" json:"start_index,omitempty"`
	// The log index to end fetching at, non-inclusive. If zero, fetch up to the
	// source log's current STH. Ignored in continuous mode which keeps updating
	// STH and fetching up to that.
	EndIndex int64 `protobuf:"varint,8,opt,name=end_index,json=endIndex,proto3" json:"end_index,omitempty"`
	// The number of parallel get-entries fetchers. Assumed equal to 1 if not
	// specified.
	NumFetchers int32 `protobuf:"varint,9,opt,name=num_fetchers,json=numFetchers,proto3" json:"num_fetchers,omitempty"`
	// The number of parallel workers submitting entries to Trillian. Assumed
	// equal to 1 if not specified.
	NumSubmitters int32 `protobuf:"varint,10,opt,name=num_submitters,json=numSubmitters,proto3" json:"num_submitters,omitempty"`
	// Max number of batches in fetchers->submitters channel.
	ChannelSize int32 `protobuf:"varint,11,opt,name=channel_size,json=channelSize,proto3" json:"channel_size,omitempty"`
	// The function that computes LeafIdentityHash for Trillian log entries.
	IdentityFunction IdentityFunction `protobuf:"varint,12,opt,name=identity_function,json=identityFunction,proto3,enum=configpb.IdentityFunction" json:"identity_function,omitempty"`
	// If set to false (by default), then Migrillian verifies that the tree as
	// seen by Trillian is consistent with the current STH of the source CT log.
	// It invokes the get-sth-consistency endpoint (section 4.4 of RFC 6962) with
	// the corresponding tree sizes, and verifies the returned proof.
	NoConsistencyCheck bool `protobuf:"varint,13,opt,name=no_consistency_check,json=noConsistencyCheck,proto3" json:"no_consistency_check,omitempty"`
	unknownFields      protoimpl.UnknownFields
	sizeCache          protoimpl.SizeCache
}

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

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

func (*MigrationConfig) ProtoMessage() {}

func (x *MigrationConfig) ProtoReflect() protoreflect.Message {
	mi := &file_trillian_migrillian_configpb_config_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 MigrationConfig.ProtoReflect.Descriptor instead.
func (*MigrationConfig) Descriptor() ([]byte, []int) {
	return file_trillian_migrillian_configpb_config_proto_rawDescGZIP(), []int{0}
}

func (x *MigrationConfig) GetSourceUri() string {
	if x != nil {
		return x.SourceUri
	}
	return ""
}

func (x *MigrationConfig) GetPublicKey() *keyspb.PublicKey {
	if x != nil {
		return x.PublicKey
	}
	return nil
}

// Deprecated: Marked as deprecated in trillian/migrillian/configpb/config.proto.
func (x *MigrationConfig) GetLogBackendName() string {
	if x != nil {
		return x.LogBackendName
	}
	return ""
}

func (x *MigrationConfig) GetLogId() int64 {
	if x != nil {
		return x.LogId
	}
	return 0
}

func (x *MigrationConfig) GetBatchSize() int32 {
	if x != nil {
		return x.BatchSize
	}
	return 0
}

func (x *MigrationConfig) GetIsContinuous() bool {
	if x != nil {
		return x.IsContinuous
	}
	return false
}

func (x *MigrationConfig) GetStartIndex() int64 {
	if x != nil {
		return x.StartIndex
	}
	return 0
}

func (x *MigrationConfig) GetEndIndex() int64 {
	if x != nil {
		return x.EndIndex
	}
	return 0
}

func (x *MigrationConfig) GetNumFetchers() int32 {
	if x != nil {
		return x.NumFetchers
	}
	return 0
}

func (x *MigrationConfig) GetNumSubmitters() int32 {
	if x != nil {
		return x.NumSubmitters
	}
	return 0
}

func (x *MigrationConfig) GetChannelSize() int32 {
	if x != nil {
		return x.ChannelSize
	}
	return 0
}

func (x *MigrationConfig) GetIdentityFunction() IdentityFunction {
	if x != nil {
		return x.IdentityFunction
	}
	return IdentityFunction_UNKNOWN_IDENTITY_FUNCTION
}

func (x *MigrationConfig) GetNoConsistencyCheck() bool {
	if x != nil {
		return x.NoConsistencyCheck
	}
	return false
}

// MigrationConfigSet is a set of MigrationConfig messages.
type MigrationConfigSet struct {
	state         protoimpl.MessageState `protogen:"open.v1"`
	Config        []*MigrationConfig     `protobuf:"bytes,1,rep,name=config,proto3" json:"config,omitempty"`
	unknownFields protoimpl.UnknownFields
	sizeCache     protoimpl.SizeCache
}

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

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

func (*MigrationConfigSet) ProtoMessage() {}

func (x *MigrationConfigSet) ProtoReflect() protoreflect.Message {
	mi := &file_trillian_migrillian_configpb_config_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 MigrationConfigSet.ProtoReflect.Descriptor instead.
func (*MigrationConfigSet) Descriptor() ([]byte, []int) {
	return file_trillian_migrillian_configpb_config_proto_rawDescGZIP(), []int{1}
}

func (x *MigrationConfigSet) GetConfig() []*MigrationConfig {
	if x != nil {
		return x.Config
	}
	return nil
}

// MigrillianConfig holds configuration for multiple migration / mirroring jobs.
type MigrillianConfig struct {
	state protoimpl.MessageState `protogen:"open.v1"`
	// The set of backends that this configuration will use to send requests to.
	// The names of the backends in the LogBackendSet must all be distinct.
	//
	// Deprecated. TODO(pavelkalinnikov): Remove it.
	//
	// Deprecated: Marked as deprecated in trillian/migrillian/configpb/config.proto.
	Backends *configpb.LogBackendSet `protobuf:"bytes,1,opt,name=backends,proto3" json:"backends,omitempty"`
	// The set of migrations that will use the above backends. All the protos in
	// it must set a valid log_backend_name for the config to be usable.
	MigrationConfigs *MigrationConfigSet `protobuf:"bytes,2,opt,name=migration_configs,json=migrationConfigs,proto3" json:"migration_configs,omitempty"`
	unknownFields    protoimpl.UnknownFields
	sizeCache        protoimpl.SizeCache
}

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

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

func (*MigrillianConfig) ProtoMessage() {}

func (x *MigrillianConfig) ProtoReflect() protoreflect.Message {
	mi := &file_trillian_migrillian_configpb_config_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 MigrillianConfig.ProtoReflect.Descriptor instead.
func (*MigrillianConfig) Descriptor() ([]byte, []int) {
	return file_trillian_migrillian_configpb_config_proto_rawDescGZIP(), []int{2}
}

// Deprecated: Marked as deprecated in trillian/migrillian/configpb/config.proto.
func (x *MigrillianConfig) GetBackends() *configpb.LogBackendSet {
	if x != nil {
		return x.Backends
	}
	return nil
}

func (x *MigrillianConfig) GetMigrationConfigs() *MigrationConfigSet {
	if x != nil {
		return x.MigrationConfigs
	}
	return nil
}

var File_trillian_migrillian_configpb_config_proto protoreflect.FileDescriptor

const file_trillian_migrillian_configpb_config_proto_rawDesc = "" +
	"\n" +
	")trillian/migrillian/configpb/config.proto\x12\bconfigpb\x1a#trillian/ctfe/configpb/config.proto\x1a\x1acrypto/keyspb/keyspb.proto\"\x91\x04\n" +
	"\x0fMigrationConfig\x12\x1d\n" +
	"\n" +
	"source_uri\x18\x01 \x01(\tR\tsourceUri\x120\n" +
	"\n" +
	"public_key\x18\x02 \x01(\v2\x11.keyspb.PublicKeyR\tpublicKey\x12,\n" +
	"\x10log_backend_name\x18\x03 \x01(\tB\x02\x18\x01R\x0elogBackendName\x12\x15\n" +
	"\x06log_id\x18\x04 \x01(\x03R\x05logId\x12\x1d\n" +
	"\n" +
	"batch_size\x18\x05 \x01(\x05R\tbatchSize\x12#\n" +
	"\ris_continuous\x18\x06 \x01(\bR\fisContinuous\x12\x1f\n" +
	"\vstart_index\x18\a \x01(\x03R\n" +
	"startIndex\x12\x1b\n" +
	"\tend_index\x18\b \x01(\x03R\bendIndex\x12!\n" +
	"\fnum_fetchers\x18\t \x01(\x05R\vnumFetchers\x12%\n" +
	"\x0enum_submitters\x18\n" +
	" \x01(\x05R\rnumSubmitters\x12!\n" +
	"\fchannel_size\x18\v \x01(\x05R\vchannelSize\x12G\n" +
	"\x11identity_function\x18\f \x01(\x0e2\x1a.configpb.IdentityFunctionR\x10identityFunction\x120\n" +
	"\x14no_consistency_check\x18\r \x01(\bR\x12noConsistencyCheck\"G\n" +
	"\x12MigrationConfigSet\x121\n" +
	"\x06config\x18\x01 \x03(\v2\x19.configpb.MigrationConfigR\x06config\"\x96\x01\n" +
	"\x10MigrillianConfig\x127\n" +
	"\bbackends\x18\x01 \x01(\v2\x17.configpb.LogBackendSetB\x02\x18\x01R\bbackends\x12I\n" +
	"\x11migration_configs\x18\x02 \x01(\v2\x1c.configpb.MigrationConfigSetR\x10migrationConfigs*^\n" +
	"\x10IdentityFunction\x12\x1d\n" +
	"\x19UNKNOWN_IDENTITY_FUNCTION\x10\x00\x12\x14\n" +
	"\x10SHA256_CERT_DATA\x10\x01\x12\x15\n" +
	"\x11SHA256_LEAF_INDEX\x10\x02BLZJgithub.com/google/certificate-transparency-go/trillian/migrillian/configpbb\x06proto3"

var (
	file_trillian_migrillian_configpb_config_proto_rawDescOnce sync.Once
	file_trillian_migrillian_configpb_config_proto_rawDescData []byte
)

func file_trillian_migrillian_configpb_config_proto_rawDescGZIP() []byte {
	file_trillian_migrillian_configpb_config_proto_rawDescOnce.Do(func() {
		file_trillian_migrillian_configpb_config_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_trillian_migrillian_configpb_config_proto_rawDesc), len(file_trillian_migrillian_configpb_config_proto_rawDesc)))
	})
	return file_trillian_migrillian_configpb_config_proto_rawDescData
}

var file_trillian_migrillian_configpb_config_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
var file_trillian_migrillian_configpb_config_proto_msgTypes = make([]protoimpl.MessageInfo, 3)
var file_trillian_migrillian_configpb_config_proto_goTypes = []any{
	(IdentityFunction)(0),          // 0: configpb.IdentityFunction
	(*MigrationConfig)(nil),        // 1: configpb.MigrationConfig
	(*MigrationConfigSet)(nil),     // 2: configpb.MigrationConfigSet
	(*MigrillianConfig)(nil),       // 3: configpb.MigrillianConfig
	(*keyspb.PublicKey)(nil),       // 4: keyspb.PublicKey
	(*configpb.LogBackendSet)(nil), // 5: configpb.LogBackendSet
}
var file_trillian_migrillian_configpb_config_proto_depIdxs = []int32{
	4, // 0: configpb.MigrationConfig.public_key:type_name -> keyspb.PublicKey
	0, // 1: configpb.MigrationConfig.identity_function:type_name -> configpb.IdentityFunction
	1, // 2: configpb.MigrationConfigSet.config:type_name -> configpb.MigrationConfig
	5, // 3: configpb.MigrillianConfig.backends:type_name -> configpb.LogBackendSet
	2, // 4: configpb.MigrillianConfig.migration_configs:type_name -> configpb.MigrationConfigSet
	5, // [5:5] is the sub-list for method output_type
	5, // [5:5] is the sub-list for method input_type
	5, // [5:5] is the sub-list for extension type_name
	5, // [5:5] is the sub-list for extension extendee
	0, // [0:5] is the sub-list for field type_name
}

func init() { file_trillian_migrillian_configpb_config_proto_init() }
func file_trillian_migrillian_configpb_config_proto_init() {
	if File_trillian_migrillian_configpb_config_proto != nil {
		return
	}
	type x struct{}
	out := protoimpl.TypeBuilder{
		File: protoimpl.DescBuilder{
			GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
			RawDescriptor: unsafe.Slice(unsafe.StringData(file_trillian_migrillian_configpb_config_proto_rawDesc), len(file_trillian_migrillian_configpb_config_proto_rawDesc)),
			NumEnums:      1,
			NumMessages:   3,
			NumExtensions: 0,
			NumServices:   0,
		},
		GoTypes:           file_trillian_migrillian_configpb_config_proto_goTypes,
		DependencyIndexes: file_trillian_migrillian_configpb_config_proto_depIdxs,
		EnumInfos:         file_trillian_migrillian_configpb_config_proto_enumTypes,
		MessageInfos:      file_trillian_migrillian_configpb_config_proto_msgTypes,
	}.Build()
	File_trillian_migrillian_configpb_config_proto = out.File
	file_trillian_migrillian_configpb_config_proto_goTypes = nil
	file_trillian_migrillian_configpb_config_proto_depIdxs = nil
}
