to save up a progress
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
package main
|
||||
|
||||
type FileWithOptions struct {
|
||||
Options map[string]string
|
||||
io.Reader
|
||||
}
|
||||
|
||||
func mapToStruct[T any](m map[string]string, a T) T {
|
||||
t := reflect.TypeOf(a)
|
||||
for _, v := range reflect.VisibleFields(t) {
|
||||
v.
|
||||
}
|
||||
}
|
||||
|
||||
func Handle(img image.Image) http.Handler {
|
||||
func(w http.ResponseWriter,
|
||||
r *http.Request) {
|
||||
err := png.Encode(w, img)
|
||||
if err != nil {
|
||||
log.Fatal(err)
|
||||
w.WriteHeader(500)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
input: image with modifier options
|
||||
output: png image
|
||||
@@ -0,0 +1,3 @@
|
||||
package main
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user