Example #1
0
// getAPIHandler api handler
func getAPIHandler(conf api.Config) (http.Handler, api.Minio) {
	mux := router.NewRouter()
	minioAPI := api.New()
	apiHandler := registerAPI(mux, minioAPI)
	apiHandler = registerCustomMiddleware(apiHandler, conf)
	return apiHandler, minioAPI
}
Example #2
0
// getRPCHandler rpc handler
func getRPCHandler() http.Handler {
	s := rpc.NewServer()
	s.RegisterJSONCodec()
	s.RegisterService(new(rpc.VersionService), "Version")
	s.RegisterService(new(rpc.SysInfoService), "SysInfo")
	s.RegisterService(new(rpc.MemStatsService), "MemStats")
	s.RegisterService(new(rpc.DonutService), "Donut")
	s.RegisterService(new(rpc.AuthService), "Auth")
	// Add new RPC services here
	return registerRPC(router.NewRouter(), s)
}