Trait

com.zengularity.benji

BucketRef

Related Doc: package benji

Permalink

trait BucketRef extends AnyRef

A live reference to a storage bucket. The operations are scoped on the specified bucket.

Such reference must only be used with the storage which resolved it first.

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

Type Members

  1. trait DeleteRequest extends AnyRef

    Permalink

    A request to delete the bucket.

  2. trait ListRequest extends AnyRef

    Permalink

    A request to list the objects inside this bucket.

Abstract Value Members

  1. abstract def create(failsIfExists: Boolean = false)(implicit ec: ExecutionContext): Future[Unit]

    Permalink

    Creates the bucket, if the bucket already exists operation will succeed unless parameter failsIfExists is true.

    Creates the bucket, if the bucket already exists operation will succeed unless parameter failsIfExists is true.

    failsIfExists

    if true, the future will be failed if the bucket already exists.

    Note

    On some module configuring failsIfExists to true may slow down this operation.

    import scala.concurrent.{ ExecutionContext, Future }
    import com.zengularity.benji.{ BucketRef, ObjectStorage }
    def setupBucket(
      store: ObjectStorage, name: String)(
      implicit ec: ExecutionContext): Future[BucketRef] = {
      // Make sure a bucket is available (either a new or existing one)
      val bucket = store.bucket(name)
      bucket.create(failsIfExists = false).map(_ => bucket)
    }
  2. abstract def delete: DeleteRequest

    Permalink

    Prepares a request to delete the referenced bucket.

    Prepares a request to delete the referenced bucket.

    import akka.stream.Materializer
    
    import com.zengularity.benji.BucketRef
    
    def foo(myBucket: BucketRef)(implicit m: Materializer) =
      myBucket.delete() // .delete.apply()
    
    def bar(myBucket: BucketRef)(implicit m: Materializer) =
      myBucket.delete.ignoreIfNotExists() // delete.ignoreIfNotExists.apply()
  3. abstract def exists(implicit ec: ExecutionContext): Future[Boolean]

    Permalink

    Determines whether or not the bucket exists.

    Determines whether or not the bucket exists. false might be returned also in cases where you don't have permission to view a certain bucket.

    import scala.concurrent.{ ExecutionContext, Future }
    
    import com.zengularity.benji.ObjectStorage
    
    def check(store: ObjectStorage, name: String)(
      implicit ec: ExecutionContext): Future[Boolean] =
      store.bucket(name).exists
  4. abstract def name: String

    Permalink

    The name of the bucket.

  5. abstract def obj(objectName: String): ObjectRef

    Permalink

    Returns a reference to an child object, specified by the given name.

    Returns a reference to an child object, specified by the given name.

    objectName

    the name of child object

    import scala.concurrent.ExecutionContext
    import com.zengularity.benji.BucketRef
    def foo(myBucket: BucketRef)(implicit ec: ExecutionContext) =
      myBucket.obj("objInMyBucket").exists
  6. abstract def objects: ListRequest

    Permalink

    Prepares a request to list the bucket objects.

    Prepares a request to list the bucket objects.

    import akka.stream.Materializer
    import com.zengularity.benji.BucketRef
    
    def enumObjects(b: BucketRef)(implicit m: Materializer) = b.objects()
    
    def objectList(b: BucketRef)(implicit m: Materializer) =
      b.objects.collect[List]()
  7. abstract def versioning: Option[BucketVersioning]

    Permalink

    Try to get a reference of this bucket that would allow to perform versioning related operations.

    Try to get a reference of this bucket that would allow to perform versioning related operations.

    returns

    Some if the module of the bucket supports versioning related operations, otherwise None.

    def foo(myBucket: com.zengularity.benji.BucketRef) =
      myBucket.versioning.isDefined

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  6. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  7. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  8. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  9. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  10. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  12. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  13. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  14. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  15. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  16. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  17. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  18. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  19. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped