You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -65,27 +65,27 @@ cache.StartJanitor()
65
65
```
66
66
67
67
### Functions
68
-
| Function | Description |
69
-
|---------------------------------|-----------|
70
-
| WithMaxSize | Sets the max size of the cache. `gocache.NoMaxSize` means there is no limit. If not set, the default max size is `gocache.DefaultMaxSize`.
71
-
| WithMaxMemoryUsage | Sets the max memory usage of the cache. `gocache.NoMaxMemoryUsage` means there is no limit. The default behavior is to not evict based on memory usage.
72
-
| WithEvictionPolicy | Sets the eviction algorithm to be used when the cache reaches the max size. If not set, the default eviction policy is `gocache.FirstInFirstOut` (FIFO).
73
-
| WithForceNilInterfaceOnNilPointer | Configures whether values with a nil pointer passed to write functions should be forcefully set to nil. Defaults to true.
74
-
| StartJanitor | Starts the janitor, which is in charge of deleting expired cache entries in the background.
75
-
| StopJanitor | Stops the janitor.
76
-
| Set | Same as `SetWithTTL`, but with no expiration (`gocache.NoExpiration`)
77
-
| SetAll | Same as `Set`, but in bulk
78
-
| SetWithTTL | Creates or updates a cache entry with the given key, value and expiration time. If the max size after the aforementioned operation is above the configured max size, the tail will be evicted. Depending on the eviction policy, the tail is defined as the oldest
79
-
| Get | Gets a cache entry by its key.
80
-
| GetByKeys | Gets a map of entries by their keys. The resulting map will contain all keys, even if some of the keys in the slice passed as parameter were not present in the cache.
81
-
| GetAll | Gets all cache entries.
82
-
| GetKeysByPattern | Retrieves a slice of keys that matches a given pattern.
83
-
| Delete | Removes a key from the cache.
84
-
| DeleteAll | Removes multiple keys from the cache.
85
-
| Count | Gets the size of the cache. This includes cache keys which may have already expired, but have not been removed yet.
86
-
| Clear | Wipes the cache.
87
-
| TTL | Gets the time until a cache key expires.
88
-
| Expire | Sets the expiration time of an existing cache key.
| WithMaxSize | Sets the max size of the cache. `gocache.NoMaxSize` means there is no limit. If not set, the default max size is `gocache.DefaultMaxSize`.|
71
+
| WithMaxMemoryUsage | Sets the max memory usage of the cache. `gocache.NoMaxMemoryUsage` means there is no limit. The default behavior is to not evict based on memory usage.|
72
+
| WithEvictionPolicy | Sets the eviction algorithm to be used when the cache reaches the max size. If not set, the default eviction policy is `gocache.FirstInFirstOut` (FIFO).|
73
+
| WithForceNilInterfaceOnNilPointer | Configures whether values with a nil pointer passed to write functions should be forcefully set to nil. Defaults to true.|
74
+
| StartJanitor | Starts the janitor, which is in charge of deleting expired cache entries in the background.|
75
+
| StopJanitor | Stops the janitor.|
76
+
| Set | Same as `SetWithTTL`, but with no expiration (`gocache.NoExpiration`)|
77
+
| SetAll | Same as `Set`, but in bulk|
78
+
| SetWithTTL | Creates or updates a cache entry with the given key, value and expiration time. If the max size after the aforementioned operation is above the configured max size, the tail will be evicted. Depending on the eviction policy, the tail is defined as the oldest |
79
+
| Get | Gets a cache entry by its key.|
80
+
| GetByKeys | Gets a map of entries by their keys. The resulting map will contain all keys, even if some of the keys in the slice passed as parameter were not present in the cache. |
81
+
| GetAll | Gets all cache entries.|
82
+
| GetKeysByPattern | Retrieves a slice of keys that matches a given pattern.|
83
+
| Delete | Removes a key from the cache.|
84
+
| DeleteAll | Removes multiple keys from the cache.|
85
+
| Count | Gets the size of the cache. This includes cache keys which may have already expired, but have not been removed yet.|
86
+
| Clear | Wipes the cache.|
87
+
| TTL | Gets the time until a cache key expires. |
88
+
| Expire | Sets the expiration time of an existing cache key.|
89
89
90
90
For further documentation, please refer to [Go Reference](https://pkg.go.dev/github.com/TwiN/gocache)
0 commit comments