Documentation ¶
Overview ¶
Package manael provides HTTP handler for processing images.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Encode ¶ added in v1.8.0
Encode writes the Image m to w in the format specified by Content-Type t.
func NewResponse ¶ added in v1.4.4
NewResponse returns response
Example ¶
package main import ( "fmt" "log" "net/http" "manael.org/x/manael" ) func main() { req, err := http.NewRequest(http.MethodGet, "https://manael.test/", nil) if err != nil { log.Fatal(err) } resp := manael.NewResponse(req, http.StatusOK) fmt.Println(resp.StatusCode) }
Output: 200
Types ¶
type Proxy ¶ added in v1.4.1
type Proxy struct {
Transport http.RoundTripper
}
A Proxy responds to an HTTP request.
func NewServeProxy ¶
NewServeProxy returns a new Proxy given a upstream URL
Example ¶
package main import ( "log" "net/http" "manael.org/x/manael" ) func main() { p := manael.NewServeProxy("http://localhost:9000") err := http.ListenAndServe(":8080", p) if err != nil { log.Fatal(err) } }
Output:
Source Files ¶
Click to show internal directories.
Click to hide internal directories.