All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.buoyant.admin.IndexTxtHandler.scala Maven / Gradle / Ivy

There is a newer version: 1.7.5
Show newest version
package io.buoyant.admin

import com.twitter.finagle.Service
import com.twitter.finagle.http.{MediaType, Request, Response}
import com.twitter.io.Buf
import com.twitter.util.Future

class IndexTxtHandler(paths: Seq[String])
  extends Service[Request, Response] {

  def apply(req: Request): Future[Response] = {
    val rsp = Response()
    rsp.version = req.version
    rsp.contentType = MediaType.Txt
    rsp.content = Buf.Utf8(paths.mkString("", "\n", "\n"))
    Future.value(rsp)
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy