Documentation ¶
Overview ¶
Test task for Yandex internship. Simple Go server that download all <img> tag images from HTML page, and return page with all images encoded base64. URL of HTTP page passes by query attribute. Support many different page encodings
Index ¶
Constants ¶
View Source
const ( CtxHTTPClientKey = "httpclient" CtxLoggerKey = "logger" )
public keys upper handler can
View Source
const (
//logger field to indicate log msg emitter
FromLoggerFieldKey = "from"
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextAdaptor ¶
Implement http.Handler interface for imgserver.Handler
func NewImgCtxAdaptor ¶
func (ContextAdaptor) ServeHTTP ¶
func (h ContextAdaptor) ServeHTTP(w http.ResponseWriter, req *http.Request)
type ErrorHandler ¶
type HandlerError ¶
type HandlerError struct {
// contains filtered or unexported fields
}
func NewHandlerError ¶
func NewHandlerError(statusCode int, description string) *HandlerError
func (*HandlerError) Error ¶
func (e *HandlerError) Error() string
type ImgHandler ¶
type ImgHandler struct { Log Logger LogicHandler LogicHandler ErrorHandler ErrorHandler Timeout time.Duration //no timeout if 0 // contains filtered or unexported fields }
func (*ImgHandler) ServeHTTPC ¶
func (h *ImgHandler) ServeHTTPC(ctx context.Context, w http.ResponseWriter, req *http.Request)
type ImgLogicHandler ¶
type ImgLogicHandler struct {
// contains filtered or unexported fields
}
func NewImgLogicHandler ¶
func NewImgLogicHandler(client *http.Client) *ImgLogicHandler
func (*ImgLogicHandler) HandleLogic ¶
type LogicHandler ¶
Click to show internal directories.
Click to hide internal directories.