MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / NewServer

Function NewServer

server/s3/server.go:14–28  ·  view source on GitHub ↗

Make a new S3 Server to serve the remote

(ctx context.Context)

Source from the content-addressed store, hash-verified

12
13// Make a new S3 Server to serve the remote
14func NewServer(ctx context.Context) (h http.Handler, err error) {
15 var newLogger logger
16 authPairs := authlistResolver()
17 faker := gofakes3.New(
18 newBackend(),
19 // gofakes3.WithHostBucket(!opt.pathBucketMode),
20 gofakes3.WithLogger(newLogger),
21 gofakes3.WithRequestID(rand.Uint64()),
22 gofakes3.WithoutVersioning(),
23 gofakes3.WithV4Auth(authPairs),
24 gofakes3.WithIntegrityCheck(true), // Check Content-MD5 if supplied
25 )
26
27 return redirectHandler(faker.Server(), authPairs), nil
28}

Callers 2

S3Function · 0.92
S3ServerFunction · 0.92

Calls 3

authlistResolverFunction · 0.85
newBackendFunction · 0.85
redirectHandlerFunction · 0.85

Tested by

no test coverage detected