示例#1
0
文件: router.go 项目: wkuans/minio
// 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
}
示例#2
0
文件: router.go 项目: wkuans/minio
// 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)
}