url2img

package
v0.0.0-...-1e47164 Latest Latest
Warning

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

Go to latest
Published: Dec 22, 2020 License: GPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefOutput = "raw"
	DefFormat = "jpg"

	DefQuality               = 85
	DefDelay                 = 0
	DefWidth                 = 1600
	DefHeight                = 1200
	DefZoom                  = 1.0
	DefFull                  = false
	DefAbortOnLoadError      = false
	DefAbortOnLoadAssetError = false
)

Default and maximum values

View Source
const (
	Name    = "url2img"
	Version = "1.4"
)

Variables

This section is empty.

Functions

func NewResponseWriter

func NewResponseWriter(w http.ResponseWriter) *responseWriter

NewResponseWriter returns new responseWriter

Types

type Loader

type Loader struct {
	*Object
	*widgets.QWidget

	Map sync.Map
	// contains filtered or unexported fields
}

Loader represents image loader

func NewLoader

func NewLoader() *Loader

NewLoader returns new loader

func (*Loader) Destroy

func (l *Loader) Destroy()

Destroy destroys application

func (*Loader) Exec

func (l *Loader) Exec()

Exec starts Qt main loop

func (*Loader) LoadPage

func (l *Loader) LoadPage(p Params)

LoadPage loads page

type Object

type Object struct {
	core.QObject
	// contains filtered or unexported fields
}

Object struct

type Params

type Params struct {
	Id                    string            `json:"id"`
	Url                   string            `json:"url"`
	Output                string            `json:"output"`
	Format                string            `json:"format"`
	UA                    string            `json:"ua"`
	Quality               int               `json:"quality"`
	Delay                 int               `json:"delay"`
	Width                 int               `json:"width"`
	Height                int               `json:"height"`
	Zoom                  float64           `json:"zoom"`
	Full                  bool              `json:"full"`
	AbortOnLoadError      bool              `json:"abort_on_load_error"`
	AbortOnLoadAssetError bool              `json:"abort_on_load_asset_error"`
	Headers               map[string]string `json:"headers"`
}

Params represent parameters

func NewParams

func NewParams() Params

NewParams returns new params

func (*Params) BodyValues

func (p *Params) BodyValues(r *http.Request) (err error)

BodyValues gets params values from json body

func (*Params) FormValues

func (p *Params) FormValues(r *http.Request) (err error)

FormValues gets params values from form

func (*Params) Marshal

func (p *Params) Marshal() (string, error)

Marshal marshals params to string

func (*Params) Unmarshal

func (p *Params) Unmarshal(data string) error

Unmarshal unmarshals params from string

type Server

type Server struct {
	Bind         string
	Auth         *auth.BasicAuth
	LogFile      *os.File
	LogFilePath  string
	CacheDir     string
	Htpasswd     string
	MaxAge       int
	ReadTimeout  int
	WriteTimeout int
	Loader       *Loader
}

Server represents HTTP server

func NewServer

func NewServer() *Server

NewServer returns new Server

func (*Server) ListenAndServe

func (s *Server) ListenAndServe()

ListenAndServe listens on the TCP address and serves requests

func (*Server) ServeHTTP

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

ServeHTTP handles requests on incoming connections

Jump to

Keyboard shortcuts

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