package
1.7.4
Repository: https://github.com/ibm-cloud/go-etcd-rules.git
Documentation: pkg.go.dev

# Packages

No description provided by the author
No description provided by the author

# Functions

EngineConcurrency controls the number of concurrent workers processing rule tasks.
EngineContextProvider sets a custom provider for generating context instances for use by callbacks.
EngineCrawlMutex sets an application identifier mutex and a TTL value for the mutex to limit the number of instances of an application performing a crawl at any given time to one.
EngineDontShareLockSession forces ETCD to create a new concurrency session for each locking attempt.
EngineEnhancedRuleFilter uses a rule filtering mechanism that more accurately selects rules to be evaluated based on given key/value pair.
EngineLockAcquisitionTimeout controls the length of time we wait to acquire a lock.
EngineLockCoolOff is an experimental option to preemptively fail locking attempts if an attempt to obtain the same lock was made within the specified duration so that multiple workers reacting to multiple elements of the same rule and attributes do not cause needless locking.
EngineLockTimeout controls the TTL of a lock in seconds.
EngineMetricsCollector sets a custom metrics collector.
EngineRuleWorkBuffer sets the limit on the number of ruleWork in the channel without a receiving worker.
EngineSyncDelay enables the throttling of the crawlers by introducing a delay (in ms) between queries to keep the crawlers from overwhelming etcd.
EngineSyncInterval enables the interval between sync or crawler runs to be configured.
EngineUseSharedLockSession is an experimental option to use a single concurrency session for managing locks to reduce the ETCD load by eliminating the need to create new concurrency session for each locking attempt.
EngineUseTryLock is an experimental option to fail locking immediately when a lock is already held as opposed to trying to obtain the lock until the timeout expires.
No description provided by the author
EngineWatchTimeout controls the timeout of a watch operation in seconds.
FormatRuleString creates an indented, more readable version of a rule string.
FormatWithAttributes applied the specified attributes to the provided path.
GetEngineOptions is used to convert an EngineOptions instance into an array of EngineOption instances which can then be used when initializing an Engine instance.
GetMetricsMetadata gets metadata about an etcd call from the context.
KeyConstraint enables multiple query prefixes to be generated for a specific attribute as a way to limit the scope of a query for a prefix query.
KeyExpansion enables attributes in rules to be fixed at run time while allowing the rule declarations to continue to use the attribute placeholders.
KeyProcessorBuffer controls the number of key processing events can be buffered at one time.
KeyProcessorConcurrency controls the number of threads processing keys from the watcher and the crawler.
NewAndRule allows two or more dynamic rules to be combined into a single rule such that every nested rule must be satisfied in order for the overall rule to be satisfied.
NewAttributes provides a map-based Attributes instance, for instance for testing callbacks.
NewCompareLiteralRule creates a rule that allows arbitrary comparisons to be performed against values in etcd.
NewEqualsLiteralRule creates a rule that compares the provided string value with the value of a node whose key matches the provided key pattern.
NewEqualsRule enables the comparison of two or more node values with the specified key patterns.
No description provided by the author
No description provided by the author
NewNotRule allows a rule to be negated such that if the nested rule's key matches but the rule is otherwise not satisfied, the not rule is satisfied.
NewOrRule allows two or more dynamic rules to be combined into a single rule such that at least one nested rule must be satisfied in order for the overall rule to be satisfied.
NewV3Engine creates a new V3Engine instance.
NewV3EngineWithClient creates a new V3Engine instance with the provided etcd v3 client instance.
RuleContextProvider sets a custom provider for generating context instances for use by a specific callback.
RuleID is the ID associated with the rule.
RuleLockTimeout controls the TTL of the locks associated with the rule, in seconds.
RuleSatisfied returns true if the rule was satisfied and false if it was not.
SetMethod sets the method in the context of which an etcd call is being made, allowing metrics to differentiate between different types of calls to etcd.

# Constants

WebhookURLEnv is the environment variable used to specify a callback webhook that will get called every time a callback has finished executing.

# Structs

EngineOptions is used to configure the engine from configuration files.
EtcdMetricsMetadata provides information about calls to etcd.
HTTPCallbackHandler instances can be used to get immediate confirmation that a callback was executed when perfoming integration testing.
MockMetricsCollector a mock metrics collector used in unit tests.
No description provided by the author
No description provided by the author
V3RuleTask instances contain contextual object instances and metadata for use by rule callbacks.

# Interfaces

AdvancedMetricsCollector used for collecting metrics additional metrics beyond those required by the base MetricsCollector, implement this interface using your metrics collector of choice (ie Prometheus) Deprecated: instead make use of the WrapWatcher to inject metric collection on watch events.
AttributeFinder is a more performant replacement for the GetAttribute method of Attributes.
Attributes provide access to the key/value pairs associated with dynamic keys.
BaseEngine provides common method for etcd v2 and v3 rules engine instances.
DynamicRule defines rules that have dynamic key paths so that classes of keys can be referenced in rules.
EngineOption instances control the overall behavior of an Engine instance.
MetricsCollector used for collecting metrics, implement this interface using your metrics collector of choice (ie Prometheus).
RuleOption instances control the behavior of individual rules.
V3Engine defines the interactions with a rule engine instance communicating with etcd v3.

# Type aliases

ContextProvider is used to specify a custom provider of a context for a given rule.
MetricsCollectorOpt ...
V3RuleTaskCallback is the function type for functions that are called as a reulst of a specified rule being satisfied using the etcd v3 API.
WrapKV is used to provide a wrapper for the default etcd v3 KV implementation used by the rules engine.
No description provided by the author