Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/cloudflare/golibs
/ functions
Functions
305 in github.com/cloudflare/golibs
⨍
Functions
305
◇
Types & classes
46
↓ 2 callers
Method
roundTrip
(ctx context.Context, method string, url *url.URL, headers http.Header, body []byte)
kt/kt.go:659
↓ 2 callers
Function
unhex
copied from net/url
kt/kt.go:879
↓ 1 callers
Method
Capacity
Get the total capacity of the LRU
lrucache/cache.go:44
↓ 1 callers
Method
Capacity
()
lrucache/multilru.go:96
↓ 1 callers
Method
Capacity
Capacity gets the total capacity of the LRU
lrucache/lrucache.go:310
↓ 1 callers
Method
Clear
Evict all items from the cache.
lrucache/cache.go:40
↓ 1 callers
Function
DecodeValues
DecodeValues takes a response from an KT RPC call decodes it into a list of key value pairs.
kt/kt.go:784
↓ 1 callers
Method
Empty
Empty Is the buffer empty?
circularbuffer/circularbuffer.go:173
↓ 1 callers
Method
Expire
Evict all the expired items.
lrucache/cache.go:55
↓ 1 callers
Method
Expire
()
lrucache/multilru.go:104
↓ 1 callers
Method
ExpireNow
Evict items that expire before Now.
lrucache/cache.go:68
↓ 1 callers
Method
ExpireNow
(now time.Time)
lrucache/multilru.go:112
↓ 1 callers
Method
ExpireNow
Evict items that expire before `now`. O(n*log(n))
lrucache/lrucache.go:284
↓ 1 callers
Method
Get
(key string)
lrucache/multilru.go:52
↓ 1 callers
Method
Get
Get an item from the beginning of the stack (oldest), blocking.
circularbuffer/circularbuffer.go:41
↓ 1 callers
Method
GetNotStale
Get a key from the cache, make sure it's not stale. Update its LRU score.
lrucache/cache.go:53
↓ 1 callers
Method
GetNotStale
(key string)
lrucache/multilru.go:60
↓ 1 callers
Method
GetNotStaleNow
Get a key from the cache, make sure it's not stale. Update its LRU score.
lrucache/cache.go:66
↓ 1 callers
Method
GetNotStaleNow
(key string, now time.Time)
lrucache/multilru.go:64
↓ 1 callers
Method
GetNotStaleNow
GetNotStaleNow gets a key from the cache, make sure it's not stale. Update its LRU score. O(log(n)) if the item is expired.
lrucache/lrucache.go:201
↓ 1 callers
Method
GetSingle
GetSingle gets the lower and upper bounds of a range for a single element. If the element isn't tracked lower bound will be zero and upper bound will
spacesaving/rate.go:196
↓ 1 callers
Method
GetStaleNow
GetStaleNow gets a key from the cache, possibly stale. Update its LRU score. O(1) always.
lrucache/lrucache.go:230
↓ 1 callers
Method
Init
Initialize already allocated NewEwmaRate structure halfLife it the time takes for a half charge or half discharge
ewma/rate.go:30
↓ 1 callers
Method
Init
Initialize already allocated NewEwma structure halfLife it the time takes for a half charge or half discharge
ewma/ewma.go:37
↓ 1 callers
Method
Init
Using this constructor is almost always wrong. Use NewMultiLRUCache instead.
lrucache/multilru.go:18
↓ 1 callers
Method
Init
Initialize the LRU cache instance. O(capacity)
lrucache/lrucache.go:35
↓ 1 callers
Function
IsError
IsError returns true if the error was generated by this package.
kt/kt.go:57
↓ 1 callers
Method
MoveToFront
MoveToFront moves element e to the front of list l. If e is not an element of l, the list is not modified.
lrucache/list.go:188
↓ 1 callers
Function
NewVCache
(capacity uint64)
lrucache/benchmark/vcache.go:13
↓ 1 callers
Function
Poller
(lock *sync.Mutex, ss *spacesaving.Rate, pc *pcap.Pcap)
spacesaving/tools/topdns.go:88
↓ 1 callers
Method
Prev
Prev returns the previous list element or nil.
lrucache/list.go:72
↓ 1 callers
Method
Push
(x interface{})
spacesaving/srate.go:36
↓ 1 callers
Method
Push
(e interface{})
lrucache/priorityqueue.go:23
↓ 1 callers
Method
PushElementBack
(e *element)
lrucache/list_extension.go:11
↓ 1 callers
Method
SetNow
Methods allowing to explicitly specify time used to determine if items are expired. Add an item to the cache overwriting existing one if it exists. A
lrucache/cache.go:63
↓ 1 callers
Function
TSVEncode
Encode the request body in TSV. The encoding is chosen based on whether there are any binary data in the key/values
kt/kt.go:721
↓ 1 callers
Method
UpdateNow
Notify of an event happening. Uses system clock to determine current time. Returns current rate.
ewma/rate.go:38
↓ 1 callers
Method
UpdateNow
Update moving average with the value. Uses system clock to determine current time to count wight. Returns updated moving avarage.
ewma/ewma.go:54
↓ 1 callers
Function
certPaths
(dir string)
kt/kt.go:111
↓ 1 callers
Method
count
(rate float64, lastTs, now int64)
spacesaving/rate.go:144
↓ 1 callers
Method
count
(rate float64, lastTs, now int64)
spacesaving/srate.go:71
↓ 1 callers
Method
freeSomeEntry
(now time.Time)
lrucache/lrucache.go:81
↓ 1 callers
Function
hasBinary
(b string)
kt/kt.go:763
↓ 1 callers
Function
hasBinarySlice
(b []byte)
kt/kt.go:773
↓ 1 callers
Function
hash
hash returns the 64-bit SipHash-2-4 of the given byte slice with two 64-bit parts of 128-bit key: k0 and k1.
tokenbucket/sip.go:16
↓ 1 callers
Method
insertEntry
(e *entry)
lrucache/lrucache.go:114
↓ 1 callers
Function
loadCerts
(rootPath string, certPath string, keyPath string)
kt/kt.go:137
↓ 1 callers
Function
newUnixConn
(socket string, poolsize int, timeout time.Duration)
kt/kt.go:304
↓ 1 callers
Function
randomString
(l int)
lrucache/benchmark/main.go:13
↓ 1 callers
Function
safeParse
(msg *dns.Msg, data []byte)
spacesaving/tools/topdns.go:17
↓ 1 callers
Function
safeParse
(msg *dns.Msg, data []byte)
spacesaving/tools/readpcap.go:18
↓ 1 callers
Method
setBulk
SetBulk stores the values in the map.
kt/kt.go:531
↓ 1 callers
Function
startServerUnix
(t testing.TB, sockAddr string)
kt/kt_base_test.go:20
↓ 1 callers
Method
touch
(it *item)
tokenbucket/bucket.go:44
↓ 1 callers
Function
urlenc
encode the key for use in a RESTFUL url KT requires that we use URL escaped values for anything not safe in a query component. Add a slash for the lea
kt/kt.go:936
Function
BenchmarkBulkBytes
(b *testing.B)
kt/bench_test.go:83
Function
BenchmarkConcurrentGetLRUCache
(bb *testing.B)
lrucache/lrucache_test.go:329
Function
BenchmarkConcurrentGetMultiLRU
(bb *testing.B)
lrucache/multilru_test.go:105
Function
BenchmarkConcurrentSetLRUCache
(bb *testing.B)
lrucache/lrucache_test.go:348
Function
BenchmarkConcurrentSetMultiLRU
(bb *testing.B)
lrucache/multilru_test.go:124
Function
BenchmarkConcurrentSetNXLRUCache
No expiry
lrucache/lrucache_test.go:369
Function
BenchmarkConcurrentSetNXMultiLRU
No expiry
lrucache/multilru_test.go:145
Function
BenchmarkGet
(b *testing.B)
kt/bench_test.go:41
Function
BenchmarkGetLarge
(b *testing.B)
kt/bench_test.go:62
Function
BenchmarkMathExp
math.Exp is the slowest operation in this implementation. Measure just how slow it is. Usually calling math.Exp() is responsible for ~30% of the CPU.
spacesaving/rate_test.go:228
Function
BenchmarkPool
(b *testing.B)
pool/pool_test.go:120
Function
BenchmarkSet
(b *testing.B)
kt/bench_test.go:10
Function
BenchmarkSetLarge
(b *testing.B)
kt/bench_test.go:25
Function
BenchmarkTouch1024_hundred
Benchmark updating items with 100% hit rate.
spacesaving/rate_test.go:183
Function
BenchmarkTouch16384_fifty
Benchmark updating times with 50% hit rate.
spacesaving/rate_test.go:165
Function
BenchmarkTouch16384_hundred
(bb *testing.B)
spacesaving/rate_test.go:199
Function
BenchmarkTouch16384_ninety
Benchmark updating times with 90% hit rate.
spacesaving/rate_test.go:174
Function
BenchmarkTouch16384_ten
Benchmark updating times with 10% hit rate.
spacesaving/rate_test.go:156
Function
BenchmarkTouch2048_hundred
(bb *testing.B)
spacesaving/rate_test.go:187
Function
BenchmarkTouch32768_fifty
(bb *testing.B)
spacesaving/rate_test.go:169
Function
BenchmarkTouch32768_hundred
(bb *testing.B)
spacesaving/rate_test.go:203
Function
BenchmarkTouch32768_ninety
(bb *testing.B)
spacesaving/rate_test.go:178
Function
BenchmarkTouch32768_ten
(bb *testing.B)
spacesaving/rate_test.go:160
Function
BenchmarkTouch4096_hundred
(bb *testing.B)
spacesaving/rate_test.go:191
Function
BenchmarkTouch8192_hundred
(bb *testing.B)
spacesaving/rate_test.go:195
Method
Count
(ctx context.Context)
kt/kt_metrics.go:54
Method
Get
(key string)
lrucache/benchmark/vcache.go:27
Method
Get
(key string)
lrucache/benchmark/mcache.go:34
Method
Get
(ctx context.Context, key string)
kt/kt_metrics.go:84
Method
GetAll
()
spacesaving/count.go:68
Method
GetAll
(nowTs time.Time)
spacesaving/srate.go:125
Method
GetBulk
(ctx context.Context, keysAndVals map[string]string)
kt/kt_metrics.go:74
Method
GetBulkBytes
(ctx context.Context, keys map[string][]byte)
kt/kt_metrics.go:114
Method
GetBytes
(ctx context.Context, key string)
kt/kt_metrics.go:94
Method
GetQuiet
Get a key from the cache, possibly stale. Don't modify its LRU score. O(1)
lrucache/cache.go:36
Method
GetStale
(key string)
lrucache/multilru.go:68
Method
GetStale
GetStale gets a key from the cache, possibly stale. Update its LRU score. O(1) always.
lrucache/lrucache.go:224
Method
GetStaleNow
(key string, now time.Time)
lrucache/multilru.go:72
Method
Init
(size int)
spacesaving/count.go:16
Method
Init
(size int, halfLife time.Duration)
spacesaving/srate.go:60
Method
Init
Init initializes or clears list l.
lrucache/list.go:87
Method
InsertAfter
InsertAfter inserts a new element e with value v immediately after mark and returns e. If mark is not an element of l, the list is not modified.
lrucache/list.go:178
Method
InsertBefore
InsertBefore inserts a new element e with value v immediately before mark and returns e. If mark is not an element of l, the list is not modified.
lrucache/list.go:168
Method
Len
()
spacesaving/rate.go:42
Method
Len
()
spacesaving/rate.go:166
← previous
next →
101–200 of 305, ranked by callers