api

package
v0.0.0-...-dfdb652 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2021 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidHMACSignature = xerrors.Errorf("invalid hmac signature")
)

Functions

func NewHealthHandler

func NewHealthHandler(started time.Time) http.HandlerFunc

func NewImageHandler

func NewImageHandler(srv *service.Service, auth Auth) http.HandlerFunc

func NewVersionHandler

func NewVersionHandler(info internal.BuildInfo) http.HandlerFunc

Types

type Auth

type Auth interface {
	Allow(ctx context.Context, r *http.Request) error
}

type AuthHMAC

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

func NewAuthHMAC

func NewAuthHMAC(key string, signParam string) *AuthHMAC

func (*AuthHMAC) Allow

func (auth *AuthHMAC) Allow(ctx context.Context, r *http.Request) error

type HTTPError

type HTTPError struct {
	Err  error
	Code int
}

func (*HTTPError) Error

func (err *HTTPError) Error() string

func (*HTTPError) MarshalJSON

func (err *HTTPError) MarshalJSON() ([]byte, error)

type ScreenshotInput

type ScreenshotInput struct {
	URL string `schema:"url,required"`

	Width  int     `schema:"width"`
	Height int     `schema:"height"`
	Scale  float64 `schema:"scale"`

	Format  internal.ImageFormat `schema:"format"`
	Quality int                  `schema:"quality"`

	ScrollPage bool `schema:"scroll_page"`
	FullPage   bool `schema:"full_page"`
	Delay      int  `schema:"delay"`

	ClipX      *float64 `schema:"clip_x"`
	ClipY      *float64 `schema:"clip_y"`
	ClipWidth  *float64 `schema:"clip_width"`
	ClipHeight *float64 `schema:"clip_height"`

	Fresh bool `schema:"fresh"`
	TTL   int  `schema:"ttl"`
}

Jump to

Keyboard shortcuts

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