Packages

object DynamoDb

An idiomatic DynamoDb client integrated with Monix ecosystem.

It is built on top of the DynamoDbAsyncClient, reason why all the exposed methods expect an implicit instance of the client to be in the scope of the call.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. DynamoDb
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  6. def create(credentialsProvider: AwsCredentialsProvider, region: Region, endpoint: Option[String] = None, httpClient: Option[SdkAsyncHttpClient] = None): Resource[Task, DynamoDb]

    Creates a Resource that will use the passed-by-parameter AWS configurations to acquire and release a Monix DynamoDb client.

    Creates a Resource that will use the passed-by-parameter AWS configurations to acquire and release a Monix DynamoDb client.

    Example

    import cats.effect.Resource
    import monix.eval.Task
    import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider
    import software.amazon.awssdk.regions.Region
    
    val defaultCredentials = DefaultCredentialsProvider.create()
    val dynamoDbResource: Resource[Task, DynamoDb] = DynamoDb.create(defaultCredentials, Region.AWS_GLOBAL)
    credentialsProvider

    the strategy for loading credentials and authenticate to AWS DynamoDb

    region

    an Amazon Web Services region that hosts a set of Amazon services.

    endpoint

    the endpoint url with which the SDK should communicate.

    httpClient

    sets the SdkAsyncHttpClient that the SDK service client will use to make HTTP calls.

    returns

    a Resource of Task that allocates and releases a Monix DynamoDb client.

  7. def createUnsafe(credentialsProvider: AwsCredentialsProvider, region: Region, endpoint: Option[String] = None, httpClient: Option[SdkAsyncHttpClient] = None): DynamoDb

    Creates a new DynamoDb instance out of the the passed AWS configurations.

    Creates a new DynamoDb instance out of the the passed AWS configurations.

    It provides a fast forward access to the DynamoDb that avoids dealing with Resource, however in this case, the created resources will not be released like in create. Thus, it is the user's responsability to close the connection.

    Example

    import monix.execution.Scheduler.Implicits.global
    import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider
    import software.amazon.awssdk.regions.Region
    
    val defaultCred = DefaultCredentialsProvider.create()
    val dynamoDb: DynamoDb = DynamoDb.createUnsafe(defaultCred, Region.AWS_GLOBAL)
    // do your stuff here
    dynamoDb.close.runToFuture
    credentialsProvider

    Strategy for loading credentials and authenticate to AWS.

    region

    An Amazon Web Services region that hosts a set of Amazon services.

    endpoint

    The endpoint url which the SDK should communicate to.

    httpClient

    Sets the SdkAsyncHttpClient that the SDK service client will use to make HTTP calls.

    returns

    a Resource of Task that allocates and releases a Monix DynamoDb client.

    Annotations
    @UnsafeBecauseImpure()
  8. def createUnsafe(dynamoDbAsyncClient: DynamoDbAsyncClient): DynamoDb

    Creates a instance of DynamoDb out of a DynamoDbAsyncClient.

    Creates a instance of DynamoDb out of a DynamoDbAsyncClient.

    It provides a fast forward access to the DynamoDb that avoids dealing with Resource.

    Unsafe because the state of the passed DynamoDbAsyncClient is not guaranteed, it can either be malformed or closed, which would result in underlying failures.

    dynamoDbAsyncClient

    an instance of a DynamoDbAsyncClient.

    returns

    An instance of the Monix DynamoDb client

    Annotations
    @UnsafeBecauseImpure()
    See also

    DynamoDb.fromConfig and DynamoDb.create for a pure usage of DynamoDb. They both will make sure that the connection is created with the required resources and guarantee that the client was not previously closed.

    Example

    import software.amazon.awssdk.auth.credentials.DefaultCredentialsProvider
    import software.amazon.awssdk.regions.Region.AWS_GLOBAL
    import software.amazon.awssdk.services.dynamodb.DynamoDbAsyncClient
    
    val asyncClient: DynamoDbAsyncClient = DynamoDbAsyncClient
       .builder()
       .credentialsProvider(DefaultCredentialsProvider.create())
       .region(AWS_GLOBAL)
       .build()
    
    val dynamoDb: DynamoDb = DynamoDb.createUnsafe(asyncClient)
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  12. def fromConfig: Resource[Task, DynamoDb]

    Creates a Resource that will use the values from a configuration file to allocate and release a DynamoDb.

    Creates a Resource that will use the values from a configuration file to allocate and release a DynamoDb. Thus, the api expects an application.conf file to be present in the resources folder.

    returns

    a Resource of Task that allocates and releases a Monix DynamoDb client.

    See also

    how does the expected .conf file should look like https://github.com/monix/monix-connect/blob/master/aws-auth/src/main/resources/reference.conf

    the cats effect resource data type: https://typelevel.org/cats-effect/datatypes/resource.html

  13. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  14. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  20. def toString(): String
    Definition Classes
    AnyRef → Any
  21. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()

Deprecated Value Members

  1. def consumer[In <: DynamoDbRequest, Out <: DynamoDbResponse](retries: Int = 0, delayAfterFailure: Option[FiniteDuration] = None)(implicit dynamoDbOp: DynamoDbOp[In, Out], client: DynamoDbAsyncClient): Consumer[In, Unit]
    Annotations
    @deprecated
    Deprecated

    moved to the companion trait as sink

  2. def transformer[In <: DynamoDbRequest, Out <: DynamoDbResponse](retries: Int = 0, delayAfterFailure: Option[FiniteDuration] = None)(implicit dynamoDbOp: DynamoDbOp[In, Out], client: DynamoDbAsyncClient): (Observable[In]) => Observable[Out]
    Annotations
    @deprecated
    Deprecated

    moved to the companion trait for safer usage

Inherited from AnyRef

Inherited from Any

Ungrouped