imageproxy

package
v0.1.9 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidCacheKey  = errors.New("invalid cache key; can't be decoded to URL")
	ErrCacheKeyNotFound = errors.New("cache key is not found")
)

Functions

This section is empty.

Types

type Option

type Option func(*Service) error

func SetCacheDir

func SetCacheDir(path string) Option

func SetProxyPrefix

func SetProxyPrefix(prefix string) Option

func SetTimeout

func SetTimeout(duration int) Option

type Request

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

func NewRequest

func NewRequest(input string, options ...RequestOption) (*Request, error)

func (*Request) GET

func (req *Request) GET() (*http.Request, error)

GET returns a *http.Request

func (*Request) Read

func (req *Request) Read(path string) (io.ReadCloser, error)

func (*Request) Write

func (req *Request) Write(path string, r io.Reader) error

type RequestOption

type RequestOption func(req *Request) error

func SetRawQueryString

func SetRawQueryString(queryString string) RequestOption

func SetService

func SetService(s *Service) RequestOption

func SetTransform

func SetTransform(options string) RequestOption

type Service

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

func NewService

func NewService(options ...Option) (*Service, error)

func (*Service) Do

func (s *Service) Do(ctx context.Context, req *Request, w io.Writer) error

func (*Service) Routes

func (s *Service) Routes() chi.Router

func (*Service) ServeHTTP

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

func (*Service) Shutdown

func (s *Service) Shutdown(ctx context.Context) error

Jump to

Keyboard shortcuts

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