예제 #1
0
// startServer starts an s3 compatible cloud storage server
func startServer(conf cloudServerConfig) *probe.Error {
	apiServer, err := configureAPIServer(conf)
	if err != nil {
		return err.Trace()
	}
	rateLimit := conf.RateLimit
	if err := minhttp.ListenAndServeLimited(rateLimit, apiServer); err != nil {
		return err.Trace()
	}
	return nil
}
예제 #2
0
// startController starts a minio controller
func startController(conf minioConfig) *probe.Error {
	rpcServer, err := configureControllerRPC(conf, getControllerRPCHandler(conf.Anonymous))
	if err != nil {
		return err.Trace()
	}
	// Setting rate limit to 'zero' no ratelimiting implemented
	if err := minhttp.ListenAndServeLimited(0, rpcServer); err != nil {
		return err.Trace()
	}
	return nil
}