1
1
//
2
2
// DISCLAIMER
3
3
//
4
- // Copyright 2020-2023 ArangoDB GmbH, Cologne, Germany
4
+ // Copyright 2020-2025 ArangoDB GmbH, Cologne, Germany
5
5
//
6
6
// Licensed under the Apache License, Version 2.0 (the "License");
7
7
// you may not use this file except in compliance with the License.
@@ -45,41 +45,49 @@ type Agency interface {
45
45
***/
46
46
47
47
// Deprecated: TTL param is removed since 3.12, use WriteTransaction instead
48
+ //
48
49
// WriteKey writes the given value with the given key with a given TTL (unless TTL is zero).
49
50
// If you pass a condition (only 1 allowed), this condition has to be true,
50
51
// otherwise the write will fail with a ConditionFailed error.
51
52
WriteKey (ctx context.Context , key []string , value interface {}, ttl time.Duration , condition ... WriteCondition ) error
52
53
53
54
// Deprecated: use 'WriteTransaction' instead
55
+ //
54
56
// WriteKeyIfEmpty writes the given value with the given key only if the key was empty before.
55
57
WriteKeyIfEmpty (ctx context.Context , key []string , value interface {}, ttl time.Duration ) error
56
58
57
59
// Deprecated: use 'WriteTransaction' instead
60
+ //
58
61
// WriteKeyIfEqualTo writes the given new value with the given key only if the existing value for that key equals
59
62
// to the given old value.
60
63
WriteKeyIfEqualTo (ctx context.Context , key []string , newValue , oldValue interface {}, ttl time.Duration ) error
61
64
62
65
// Deprecated: use 'WriteTransaction' instead
66
+ //
63
67
// RemoveKey removes the given key.
64
68
// If you pass a condition (only 1 allowed), this condition has to be true,
65
69
// otherwise the remove will fail with a ConditionFailed error.
66
70
RemoveKey (ctx context.Context , key []string , condition ... WriteCondition ) error
67
71
68
72
// Deprecated: use 'WriteTransaction' instead
73
+ //
69
74
// RemoveKeyIfEqualTo removes the given key only if the existing value for that key equals
70
75
// to the given old value.
71
76
RemoveKeyIfEqualTo (ctx context.Context , key []string , oldValue interface {}) error
72
77
73
78
// Deprecated: use 'WriteTransaction' instead
79
+ //
74
80
// Register a URL to receive notification callbacks when the value of the given key changes
75
81
RegisterChangeCallback (ctx context.Context , key []string , cbURL string ) error
76
82
77
83
// Deprecated: use 'WriteTransaction' instead
84
+ //
78
85
// Register a URL to receive notification callbacks when the value of the given key changes
79
86
UnregisterChangeCallback (ctx context.Context , key []string , cbURL string ) error
80
87
}
81
88
82
89
// Deprecated: use 'agency.KeyConditioner' instead
90
+ //
83
91
// WriteCondition is a precondition before a write is accepted.
84
92
type WriteCondition struct {
85
93
conditions map [string ]writeCondition
@@ -99,6 +107,7 @@ func (c WriteCondition) add(key []string, updater func(wc *writeCondition)) Writ
99
107
}
100
108
101
109
// Deprecated: use 'agency.KeyConditioner' instead
110
+ //
102
111
// IfEmpty adds an "is empty" check on the given key to the given condition
103
112
// and returns the updated condition.
104
113
func (c WriteCondition ) IfEmpty (key []string ) WriteCondition {
@@ -108,6 +117,7 @@ func (c WriteCondition) IfEmpty(key []string) WriteCondition {
108
117
}
109
118
110
119
// Deprecated: use 'agency.KeyConditioner' instead
120
+ //
111
121
// IfIsArray adds an "is-array" check on the given key to the given condition
112
122
// and returns the updated condition.
113
123
func (c WriteCondition ) IfIsArray (key []string ) WriteCondition {
@@ -117,6 +127,7 @@ func (c WriteCondition) IfIsArray(key []string) WriteCondition {
117
127
}
118
128
119
129
// Deprecated: use 'agency.KeyConditioner' instead
130
+ //
120
131
// IfEqualTo adds an "value equals oldValue" check to given old value on the
121
132
// given key to the given condition and returns the updated condition.
122
133
func (c WriteCondition ) IfEqualTo (key []string , oldValue interface {}) WriteCondition {
0 commit comments