svc

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2025 License: Apache-2.0 Imports: 15 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(o *Options)

Option defines a single option function.

func Config

func Config(val *config.Config) Option

Config provides a function to set the config option.

func Logger

func Logger(val log.Logger) Option

Logger provides a function to set the logger option.

func Middleware

func Middleware(val ...func(http.Handler) http.Handler) Option

Middleware provides a function to set the middleware option.

func ThumbnailStorage

func ThumbnailStorage(storage storage.Storage) Option

ThumbnailStorage provides a function to set the ThumbnailStorage option.

type Options

type Options struct {
	Logger           log.Logger
	Config           *config.Config
	Middleware       []func(http.Handler) http.Handler
	ThumbnailStorage storage.Storage
	TraceProvider    trace.TracerProvider
}

Options defines the available options for this package.

type Service

type Service interface {
	ServeHTTP(w http.ResponseWriter, r *http.Request)
	GetThumbnail(w http.ResponseWriter, r *http.Request)
}

Service defines the service handlers.

func NewInstrument

func NewInstrument(next Service, metrics *metrics.Metrics) Service

NewInstrument returns a service that instruments metrics.

func NewLogging

func NewLogging(next Service, logger log.Logger) Service

NewLogging returns a service that logs messages.

func NewService

func NewService(opts ...Option) Service

NewService returns a service implementation for Service.

type Thumbnails

type Thumbnails struct {
	// contains filtered or unexported fields
}

Thumbnails implements the business logic for Service.

func (Thumbnails) GetThumbnail

func (s Thumbnails) GetThumbnail(w http.ResponseWriter, r *http.Request)

GetThumbnail implements the Service interface.

func (Thumbnails) ServeHTTP

func (s Thumbnails) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the Service interface.

func (Thumbnails) TransferTokenValidator

func (s Thumbnails) TransferTokenValidator(next http.Handler) http.Handler

TransferTokenValidator validates a transfer token

Jump to

Keyboard shortcuts

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