handler

package
v0.0.0-...-f83813f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 19, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

func ConfigureGetRoute

func ConfigureGetRoute(route httproute.Route) httproute.Route

func ConfigurePostRoute

func ConfigurePostRoute(route httproute.Route) httproute.Route

func ExtractKey

func ExtractKey(r *http.Request) string

Types

type DirectorMaker

type DirectorMaker interface {
	MakeDirector(extractKey func(*http.Request) string) func(*http.Request)
}

type GetHandler

type GetHandler struct {
	DirectorMaker DirectorMaker
	Logger        GetHandlerLogger
	ImagesCDNHost imagesconfig.ImagesCDNHost
	HTTPHost      utilhttputil.HTTPHost
	HTTPProto     utilhttputil.HTTPProto
	VipsDaemon    VipsDaemon
}

func (*GetHandler) ServeHTTP

func (h *GetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

type GetHandlerLogger

type GetHandlerLogger struct{ *log.Logger }

func NewGetHandlerLogger

func NewGetHandlerLogger(lf *log.Factory) GetHandlerLogger

type ImageVariant

type ImageVariant string
const (
	ImageVariantOriginal ImageVariant = "original"
	ImageVariantProfile  ImageVariant = "profile"
)

func ParseImageVariant

func ParseImageVariant(s string) (ImageVariant, bool)

type ImagesStore

type ImagesStore interface {
	Create(ctx context.Context, file *images.File) error
}

type JSONResponseWriter

type JSONResponseWriter interface {
	WriteResponse(rw http.ResponseWriter, resp *api.Response)
}

type PostHandler

type PostHandler struct {
	Logger                         PostHandlerLogger
	JSON                           JSONResponseWriter
	PostHandlerCloudStorageService PostHandlerCloudStorageService
	PresignProvider                PresignProvider
	Database                       *appdb.Handle
	ImagesStore                    ImagesStore
	Clock                          clock.Clock
}

func (*PostHandler) ServeHTTP

func (h *PostHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)

nolint:gocognit

type PostHandlerCloudStorageService

type PostHandlerCloudStorageService interface {
	PresignPutRequest(ctx context.Context, r *imagesservice.PresignUploadRequest) (*imagesservice.PresignUploadResponse, error)
}

type PostHandlerLogger

type PostHandlerLogger struct{ *log.Logger }

func NewPostHandlerLogger

func NewPostHandlerLogger(lf *log.Factory) PostHandlerLogger

type PresignProvider

type PresignProvider interface {
	Verify(r *http.Request) error
}

type VipsDaemon

type VipsDaemon interface {
	Process(i vipsutil.Input) (*vipsutil.Output, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL