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.

Source
DynamoDb.scala
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(monixAwsConf: Task[MonixAwsConf]): Resource[Task, DynamoDb]

    Provides a resource that uses the values from the config file to acquire and release a DynamoDb instance.

    Provides a resource that uses the values from the config file to acquire and release a DynamoDb instance.

    The config will come from MonixAwsConf which it is actually obtained from the application.conf file present under the resources folder.

    Example

    import monix.connect.aws.auth.MonixAwsConf
    import monix.eval.Task
    import monix.connect.dynamodb.DynamoDb
    
    val awsConf: Task[MonixAwsConf] = MonixAwsConf.load()
    DynamoDb.fromConfig(awsConf).use { dynamoDb =>
           //business logic here
           Task.unit
     }
    monixAwsConf

    a task containing the monix aws config read from config file.

    returns

    a Resource of Task that acquires and releases DynamoDb.

  13. def fromConfig(monixAwsConf: MonixAwsConf): Resource[Task, DynamoDb]

    Provides a resource that uses the values from the config file to acquire and release a DynamoDb instance.

    Provides a resource that uses the values from the config file to acquire and release a DynamoDb instance.

    The config will come from MonixAwsConf which it is actually obtained from the application.conf file present under the resources folder.

    Example

    import monix.connect.aws.auth.MonixAwsConf
    import monix.connect.dynamodb.DynamoDb
    import monix.eval.Task
    import software.amazon.awssdk.regions.Region
    
    MonixAwsConf.load().flatMap{ awsConf =>
        // you can update your config from code too
        val updatedAwsConf = awsConf.copy(region = Region.AP_SOUTH_1)
        DynamoDb.fromConfig(updatedAwsConf).use { dynamoDb =>
           //business logic here
           Task.unit
        }
    }
    monixAwsConf

    the monix aws config read from config file.

    returns

    a Resource of Task that acquires and releases DynamoDb.

  14. def fromConfig(namingConvention: NamingConvention = KebabCase): Resource[Task, DynamoDb]

    Provides a resource that uses the values from the config file to acquire and release a DynamoDb instance.

    Provides a resource that uses the values from the config file to acquire and release a DynamoDb instance.

    It does not requires any input parameter as it expect the aws config to be set from application.conf, which has to be placed under the resources folder and will overwrite the defaults values from: https://github.com/monix/monix-connect/blob/master/aws-auth/src/main/resources/reference.conf.

    Example

    import monix.connect.aws.auth.MonixAwsConf
    import monix.connect.dynamodb.DynamoDb
    import monix.eval.Task
    
    DynamoDb.fromConfig.use { dynamoDb =>
       //business logic here
       Task.unit
    }
    returns

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

  15. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  19. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  20. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  21. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  22. def toString(): String
    Definition Classes
    AnyRef → Any
  23. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  24. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  25. 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 fromConfig: Resource[Task, DynamoDb]

    Provides a resource that uses the values from the config file to acquire and release a DynamoDb instance.

    Provides a resource that uses the values from the config file to acquire and release a DynamoDb instance.

    It does not requires any input parameter as it expect the aws config to be set from application.conf, which has to be placed under the resources folder and will overwrite the defaults values from: https://github.com/monix/monix-connect/blob/master/aws-auth/src/main/resources/reference.conf.

    Example

    import monix.connect.aws.auth.MonixAwsConf
    import monix.connect.dynamodb.DynamoDb
    import monix.eval.Task
    
    DynamoDb.fromConfig.use { dynamoDb =>
       //business logic here
       Task.unit
    }
    returns

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

    Annotations
    @deprecated
    Deprecated

    (Since version 0.6.1) Use fromConfig(namingConvention)

  3. 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