syntax = "proto3";

package envoy.extensions.filters.network.golang.v3alpha;

import "google/protobuf/any.proto";

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

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

option java_package = "io.envoyproxy.envoy.extensions.filters.network.golang.v3alpha";
option java_outer_classname = "GolangProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/filters/network/golang/v3alpha";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
option (xds.annotations.v3.file_status).work_in_progress = true;

// [#protodoc-title: Golang network filter]
//
// Golang network filter :ref:`configuration overview <config_network_filters_golang>`.
// [#extension: envoy.filters.network.golang]

// [#next-free-field: 6]
message Config {
  // Bool ``true`` if this filter must be the last filter in a filter chain, ``false`` otherwise.
  bool is_terminal_filter = 1;

  // Globally unique ID for a dynamic library file.
  string library_id = 2 [(validate.rules).string = {min_len: 1}];

  // Path to a dynamic library implementing the
  // :repo:`DownstreamFilter API <contrib/golang/common/go/api.DownstreamFilter>`
  // interface.
  // [#comment:TODO(wangfakang): Support for downloading libraries from remote repositories.]
  string library_path = 3 [(validate.rules).string = {min_len: 1}];

  // Globally unique name of the Go plugin.
  //
  // This name **must** be consistent with the name registered in ``network::RegisterNetworkFilterConfigFactory``
  //
  string plugin_name = 4 [(validate.rules).string = {min_len: 1}];

  // Configuration for the Go plugin.
  //
  // .. note::
  //     This configuration is only parsed in the go plugin, and is therefore not validated
  //     by Envoy.
  //
  //     See the :repo:`DownstreamFilter API <contrib/golang/common/go/api/filter.go>`
  //     for more information about how the plugin's configuration data can be accessed.
  //
  google.protobuf.Any plugin_config = 5;
}
