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

zhttp.endpoint.package.scala Maven / Gradle / Ivy

There is a newer version: 2.0.0-RC11
Show newest version
package zhttp

import zhttp.http.Method

package object endpoint {

  /**
   * Extends Http Method to support syntax to create endpoints.
   */
  implicit class EndpointSyntax(method: Method) {
    def /(name: String): Endpoint[Unit] = Endpoint.fromMethod(method) / name
    def /[A](token: Parameter[A])(implicit ev: CanCombine.Aux[Unit, A, A]): Endpoint[A] =
      Endpoint.fromMethod(method) / token
  }

  /**
   * Alias to `Parameter[A]`
   */
  final def *[A](implicit ev: CanExtract[A]): Parameter[A] = Parameter[A]
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy