svc

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 9, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewInstrument

NewInstrument returns a service that instruments metrics.

func NewLogging

NewLogging returns a service that logs messages.

func NewService

func NewService(opts ...Option) v0proto.ThumbnailServiceHandler

NewService returns a service implementation for Service.

func NewTracing

NewTracing returns a service that instruments traces.

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 ThumbnailSource

func ThumbnailSource(val imgsource.Source) Option

ThumbnailSource provides a function to set the image source option.

func ThumbnailStorage

func ThumbnailStorage(val storage.Storage) Option

ThumbnailStorage provides a function to set the thumbnail storage option.

type Options

type Options struct {
	Logger           log.Logger
	Config           *config.Config
	Middleware       []func(http.Handler) http.Handler
	ThumbnailStorage storage.Storage
	ImageSource      imgsource.Source
}

Options defines the available options for this package.

type Thumbnail

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

Thumbnail implements the GRPC handler.

func (Thumbnail) GetThumbnail

func (g Thumbnail) GetThumbnail(ctx context.Context, req *v0proto.GetRequest, rsp *v0proto.GetResponse) error

GetThumbnail retrieves a thumbnail for an image

Jump to

Keyboard shortcuts

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