MCPcopy Create free account

hub / github.com/blampe/rreading-glasses / functions

Functions1,014 in github.com/blampe/rreading-glasses

↓ 112 callersFunctionLog
Log returns a logger scoped to the request ID if present in the context.
internal/log.go:21
↓ 48 callersMethodRun
Run is responsible for denormalizing data and handling our worker pools.
internal/controller.go:750
↓ 41 callersMethodGet
(ctx context.Context, key string)
internal/cache.go:16
↓ 41 callersMethod__premarshalJSON
()
gr/generated.go:465
↓ 40 callersFunction__marshalGetRecommendedGetHomeWidgetsHomeWidgetItemsConnectionEdgesHomeWidgetEdgeNodeHomeWidgetRecommendationsEdgeNode
(v *GetRecommendedGetHomeWidgetsHomeWidgetItemsConnectionEdgesHomeWidgetEdgeNodeHomeWidgetRecommendationsEdgeN
gr/generated.go:2757
↓ 40 callersFunction__unmarshalGetRecommendedGetHomeWidgetsHomeWidgetItemsConnectionEdgesHomeWidgetEdgeNodeHomeWidgetRecommendationsEdgeNode
(b []byte, v *GetRecommendedGetHomeWidgetsHomeWidgetItemsConnectionEdgesHomeWidgetEdgeNodeHomeWidgetRecommenda
gr/generated.go:2665
↓ 32 callersMethodSet
bool should be true if data was found.
internal/cache.go:18
↓ 27 callersMethodExpire
(ctx context.Context, key string)
internal/cache.go:19
↓ 25 callersMethoderror
error writes an error message. The status code defaults to 500 unless the error wraps a statusErr.
internal/handler.go:633
↓ 24 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use.
internal/mock.go:40
↓ 22 callersFunctionWorkKey
WorkKey returns a cache key for a work ID.
internal/cache.go:150
↓ 20 callersMethodDoAndReturn
DoAndReturn rewrite *gomock.Call.DoAndReturn
internal/mock.go:314
↓ 19 callersMethodAdd
(url string)
internal/cloudflare.go:63
↓ 19 callersMethodReturn
Return rewrite *gomock.Call.Return
internal/mock.go:302
↓ 18 callersFunctionnewSet
(ts ...T)
internal/set.go:7
↓ 17 callersFunctionBookKey
BookKey returns a cache key for a book (edition) ID.
internal/cache.go:155
↓ 17 callersMethodDo
Do rewrite *gomock.Call.Do
internal/mock.go:308
↓ 17 callersMethodGetAuthor
GetAuthor loads an author or returns a cached value if one exists.
internal/controller.go:329
↓ 16 callersFunctionAuthorKey
AuthorKey returns a cache key for an author ID.
internal/cache.go:160
↓ 16 callersMethodError
()
internal/error.go:24
↓ 15 callersMethodGetWork
GetWork gets the work with the given ID. A work is an abstract collection of editions. The saveEditions callback can be invoked if the work can be loa
internal/controller.go:106
↓ 14 callersFunctionpathToID
(p string)
internal/handler.go:735
↓ 13 callersMethodGetWork
GetWork loads a work or returns a cached value if one exists.
internal/controller.go:320
↓ 13 callersMethodMakeRequest
MakeRequest mocks base method.
hardcover/mock.go:45
↓ 13 callersFunctionnewMemoryCache
newMemoryCache returns a new in-memory cache.
internal/memory.go:14
↓ 12 callersMethodGetWithTTL
bool should be true if data was found.
internal/cache.go:17
↓ 12 callersFunctionNewController
NewController creates a new controller. Background jobs to load author works and editions is bounded to at most 10 concurrent tasks.
internal/controller.go:173
↓ 11 callersMethodGetBook
GetBook loads a book (edition) or returns a cached value if one exists. TODO: This should only return a book!
internal/controller.go:196
↓ 10 callersFunctionbestAuthor
(contributions []hardcover.Contributions)
internal/hardcover.go:441
↓ 9 callersFunctionAsContributions
AsContributions maps a slice of Contributions fragments into... a slice of Contributions fragments. I must not be thinking clearly because this seems
hardcover/glue.go:8
↓ 9 callersMethodGetBook
GetBook gets an individual edition of a work. The saveEditions callback can be invoked if the edition can be loaded with other editions in one request
internal/controller.go:114
↓ 9 callersFunctioncacheFor
cacheFor sets cache response headers. s-maxage controls CDN cache time; we default to an hour expiry for clients. Set varyParams to true if the cache
internal/handler.go:330
↓ 9 callersMethodlen
len returns the number of children currently waiting in the buffer.
internal/buffer.go:189
↓ 8 callersMethodGetAuthor
Returns a serialized Work?? GetAuthor gets an author's details. A serialized AuthorResource is returned.
internal/controller.go:119
↓ 8 callersFunctionfuzz
fuzz scales the given duration into the range (d, d * f).
internal/controller.go:1108
↓ 7 callersFunctionNewCache
NewCache constructs a new layered cache.
internal/cache.go:114
↓ 6 callersFunctionNewMockgetter
NewMockgetter creates a new mock instance.
internal/mock.go:33
↓ 6 callersMethoddenormalizeWorks
denormalizeWorks ensures that the given works exist on the author. This is a no-op if our cached work already includes the work's ID. This is meant to
internal/controller.go:937
↓ 6 callersFunctionwaitForDenorm
(ctrl *Controller)
internal/controller_test.go:495
↓ 5 callersMethodDSN
DSN returns the database's DSN based on the provided flags.
cmd/root.go:31
↓ 5 callersMethodGetAuthorBooks
(ctx context.Context, authorID int64)
internal/controller.go:121
↓ 5 callersMethodGetSeries
Returns book/edition IDs, not works. GetSeries returns a list of works contained in a series. The works may not all be by the same author.
internal/controller.go:125
↓ 5 callersFunctionGetWork
( ctx_ context.Context, client_ graphql.Client, bookID int64, )
hardcover/generated.go:2638
↓ 5 callersFunctionNewBatchedGraphQLClient
NewBatchedGraphQLClient creates a batching GraphQL client. Queries are accumulated and executed regularly accurding to the given rate.
internal/graphql.go:42
↓ 5 callersMethodStatus
()
internal/error.go:20
↓ 5 callersMethodadd
add extends the current query with a new field. The field's alias and name are returned so they can be recovered later.
internal/graphql.go:282
↓ 5 callersFunctionseriesKey
(seriesID int64)
internal/cache.go:164
↓ 4 callersMethodDelete
(ctx context.Context, key string)
internal/cache.go:20
↓ 4 callersMethodDelete
Delete records an in-flight refresh as completed.
internal/persist.go:61
↓ 4 callersMethodETag
()
internal/etag.go:19
↓ 4 callersFunctionGetAuthorWorks
( ctx_ context.Context, client_ graphql.Client, getWorksByContributorInput GetWorksByContributorInput, pag
gr/generated.go:5933
↓ 4 callersFunctionNewMetrics
NewMetrics creates a new Rrometheus registry with default collectors already registered.
internal/metrics.go:22
↓ 4 callersMethodPersist
Persist records an author's refresh as in-flight.
internal/persist.go:55
↓ 4 callersMethodRoundTrip
RoundTrip forces the request to stick to the given host, so redirects can't send us elsewhere. Helpful to ensuring credentials don't leak to other dom
internal/transport.go:34
↓ 4 callersMethodSearch
Search performs a natural language query against the upstream (or other search index). A serialied searchResource is returned.
internal/controller.go:131
↓ 4 callersFunctionaccumulate
accumulate reads values produced by the consumer into an in-memory buffer. A channel is returned which provides those buffered values for consumption.
internal/buffer.go:22
↓ 4 callersFunctionbestHardcoverEdition
(defaults hardcover.DefaultEditions, expectedAuthorID int64)
internal/hardcover.go:385
↓ 4 callersFunctiongqlStatusErr
gqlStatusErr translates errors into meaningful status codes. The client normally returns error responses with a 200 OK status code and a populated "Er
internal/graphql.go:235
↓ 4 callersFunctionnewETagWriter
()
internal/etag.go:15
↓ 4 callersFunctionrefreshAuthorKey
(authorID int64)
internal/persist.go:104
↓ 4 callersMethodrefreshWaitingAdd
(delta int64)
internal/metrics.go:307
↓ 3 callersMethodCache
Cache returns the cloudflare cache, if it was configured, or nil otherwise.
cmd/root.go:73
↓ 3 callersMethodGet
Get returns a cache value, if it exists, and a boolean if a value was found.
internal/cache.go:66
↓ 3 callersFunctionGetBook
( ctx_ context.Context, client_ graphql.Client, legacyId int64, )
gr/generated.go:6044
↓ 3 callersMethodGetBook
GetBook fetches a book (edition) from GR.
internal/gr.go:221
↓ 3 callersMethodMakeRequest
MakeRequest implements graphql.Client.
internal/graphql.go:165
↓ 3 callersFunctionNewGRGQL
NewGRGQL returns a new GraphQL client for use with GR. The provided [http.Client] must be non-nil and is used for issuing requests. If a non-empty coo
internal/gr.go:54
↓ 3 callersFunctionNewGRGetter
NewGRGetter creates a new Getter backed by G——R——.
internal/gr.go:42
↓ 3 callersFunctionNewHandler
NewHandler creates a new handler.
internal/handler.go:50
↓ 3 callersFunctionNewHardcoverGetter
NewHardcoverGetter returns a new Getter backed by Hardcover.
internal/hardcover.go:31
↓ 3 callersFunctionNewMux
NewMux registers a handler's routes on a new mux.
internal/handler.go:59
↓ 3 callersFunctionNewPersister
NewPersister creates a new Persister.
internal/persist.go:49
↓ 3 callersMethodRecommendations
Recommendations returns a list of work IDs which are trending or popular. Eventually we may consider implementing OAuth in order to return custom-tail
internal/controller.go:136
↓ 3 callersMethodSearch
Search hits the auto_complete API that has been used historically, so it returns exactly the same results as legacy.
internal/gr.go:77
↓ 3 callersMethodShutdown
Shutdown waits for all refresh and denormalization goroutines to finish submitting their work and then closes the denormalization channel. Run will ru
internal/controller.go:823
↓ 3 callersMethodbuild
Build returns the merged query string and variables map.
internal/graphql.go:356
↓ 3 callersMethodcacheHitGet
()
internal/metrics.go:363
↓ 3 callersMethodcacheMissGet
()
internal/metrics.go:376
↓ 3 callersMethoddenormWaitingGet
()
internal/metrics.go:298
↓ 3 callersMethoddenormalizeEditions
denormalizeEditions ensures that the given editions exists on the work. It deserializes the target work once. (TODO: No-op if it includes an edition w
internal/controller.go:844
↓ 3 callersMethodetagMatchesGet
()
internal/metrics.go:327
↓ 3 callersMethodetagMatchesInc
()
internal/metrics.go:323
↓ 3 callersMethodetagMismatchesInc
()
internal/metrics.go:336
↓ 3 callersFunctionhcReleaseDate
(d string)
internal/hardcover.go:581
↓ 3 callersFunctionnewCacheMetrics
(reg *prometheus.Registry)
internal/metrics.go:148
↓ 3 callersFunctionnewQueryBuilder
newQueryBuilder initializes a new QueryBuilder with an empty Document.
internal/graphql.go:262
↓ 3 callersFunctionnormalizePattern
normalizePattern derives the constant label from the pattern: "/author/{foreignAuthorID}" → "/author" "/book/bulk" → "/book/bulk"
internal/metrics.go:461
↓ 3 callersMethodrefreshWaitingGet
()
internal/metrics.go:314
↓ 3 callersFunctionreleaseDate
releaseDate parses a G— float into a formatted time R— can work with. TODO: We might be able to omit the month/day and have R use just the year?
internal/gr.go:679
↓ 2 callersMethodEXPECT
EXPECT returns an object that allows the caller to indicate expected use.
hardcover/mock.go:40
↓ 2 callersMethodGetASIN
GetASIN returns the best known edition ID for the given ASIN, or a not found error if there is none.
internal/controller.go:351
↓ 2 callersFunctionGetAuthorEditions
( ctx_ context.Context, client_ graphql.Client, id int64, limit int64, offset int64, )
hardcover/generated.go:2287
↓ 2 callersMethodGetBook
GetBook looks up a GR book (edition) in Hardcover's mappings.
internal/hardcover.go:160
↓ 2 callersMethodGetISBN
GetISBN returns the best known edition ID for the given ISBN13, or a not found error if there is none.
internal/controller.go:384
↓ 2 callersFunctionNewMockgql
NewMockgql creates a new mock instance.
hardcover/mock.go:33
↓ 2 callersFunctionNewUpstream
NewUpstream creates a new http.Client with middleware appropriate for use with an upstream.
internal/controller.go:141
↓ 2 callersMethodPersisted
Persisted returns all in-flight author refreshes so they can be resumed. IDs are returned in FIFO order.
internal/persist.go:68
↓ 2 callersFunctionSetLogLevel
SetLogLevel sets the log level.
internal/log.go:26
↓ 2 callersMethodWrap
Wrap applies middleware.
internal/log.go:34
↓ 2 callersFunctionasinKey
(asin string)
internal/cache.go:168
next →1–100 of 1,014, ranked by callers