package main

import (
	"context"
	"io"
	"net/http"
)

type netDirect struct {
	c http.Client
}

func (n *netDirect) Get(ctx context.Context, url string) (io.ReadCloser, int64, error) {
	var resp *http.Response
	if req, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil); err != nil {
		return nil, -2, err
	} else if resp, err = n.c.Do(req); err != nil {
		return nil, -2, err
	}
	return resp.Body, resp.ContentLength, nil
}
