mirror of
https://github.com/hanzoai/s3.git
synced 2026-10-30 14:59:09 +00:00
masterzap→svc/master, volumezap→svc/volume, mqzap→svc/mq, filerzap→svc/filer, zapsvc→svc/object. Simple one-word packages nested under s3/svc/, parallel to s3/wire/<name>; the zap suffix was redundant (ZAP is the only transport) and compound. Dual-import collisions (s3/mq, s3/filer domain pkgs) aliased filersvc/ mqsvc in the few files that need both. Bare-name-vs-var clash (master param vs master pkg) fixed by renaming the param to masterAddr. Swept test/ stragglers + an e2e test's stale *grpc.ClientConn→transport.Conn. Suite green (66 ok).
25 lines
673 B
Go
25 lines
673 B
Go
package framework
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/hanzoai/s3/s3/pb/volume_server_pb"
|
|
"github.com/hanzoai/s3/s3/svc/volume"
|
|
|
|
"github.com/zap-proto/go/transport"
|
|
)
|
|
|
|
// DialVolumeServer dials the volume server over the native ZAP transport (gRPC is
|
|
// gone) and returns the connection plus a volume_server_pb.VolumeServerClient
|
|
// backed by it (volume.New). The caller closes the returned conn.
|
|
func DialVolumeServer(t testing.TB, address string) (transport.Conn, volume_server_pb.VolumeServerClient) {
|
|
t.Helper()
|
|
|
|
conn, err := transport.Dial("tcp", address)
|
|
if err != nil {
|
|
t.Fatalf("dial volume ZAP %s: %v", address, err)
|
|
}
|
|
|
|
return conn, volume.New(conn, nil)
|
|
}
|