pepegar / hammock
1
package hammock
2

3
package object hi {
4 1
  def auth(a: Auth): Opts => Opts = Opts.auth.set(Some(a))
5

6 0
  def cookies_!(cookies: List[Cookie]): Opts => Opts = Opts.cookies.set(Some(cookies))
7 1
  def cookies(cookies: List[Cookie]): Opts => Opts = Opts.cookies.modify {
8 1
    case None => Some(cookies)
9 1
    case c    => c.map(cookies ++ _)
10
  }
11 1
  def cookie(cookie: Cookie): Opts => Opts = Opts.cookies.modify {
12 1
    case None => Some(List(cookie))
13 0
    case c    => c.map(cookie :: _)
14
  }
15

16 0
  def headers_!(headers: Map[String, String]): Opts => Opts = Opts.headers.set(headers)
17 0
  def headers(headers: Map[String, String]): Opts => Opts   = Opts.headers.modify(headers ++ _)
18 1
  def header(header: (String, String)): Opts => Opts        = Opts.headers.modify(_ + header)
19

20
  implicit class opts2OptsSyntax(a: Opts => Opts) {
21
    @deprecated("use cats' <<< or >>> instead", "0.7.0")
22 0
    def &>(b: Opts => Opts): Opts => Opts = a compose b
23
  }
24
}

Read our documentation on viewing source code .

Loading