// Copyright 2025 Envoy Project Authors
//
// 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.

syntax = "proto3";

package envoy.extensions.key_value.file_based.v3;

import "google/protobuf/duration.proto";
import "google/protobuf/wrappers.proto";

import "xds/annotations/v3/status.proto";

import "udpa/annotations/status.proto";
import "validate/validate.proto";

option java_package = "io.envoyproxy.envoy.extensions.key_value.file_based.v3";
option java_outer_classname = "ConfigProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/key_value/file_based/v3;file_basedv3";
option (udpa.annotations.file_status).package_version_status = ACTIVE;

// [#protodoc-title: Key/value file-based store storage plugin]

// [#extension: envoy.key_value.file_based]
// This is configuration to flush a key value store out to disk.
message FileBasedKeyValueStoreConfig {
  option (xds.annotations.v3.message_status).work_in_progress = true;

  // The filename to read the keys and values from, and write the keys and
  // values to.
  string filename = 1 [(validate.rules).string = {min_len: 1}];

  // The interval at which the key value store should be flushed to the file.
  google.protobuf.Duration flush_interval = 2;

  // The maximum number of entries to cache, or 0 to allow for unlimited entries.
  // Defaults to 1000 if not present.
  google.protobuf.UInt32Value max_entries = 3;
}
