11//
22// DISCLAIMER
33//
4- // Copyright 2020-2023 ArangoDB GmbH, Cologne, Germany
4+ // Copyright 2020-2025 ArangoDB GmbH, Cologne, Germany
55//
66// Licensed under the Apache License, Version 2.0 (the "License");
77// you may not use this file except in compliance with the License.
@@ -45,41 +45,49 @@ type Agency interface {
4545 ***/
4646
4747 // Deprecated: TTL param is removed since 3.12, use WriteTransaction instead
48+ //
4849 // WriteKey writes the given value with the given key with a given TTL (unless TTL is zero).
4950 // If you pass a condition (only 1 allowed), this condition has to be true,
5051 // otherwise the write will fail with a ConditionFailed error.
5152 WriteKey (ctx context.Context , key []string , value interface {}, ttl time.Duration , condition ... WriteCondition ) error
5253
5354 // Deprecated: use 'WriteTransaction' instead
55+ //
5456 // WriteKeyIfEmpty writes the given value with the given key only if the key was empty before.
5557 WriteKeyIfEmpty (ctx context.Context , key []string , value interface {}, ttl time.Duration ) error
5658
5759 // Deprecated: use 'WriteTransaction' instead
60+ //
5861 // WriteKeyIfEqualTo writes the given new value with the given key only if the existing value for that key equals
5962 // to the given old value.
6063 WriteKeyIfEqualTo (ctx context.Context , key []string , newValue , oldValue interface {}, ttl time.Duration ) error
6164
6265 // Deprecated: use 'WriteTransaction' instead
66+ //
6367 // RemoveKey removes the given key.
6468 // If you pass a condition (only 1 allowed), this condition has to be true,
6569 // otherwise the remove will fail with a ConditionFailed error.
6670 RemoveKey (ctx context.Context , key []string , condition ... WriteCondition ) error
6771
6872 // Deprecated: use 'WriteTransaction' instead
73+ //
6974 // RemoveKeyIfEqualTo removes the given key only if the existing value for that key equals
7075 // to the given old value.
7176 RemoveKeyIfEqualTo (ctx context.Context , key []string , oldValue interface {}) error
7277
7378 // Deprecated: use 'WriteTransaction' instead
79+ //
7480 // Register a URL to receive notification callbacks when the value of the given key changes
7581 RegisterChangeCallback (ctx context.Context , key []string , cbURL string ) error
7682
7783 // Deprecated: use 'WriteTransaction' instead
84+ //
7885 // Register a URL to receive notification callbacks when the value of the given key changes
7986 UnregisterChangeCallback (ctx context.Context , key []string , cbURL string ) error
8087}
8188
8289// Deprecated: use 'agency.KeyConditioner' instead
90+ //
8391// WriteCondition is a precondition before a write is accepted.
8492type WriteCondition struct {
8593 conditions map [string ]writeCondition
@@ -99,6 +107,7 @@ func (c WriteCondition) add(key []string, updater func(wc *writeCondition)) Writ
99107}
100108
101109// Deprecated: use 'agency.KeyConditioner' instead
110+ //
102111// IfEmpty adds an "is empty" check on the given key to the given condition
103112// and returns the updated condition.
104113func (c WriteCondition ) IfEmpty (key []string ) WriteCondition {
@@ -108,6 +117,7 @@ func (c WriteCondition) IfEmpty(key []string) WriteCondition {
108117}
109118
110119// Deprecated: use 'agency.KeyConditioner' instead
120+ //
111121// IfIsArray adds an "is-array" check on the given key to the given condition
112122// and returns the updated condition.
113123func (c WriteCondition ) IfIsArray (key []string ) WriteCondition {
@@ -117,6 +127,7 @@ func (c WriteCondition) IfIsArray(key []string) WriteCondition {
117127}
118128
119129// Deprecated: use 'agency.KeyConditioner' instead
130+ //
120131// IfEqualTo adds an "value equals oldValue" check to given old value on the
121132// given key to the given condition and returns the updated condition.
122133func (c WriteCondition ) IfEqualTo (key []string , oldValue interface {}) WriteCondition {
0 commit comments