Documentation ¶
Index ¶
Constants ¶
View Source
const DefaultCacheSize int = 1024
DefaultCacheSize defines the default size of the LRU cache used by the validator
Variables ¶
This section is empty.
Functions ¶
Types ¶
type HashableProtoMessage ¶
type HashableProtoMessage interface { protoiface.MessageV1 Hash(hasher hash.Hash64) (uint64, error) }
HashableProtoMessage defines a ProtoMessage that can be hashed. Useful when passing different ProtoMessages objects that need to be hashed.
type Option ¶
type Option func(*config)
func WithCacheSize ¶
func WithCounters ¶
func WithCounters(cacheHits, cacheMisses *stats.Int64Measure) Option
type Validator ¶
type Validator interface { // ValidateConfig validates the given envoy config and returns any out and error from envoy. Returns nil if the envoy binary is not found. ValidateConfig(ctx context.Context, config HashableProtoMessage) error // CacheLength returns the returns the number of items in the cache CacheLength() int }
Validator validates an envoy config by running it by envoy in validate mode. This requires the envoy binary to be present at $ENVOY_BINARY_PATH (defaults to /usr/local/bin/envoy). Results are cached via an LRU cache for performance
Click to show internal directories.
Click to hide internal directories.