mirror of
https://github.com/syumai/workers.git
synced 2025-03-11 17:59:12 +00:00
25 lines
394 B
Go
25 lines
394 B
Go
package fetch
|
|
|
|
import (
|
|
"net/http"
|
|
"syscall/js"
|
|
|
|
"github.com/syumai/workers/internal/jsutil"
|
|
)
|
|
|
|
// Client is an HTTP client.
|
|
type Client struct {
|
|
*http.Client
|
|
|
|
// namespace - Objects that Fetch API belongs to. Default is Global
|
|
namespace js.Value
|
|
}
|
|
|
|
// NewClient returns new Client
|
|
func NewClient() *Client {
|
|
return &Client{
|
|
Client: &http.Client{},
|
|
namespace: jsutil.Global,
|
|
}
|
|
}
|