forked from hyperledger/fabric-sdk-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
refoptcheck.go
38 lines (28 loc) · 853 Bytes
/
refoptcheck.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
Copyright SecureKey Technologies Inc. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
*/
package lazycache
import (
"time"
"github.com/hyperledger/fabric-sdk-go/pkg/util/concurrent/lazyref"
)
// refOptCheck is used to test whether any of the lazyref options have been passed in
type refOptCheck struct {
useRef bool
}
func (p *refOptCheck) SetIdleExpiration(expiration time.Duration) {
p.useRef = true
}
func (p *refOptCheck) SetAbsoluteExpiration(expiration time.Duration) {
p.useRef = true
}
func (p *refOptCheck) SetExpirationProvider(expirationProvider lazyref.ExpirationProvider, expiryType lazyref.ExpirationType) {
p.useRef = true
}
func (p *refOptCheck) SetFinalizer(value lazyref.Finalizer) {
p.useRef = true
}
func (p *refOptCheck) SetRefreshInterval(initialInit, refreshPeriod time.Duration) {
p.useRef = true
}