request_option.go
387 字节
package gateway
import "net/http"
type RequestOptions struct {
Header http.Header
// key:form key value:path
FileMap map[string]string
}
type Option func(o *RequestOptions)
func WithHeader(header http.Header) Option {
return func(o *RequestOptions) {
o.Header = header
}
}
func WithFileMap(v map[string]string) Option {
return func(o *RequestOptions) {
o.FileMap = v
}
}