Sha256: 0034fa3f7a791b9b009083d28db2339c015480bb143b8476b22b4f03fa1cceff

Contents?: true

Size: 1.34 KB

Versions: 61

Compression:

Stored size: 1.34 KB

Contents

package s3.website.model

import s3.website.ErrorReport

case class S3Endpoint(
  s3WebsiteHostname: String,
  s3Hostname: String
)

object S3Endpoint {
  val defaultEndpoint = S3Endpoint("s3-website-us-east-1.amazonaws.com", "s3.amazonaws.com")

  def forString(locationConstraint: String): Either[ErrorReport, S3Endpoint] = locationConstraint match {
    case "EU" | "eu-west-1" => Right(S3Endpoint("s3-website-eu-west-1.amazonaws.com",      "s3-eu-west-1.amazonaws.com"))
    case "us-east-1" =>        Right(defaultEndpoint)
    case "us-west-1" =>        Right(S3Endpoint("s3-website-us-west-1.amazonaws.com",      "s3-us-west-1.amazonaws.com"))
    case "us-west-2" =>        Right(S3Endpoint("s3-website-us-west-2.amazonaws.com",      "s3-us-west-2.amazonaws.com"))
    case "ap-southeast-1" =>   Right(S3Endpoint("s3-website-ap-southeast-1.amazonaws.com", "s3-ap-southeast-1.amazonaws.com"))
    case "ap-southeast-2" =>   Right(S3Endpoint("s3-website-ap-southeast-2.amazonaws.com", "s3-ap-southeast-2.amazonaws.com"))
    case "ap-northeast-1" =>   Right(S3Endpoint("s3-website-ap-northeast-1.amazonaws.com", "s3-ap-northeast-1.amazonaws.com"))
    case "sa-east-1" =>        Right(S3Endpoint("s3-website-sa-east-1.amazonaws.com",      "s3-sa-east-1.amazonaws.com"))
    case _ =>                  Left(ErrorReport(s"Unrecognised endpoint: $locationConstraint"))
  }
}

Version data entries

61 entries across 61 versions & 2 rubygems

Version Path
s3_website-2.15.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.14.3 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.14.2 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.14.1 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.14.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.13.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.12.3 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.12.2 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.12.1 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.11.2 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.11.1 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.11.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.10.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.9.0 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.8.6 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.8.5 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.8.4 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.8.3 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.8.1 src/main/scala/s3/website/model/S3Endpoint.scala
s3_website-2.8.0 src/main/scala/s3/website/model/S3Endpoint.scala