Skip to content

Commit a4f3dd6

Browse files
committed
Add comments to new functions
1 parent bc315ea commit a4f3dd6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

pkg/cloud/client.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,17 +199,20 @@ func NewClientFromCSAPIClient(cs *cloudstack.CloudStackClient) Client {
199199
return c
200200
}
201201

202+
// generateClientCacheKey generates a cache key from a Config
202203
func generateClientCacheKey(conf Config) string {
203204
return fmt.Sprintf("%+v", conf)
204205
}
205206

207+
// newClientCache returns a new instance of client cache
206208
func newClientCache(clientConfig *corev1.ConfigMap) *ttlcache.Cache {
207209
clientCache := ttlcache.NewCache()
208210
clientCache.SetTTL(GetClientCacheTTL(clientConfig))
209211
clientCache.SkipTtlExtensionOnHit(false)
210212
return clientCache
211213
}
212214

215+
// GetClientCacheTTL returns a client cache TTL duration from the passed config map
213216
func GetClientCacheTTL(clientConfig *corev1.ConfigMap) time.Duration {
214217
var cacheTTL time.Duration
215218
if clientConfig != nil {

0 commit comments

Comments
 (0)