MCPcopy Create free account

hub / github.com/Azure/peerd / functions

Functions350 in github.com/Azure/peerd

↓ 51 callersMethodSet
Set sets a new entry or updates an existing one. Set adds or updates an entry in the SyncMap with the specified key. If the key already exists in the
pkg/cache/syncmap.go:32
↓ 31 callersMethodGet
Get retrieves the value associated with the given key from the SyncMap. It returns the value and a boolean indicating whether the key was found.
pkg/cache/syncmap.go:21
↓ 29 callersFunctionNewMockRouter
(resolver map[string][]string)
pkg/discovery/routing/mocks/router.go:40
↓ 18 callersMethodClose
Close closes the router.
pkg/discovery/routing/interface.go:28
↓ 14 callersFunctionnewRandomStringN
newRandomStringN creates a new random string of length n.
pkg/cache/main_test.go:63
↓ 11 callersFunctionNewFilesStore
NewFilesStore creates a new store.
pkg/files/store/store.go:26
↓ 10 callersMethodLog
Log returns the logger with context for this reader.
pkg/discovery/content/reader/interface.go:20
↓ 9 callersMethodSize
Size gets the size of the file.
pkg/cache/interface.go:8
↓ 8 callersMethodFstat
Fstat returns the size of the file.
pkg/files/store/file.go:77
↓ 8 callersFunctionNewReader
NewReader creates a new remote reader.
pkg/discovery/content/reader/reader.go:288
↓ 8 callersMethodRead
Read reads up to len(p) bytes into p. It returns the number of bytes read (0 <= n <= len(p)) and any error encountered.
pkg/files/store/interface.go:34
↓ 8 callersFunctionnewItem
newItem creates a new cache item that is ready to be filled.
pkg/cache/item.go:119
↓ 7 callersFunctionFromContext
FromContext creates a new context from the given gin context.
pkg/context/context.go:62
↓ 7 callersMethodID
ID implements host.Host.
pkg/discovery/routing/router_test.go:270
↓ 7 callersFunctionNew
New creates a new network interface for communicating with peers.
pkg/peernet/network.go:104
↓ 6 callersFunctionFetchFile
Fetchfile gets the content of a file from the given offset using a remote reader.
pkg/files/files.go:26
↓ 6 callersMethodLeader
Leader gets the address of the elected leader.
pkg/k8s/election/election.go:23
↓ 6 callersFunctionNewPromMetrics
NewPromMetrics creates a new instance of promMetrics.
pkg/metrics/prometheus.go:47
↓ 6 callersFunctionNewSyncMap
NewSyncMap creates a new SyncMap with the specified maximum number of entries. If the maximum number of entries is less than or equal to 0, it will be
pkg/cache/syncmap.go:66
↓ 6 callersFunctionWithContext
WithContext returns a new context with a metrics recorder.
pkg/metrics/interface.go:30
↓ 5 callersMethodAddrs
Addrs implements host.Host.
pkg/discovery/routing/router_test.go:245
↓ 5 callersMethodEventf
Eventf implements record.EventRecorder.
pkg/k8s/events/events_test.go:177
↓ 5 callersFunctionFromContext
FromContext returns the event recorder from the context.
pkg/k8s/events/events.go:77
↓ 5 callersMethodGetOrCreate
GetOrCreate gets the cached value if available, otherwise downloads the file.
pkg/cache/interface.go:17
↓ 5 callersMethodHandle
Handle handles a request for a file.
pkg/handlers/files/handler.go:23
↓ 5 callersFunctionNewCache
NewCache creates a new cache of files. cacheBlockSize is the fixed size of the cache block in bytes, and is used to evaluate the cost of each item in
pkg/cache/filecache.go:152
↓ 5 callersMethodPreadRemote
PreadRemote is like pread but to a remote file.
pkg/discovery/content/reader/interface.go:14
↓ 5 callersMethodReadAt
ReadAt reads len(p) bytes from the File starting at byte offset off. It returns the number of bytes read and the error, if any.
pkg/files/store/file.go:112
↓ 5 callersMethodSeek
Seek sets the current file offset.
pkg/files/store/file.go:63
↓ 5 callersMethoddoP2p
doP2p tries to resolve the key in the p2p network and if successful, it will perform the operation on the peer, and return the result.
pkg/discovery/content/reader/reader.go:101
↓ 5 callersFunctionrandomBytesN
(n int)
pkg/cache/item_test.go:231
↓ 5 callersMethodtransportFor
transportFor returns a single use transport for outbound connection to the given peer. The peer is expected to provide a valid certificate. If pid is
pkg/peernet/network.go:83
↓ 4 callersFunctionAlignDown
AlignDown will align down the x by align. For example: AlignDown(1, 2) = 0 AlignDown(29, 14) = 28
pkg/math/segments.go:32
↓ 4 callersMethodCopy
Copy creates a copy of the context that can be safely used outside the request's scope.
pkg/context/context.go:67
↓ 4 callersFunctionFileChunkKey
1 Mib FileChunkKey returns the p2p lookup key for the given chunk of a file.
pkg/files/files.go:21
↓ 4 callersMethodFstatRemote
FstatRemote stats a remote file.
pkg/discovery/content/reader/interface.go:17
↓ 4 callersFunctionMin64
Min64 returns the smaller of x or y.
pkg/math/compare.go:14
↓ 4 callersFunctionNew
New build a new LeaderElection instance with the given name.
pkg/k8s/election/election.go:109
↓ 4 callersFunctionNew
New creates a new files handler.
pkg/handlers/files/handler.go:80
↓ 4 callersFunctionNewMockReader
NewMockReader creates a new mock reader for testing purposes.
pkg/discovery/content/reader/mocks/reader.go:37
↓ 4 callersFunctionNewMockStore
(ctx context.Context, r routing.Router, fileCachePath string)
pkg/files/store/mockstore.go:22
↓ 4 callersFunctionNewRecorder
NewRecorder creates a new event recorder.
pkg/k8s/events/events.go:23
↓ 4 callersFunctionNewSegments
NewSegments creates a new Segments object.
pkg/math/segments.go:22
↓ 4 callersMethodPutSize
PutSize sets size of the file.
pkg/cache/interface.go:11
↓ 4 callersMethodRecordUpstreamResponse
RecordUpstreamResponse records the time it takes for an upstream to respond for a key.
pkg/metrics/interface.go:26
↓ 4 callersFunctioncreateContentId
createContentId creates a deterministic content id from the given key.
pkg/discovery/routing/router.go:236
↓ 4 callersMethodgetKey
(name string, offset int64)
pkg/cache/filecache.go:142
↓ 3 callersMethodAll
All provides a channel of all segments.
pkg/math/segments.go:37
↓ 3 callersMethodCache
()
pkg/files/store/mockstore.go:18
↓ 3 callersFunctionFillCorrelationId
FillCorrelationId fills the correlation ID in the context.
pkg/context/context.go:78
↓ 3 callersFunctionFromContext
FromContext returns the metrics recorder from the context.
pkg/metrics/interface.go:40
↓ 3 callersMethodHTTPClientFor
HTTPClientFor returns an HTTP client which authenticates the given peer. If pid is empty, the client should work for any peer.
pkg/peernet/network.go:39
↓ 3 callersFunctionHandler
Server creates a new HTTP server.
pkg/handlers/root.go:21
↓ 3 callersMethodID
ID returns the peer ID of this host.
pkg/peernet/mocks/host.go:46
↓ 3 callersFunctionIsRequestFromAPeer
IsRequestFromAPeer indicates if the current request is from a peer.
pkg/context/context.go:73
↓ 3 callersFunctionMin
Min returns the smaller of x or y.
pkg/math/compare.go:22
↓ 3 callersMethodNet
Net returns the network interface.
pkg/discovery/routing/interface.go:15
↓ 3 callersMethodOpen
Open opens the requested file and starts prefetching it. It also returns the size of the file.
pkg/files/store/interface.go:18
↓ 3 callersFunctionProvide
Provide advertises content availability to the DHT network. Runs in a blocking loop, listening for blob identifiers on filesChan and advertising them
pkg/discovery/content/provider/provider.go:25
↓ 3 callersMethodRecordPeerDiscovery
RecordPeerDiscovery records the time it takes to discover a peer.
pkg/metrics/interface.go:20
↓ 3 callersMethodRecordPeerResponse
RecordPeerResponse records the time it takes for a peer to respond for a key.
pkg/metrics/interface.go:23
↓ 3 callersMethodRecordRequest
RecordRequest records the time it takes to process a request.
pkg/metrics/interface.go:17
↓ 3 callersMethodResolve
(ctx context.Context, key string, allowSelf bool, count int)
pkg/discovery/routing/mocks/router.go:57
↓ 3 callersMethodfill
fill files the file with the given data.
pkg/cache/item.go:56
↓ 3 callersFunctiongetPodNamespace
getPodNamespace returns the namespace in which the pod is running or the default namespace. Ref: https://kubernetes.io/docs/tasks/run-application/acce
pkg/k8s/k8s.go:62
↓ 3 callersFunctionnewEngine
newEngine creates a new gin engine.
pkg/handlers/root.go:31
↓ 3 callersMethodonNewLeader
onNewLeader is called when a new leader is elected. It updates the leaderElection instance with the new leader's identity.
pkg/k8s/election/election.go:90
↓ 3 callersFunctionparseDigestFromAzureUrl
parseDigestFromAzureUrl parses the digest from the given blob url or returns an error.
pkg/urlparser/azure.go:26
↓ 3 callersFunctionwriteAll
writeAll writes the file.
pkg/cache/item.go:100
↓ 2 callersMethodDefaultTLSConfig
DefaultTLSConfig creates a default TLS config. This config should not require client certificate verification.
pkg/peernet/network.go:31
↓ 2 callersMethodDelete
Delete removes the entry with the specified key from the SyncMap. If the key does not exist, this method does nothing.
pkg/cache/syncmap.go:58
↓ 2 callersMethodExists
Exists checks if the given chunk of the file is already cached.
pkg/cache/interface.go:14
↓ 2 callersMethodKey
Key tries to find the cache key for the requested content or returns empty.
pkg/files/store/interface.go:15
↓ 2 callersMethodLen
Len returns the length of the slice
tests/random/math/reverse.go:14
↓ 2 callersMethodLess
Less returns true if the element at index i is greater than the element at index j
tests/random/math/reverse.go:19
↓ 2 callersMethodLog
Log returns the logger with context for this reader.
pkg/discovery/content/reader/reader.go:45
↓ 2 callersFunctionLogger
Logger gets the logger with request specific fields.
pkg/context/context.go:94
↓ 2 callersFunctionMax64
Max64 returns the larger of x or y.
pkg/math/compare.go:6
↓ 2 callersFunctionNew
New returns a new Parser.
pkg/urlparser/parser.go:28
↓ 2 callersFunctionNewKubernetesInterface
NewKubernetesInterface creates a new interface for k8s API server. The current runtime environment is first assumed to be a pod and its identity is us
pkg/k8s/k8s.go:34
↓ 2 callersMethodParseDigest
ParseDigest parses the digest from the given URL. If none found, implementations should return an error.
pkg/urlparser/parser.go:14
↓ 2 callersFunctionPercentilesFloat64Reverse
PercentilesFloat64Reverse calculates the percentile of a slice of floats in reverse order. NOTE: The unit of each value of xs is 'bits' and the result
tests/random/math/math.go:13
↓ 2 callersMethodPrivKey
PrivKey generates a new private key for the given peer.
pkg/peernet/mocks/peerstore.go:90
↓ 2 callersMethodProvide
Provide provides the given keys to the network. This lets the k-closest peers to the key know that we are providing it.
pkg/discovery/routing/interface.go:25
↓ 2 callersFunctionRandomizedGroups
RandomizedGroups groups the given collection randomly into groups of size n
tests/random/math/math.go:38
↓ 2 callersMethodResolve
Resolve resolves the given key to a peer address.
pkg/discovery/routing/router.go:172
↓ 2 callersMethodRoundTripperFor
RoundTripperFor returns an HTTP round tripper which authenticates the given peer. If pid is empty, the round tripper should work for any peer.
pkg/peernet/network.go:35
↓ 2 callersMethodRunOrDie
RunOrDie runs the leader election.
pkg/k8s/election/election.go:20
↓ 2 callersMethodSubscribe
Subscribe returns a channel that will be notified when a blob is added to the store.
pkg/files/store/interface.go:21
↓ 2 callersFunctionWithContext
WithContext returns a new context with an event recorder.
pkg/k8s/events/events.go:67
↓ 2 callersFunctionbenchmark
benchmark runs the benchmark and returns the measured download speeds.
tests/random/random.go:101
↓ 2 callersMethodbytes
bytes returns the file bytes.
pkg/cache/item.go:45
↓ 2 callersMethoddrop
drop deletes the underlying file.
pkg/cache/item.go:26
↓ 2 callersMethodfill
fill fills the context with handler specific information.
pkg/handlers/files/handler.go:63
↓ 2 callersMethodfstatRemote
fstatRemote stats the file.
pkg/discovery/content/reader/reader.go:187
↓ 2 callersMethodleaderElectionConfig
leaderElectionConfig creates a new configuration for the leader election.
pkg/k8s/election/election.go:73
↓ 2 callersFunctionnewHost
newHost creates a new Host from the given address.
pkg/discovery/routing/router.go:251
↓ 2 callersFunctionnewRandomString
newRandomString creates a new random string.
pkg/cache/main_test.go:45
↓ 2 callersFunctionnewRandomStringN
newRandomStringN creates a new random string of length n.
pkg/handlers/files/main_test.go:43
↓ 2 callersMethodoriginRequest
originRequest will create a new request to origin.
pkg/discovery/content/reader/reader.go:259
next →1–100 of 350, ranked by callers