mirror of
https://github.com/hanzoai/s3.git
synced 2026-10-30 14:59:09 +00:00
Kill MinIO; migrate object storage to SeaweedFS, rebranded Hanzo S3.
- module github.com/hanzoai/s3 (all 1920 imports rewritten); seaweedfs/{raft,goexif,go-fuse,cockroachdb-parser} kept as deps
- binary weed -> s3; display brand SeaweedFS -> Hanzo S3 (Server/version/admin); wire identifiers unchanged for S3 compat
- Dockerfile builds s3 (CGO_ENABLED=0, ldflags) -> ghcr.io/hanzoai/s3 via shared CI
- MinIO preserved in git history (prior main)
35 lines
639 B
Go
35 lines
639 B
Go
package framework
|
|
|
|
import (
|
|
"io"
|
|
"net/http"
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func NewHTTPClient() *http.Client {
|
|
return &http.Client{Timeout: 10 * time.Second}
|
|
}
|
|
|
|
func DoRequest(t testing.TB, client *http.Client, req *http.Request) *http.Response {
|
|
t.Helper()
|
|
resp, err := client.Do(req)
|
|
if err != nil {
|
|
t.Fatalf("http request %s %s: %v", req.Method, req.URL.String(), err)
|
|
}
|
|
return resp
|
|
}
|
|
|
|
func ReadAllAndClose(t testing.TB, resp *http.Response) []byte {
|
|
t.Helper()
|
|
if resp == nil {
|
|
return nil
|
|
}
|
|
defer resp.Body.Close()
|
|
body, err := io.ReadAll(resp.Body)
|
|
if err != nil {
|
|
t.Fatalf("read response body: %v", err)
|
|
}
|
|
return body
|
|
}
|