MCPcopy Create free account

hub / github.com/DMarby/picsum-photos / functions

Functions185 in github.com/DMarby/picsum-photos

↓ 40 callersMethodRun
Run starts the queue and blocks until it's shut down
internal/queue/queue.go:45
↓ 35 callersMethodGet
(ctx context.Context, id string)
internal/storage/storage.go:10
↓ 31 callersMethodSet
(ctx context.Context, key string, data []byte)
internal/cache/cache.go:14
↓ 16 callersFunctionInternalServerError
InternalServerError is a convenience function for returning an internal server error
internal/handler/handler.go:15
↓ 12 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
internal/handler/handler.go:43
↓ 10 callersFunctioncreateFixture
(router http.Handler, hmac *hmac.HMAC, URL string, fixtureName string, extension string)
internal/imageapi/api_test.go:243
↓ 10 callersMethodlogError
Utility methods for logging
internal/api/api.go:33
↓ 10 callersFunctionresizeImage
(t *testing.T, imageBuffer []byte)
internal/vips/vips_test.go:221
↓ 9 callersFunctionNew
New creates a new logger
internal/logger/logger.go:18
↓ 9 callersFunctionSaveToJpegBuffer
SaveToJpegBuffer saves an image as JPEG to a buffer
internal/vips/vips.go:120
↓ 9 callersFunctionSaveToWebPBuffer
SaveToWebPBuffer saves an image as WebP to a buffer
internal/vips/vips.go:140
↓ 8 callersFunctionBadRequest
BadRequest is a convenience function for returning a bad request error
internal/handler/handler.go:23
↓ 8 callersFunctionResizeImage
ResizeImage loads an image from a buffer and resizes it.
internal/vips/vips.go:97
↓ 8 callersMethodStart
(ctx context.Context, spanName string, opts ...trace.SpanStartOption)
internal/tracing/tracing.go:58
↓ 8 callersFunctionmarshalJson
(v interface{})
internal/api/api_test.go:460
↓ 8 callersFunctionreadFixture
(fixtureName string, extension string)
internal/imageapi/api_test.go:189
↓ 7 callersFunctionfixturePath
(fixtureName string, extension string)
internal/vips/vips_test.go:236
↓ 6 callersFunctionBlur
Blur applies gaussian blur to an image
internal/vips/vips.go:175
↓ 6 callersFunctionGetParams
GetParams parses and returns all the path and query parameters
internal/params/params.go:31
↓ 6 callersFunctionGrayscale
Grayscale converts an image to grayscale
internal/vips/vips.go:160
↓ 6 callersMethodShutdown
()
internal/cache/cache.go:15
↓ 6 callersFunctioncatchVipsError
catchVipsError returns the vips error buffer as an error
internal/vips/vips.go:87
↓ 6 callersFunctionfullTest
(processor *vips.Processor, buf []byte, format image.OutputFormat)
internal/image/vips/vips_test.go:135
↓ 6 callersFunctionreadFixture
(fixtureName string, extension string)
internal/vips/vips_test.go:232
↓ 5 callersMethodProcess
Process adds a job to the queue, waits for it to process, and returns the result
internal/queue/queue.go:87
↓ 5 callersMethodRouter
Router returns a http router
internal/api/api.go:38
↓ 5 callersFunctionTracer
(log *logger.Logger)
internal/tracing/test/tracing.go:11
↓ 5 callersMethodvalidateAndRedirect
(w http.ResponseWriter, r *http.Request, p *params.Params, image *database.Image, cacheable bool)
internal/api/image.go:109
↓ 4 callersMethodCreate
Create creates a HMAC based on the parameter values, encoded as urlsafe base64
internal/hmac/hmac.go:15
↓ 4 callersMethodGetRandom
(ctx context.Context)
internal/database/database.go:20
↓ 4 callersFunctionHMAC
HMAC generates and appends an HMAC to a URL path + query params
internal/params/hmac.go:11
↓ 4 callersFunctionNew
New returns a new Provider instance
internal/storage/file/file.go:19
↓ 4 callersFunctionNewCache
NewCache instantiates a new cache
internal/image/cache.go:15
↓ 4 callersFunctionNewEmptyImage
NewEmptyImage returns an empty image object
internal/vips/vips.go:204
↓ 4 callersFunctionNewTask
NewTask creates a new image processing task
internal/image/task.go:26
↓ 4 callersMethodProcessImage
(ctx context.Context, task *Task)
internal/image/image.go:7
↓ 4 callersMethodRouter
Router returns a http router
internal/imageapi/api.go:63
↓ 4 callersFunctionUnrefImage
UnrefImage unrefs an image object
internal/vips/vips.go:197
↓ 4 callersMethodgetImage
(r *http.Request, imageID string)
internal/api/image.go:81
↓ 4 callersFunctionserveFile
Serve a static file
internal/api/api.go:135
↓ 4 callersFunctionsetupQueue
(f func(ctx context.Context, data interface{}) (interface{}, error))
internal/queue/queue_test.go:11
↓ 3 callersFunctionBuildQuery
Utilities for building a URL with query params BuildQuery builds a query parameter string for the given values It differs from the stdlib url.Values.E
internal/params/query.go:14
↓ 3 callersMethodLen
Len returns the current number of jobs waiting in the queue buffer
internal/queue/queue.go:82
↓ 3 callersMethodList
(ctx context.Context, offset, limit int)
internal/database/database.go:23
↓ 3 callersMethodMatch
(r *http.Request)
internal/handler/route_matcher.go:11
↓ 3 callersFunctionNew
New returns a new Provider instance
internal/cache/memory/memory.go:17
↓ 3 callersFunctionNew
New returns a new Provider instance
internal/database/file/file.go:26
↓ 3 callersFunctionRecovery
Recovery is a handler for handling panics
internal/handler/recovery.go:12
↓ 3 callersMethodRun
Run starts the health checker
internal/health/health.go:37
↓ 3 callersFunctionShutdown
Shutdown libvips
internal/vips/vips.go:77
↓ 3 callersFunctionTraceInfo
(ctx context.Context)
internal/tracing/tracing.go:68
↓ 3 callersMethodValidate
Validate validates that the parameter values matches a given HMAC
internal/hmac/hmac.go:27
↓ 3 callersMethodgetListImage
(image database.Image)
internal/api/list.go:152
↓ 3 callersFunctionintParam
intParam tries to get a param and convert it to an Integer
internal/params/params.go:81
↓ 3 callersMethodsendImage
sendImage writes the processed image to the response with appropriate headers
internal/imageapi/image.go:123
↓ 3 callersFunctionsetup
()
internal/image/vips/vips_test.go:105
↓ 2 callersMethodBlur
Blur applies gaussian blur to the image
internal/image/task.go:37
↓ 2 callersMethodGetRandomWithSeed
(ctx context.Context, seed int64)
internal/database/database.go:21
↓ 2 callersMethodGrayscale
Grayscale turns the image into grayscale
internal/image/task.go:44
↓ 2 callersFunctionInitialize
Initialize libvips if it's not already started
internal/vips/vips.go:29
↓ 2 callersMethodListAll
(ctx context.Context)
internal/database/database.go:22
↓ 2 callersFunctionLogFields
LogFields logs the given keys and values for a request
internal/handler/logger.go:58
↓ 2 callersFunctionLogger
Logger is a handler that logs requests using Zap
internal/handler/logger.go:14
↓ 2 callersFunctionMetrics
Metrics is a handler that collects performance metrics
internal/handler/metrics.go:66
↓ 2 callersFunctionNew
New initializes a new processor instance
internal/image/vips/vips.go:29
↓ 2 callersFunctionNew
New creates a new Queue with the specified amount of workers
internal/queue/queue.go:33
↓ 2 callersFunctionNewHTTPErrorLog
(logger *Logger)
internal/logger/logger.go:68
↓ 2 callersFunctionServe
Serve starts an http server for metrics and healthchecks
internal/metrics/metrics.go:14
↓ 2 callersFunctionSetUserComment
SetUserComment sets the UserComment field in the exif metadata for an image
internal/vips/vips.go:190
↓ 2 callersMethodStatus
Status returns the status of the health checks
internal/health/health.go:55
↓ 2 callersFunctionTracer
Tracer is a handler that adds tracing for handlers
internal/handler/tracing.go:12
↓ 2 callersMethodWrite
(p []byte)
internal/logger/logger.go:56
↓ 2 callersFunctionaddQueryParam
addQueryParam adds a query parameter to a byte buffer
internal/params/query.go:38
↓ 2 callersFunctionfileHeaders
Set headers for static file handlers
internal/api/api.go:127
↓ 2 callersFunctionfixturePath
(fixtureName string, extension string)
internal/imageapi/api_test.go:254
↓ 2 callersMethodgetImageFromSeed
(r *http.Request, imageSeed string)
internal/api/image.go:95
↓ 2 callersMethodlogError
Utility methods for logging
internal/imageapi/api.go:58
↓ 2 callersMethodrunCheck
()
internal/health/health.go:62
↓ 2 callersFunctionsetup
(t *testing.T)
internal/vips/vips_test.go:204
↓ 2 callersFunctionsetup
(t *testing.T, ctx context.Context)
internal/imageapi/api_test.go:221
↓ 2 callersFunctionupdateButton
(id, page_url)
internal/web/embed/assets/js/images.js:72
↓ 1 callersMethodGet
Get returns an object from the cache if it exists, otherwise it loads it into the cache and returns it
internal/cache/cache.go:30
↓ 1 callersFunctionHealth
Health is a handler for health check status
internal/handler/health.go:11
↓ 1 callersFunctionServiceUnavailable
ServiceUnavailable is a convenience function for returning a service unavailable error
internal/handler/handler.go:31
↓ 1 callersFunctionValidateHMAC
ValidateHMAC validates the URL path/query params, given an hmac in a query parameter named hmac
internal/params/hmac.go:22
↓ 1 callersMethodblur
blur applies gaussian blur to an image
internal/image/vips/image.go:37
↓ 1 callersFunctionbuildCacheKey
buildCacheKey creates a unique key for request coalescing based on image parameters
internal/imageapi/image.go:155
↓ 1 callersFunctionbuildFilename
(imageID string, p *params.Params)
internal/imageapi/image.go:169
↓ 1 callersMethodcheck
(ctx context.Context, channel chan Status)
internal/health/health.go:106
↓ 1 callersFunctiongetContentType
(extension string)
internal/imageapi/image.go:145
↓ 1 callersFunctiongetFileExtension
getFileExtension gets the file extension (if present) from the path params, and validates it
internal/params/params.go:93
↓ 1 callersMethodgetImage
(id string)
internal/database/file/file.go:56
↓ 1 callersFunctiongetImageDimensions
(p *params.Params, databaseImage *database.Image)
internal/api/params.go:41
↓ 1 callersFunctiongetLimit
(r *http.Request)
internal/api/list.go:115
↓ 1 callersMethodgetLinkHeader
(page, limit int, end bool)
internal/api/list.go:137
↓ 1 callersFunctiongetOutputFormat
(extension string)
internal/imageapi/image.go:136
↓ 1 callersFunctiongetPage
(r *http.Request)
internal/api/list.go:128
↓ 1 callersFunctiongetQueryParams
getQueryParams returns whether the grayscale and blur queryparams are present
internal/params/params.go:112
↓ 1 callersFunctiongetSize
getSize gets the image size from the size or the width/height path params, and validates it
internal/params/params.go:60
↓ 1 callersMethodgrayscale
grayscale turns an image into grayscale
internal/image/vips/image.go:25
next →1–100 of 185, ranked by callers