1
#pragma once
2

            
3
#include "envoy/matcher/matcher.h"
4

            
5
namespace Envoy {
6
namespace Extensions {
7
namespace Matching {
8
namespace CommonInputs {
9
namespace EnvironmentVariable {
10

            
11
class Input : public Matcher::CommonProtocolInput {
12
public:
13
4
  explicit Input(absl::optional<absl::string_view> value) : storage_(value) {}
14

            
15
4
  Matcher::DataInputGetResult get() override {
16
4
    return storage_ ? Matcher::DataInputGetResult::CreateStringView(*storage_)
17
4
                    : Matcher::DataInputGetResult::NoData();
18
4
  }
19

            
20
private:
21
  const absl::optional<absl::string_view> storage_;
22
};
23
} // namespace EnvironmentVariable
24
} // namespace CommonInputs
25
} // namespace Matching
26
} // namespace Extensions
27
} // namespace Envoy