当前位置: 首页>>代码示例>>Scala>>正文


Scala RawOptions类代码示例

本文整理汇总了Scala中io.scalajs.RawOptions的典型用法代码示例。如果您正苦于以下问题:Scala RawOptions类的具体用法?Scala RawOptions怎么用?Scala RawOptions使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了RawOptions类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Scala代码示例。

示例1: ConsumerGroupOptions

//设置package包名称以及导入依赖的类
package io.scalajs.npm.kafkanode

import io.scalajs.RawOptions

import scala.scalajs.js
import scala.scalajs.js.annotation.ScalaJSDefined
import scala.scalajs.js.|


@ScalaJSDefined
class ConsumerGroupOptions(var batch: js.UndefOr[String] = js.undefined,
                           var fromOffset: js.UndefOr[String] = js.undefined,
                           var host: js.UndefOr[String] = js.undefined,
                           var groupId: js.UndefOr[String] = js.undefined,
                           var outOfRangeOffset: js.UndefOr[String | js.Array[String]] = js.undefined,
                           var migrateHLC: js.UndefOr[Boolean] = js.undefined,
                           var migrateRolling: js.UndefOr[Boolean] = js.undefined,
                           var protocol: js.UndefOr[js.Array[String]] = js.undefined,
                           var sessionTimeout: js.UndefOr[Int] = js.undefined,
                           var ssl: js.UndefOr[Boolean] = js.undefined,
                           var zk: js.UndefOr[RawOptions] = js.undefined)
    extends js.Object 
开发者ID:scalajs-io,项目名称:kafka-node,代码行数:23,代码来源:ConsumerGroupOptions.scala

示例2: apply

//设置package包名称以及导入依赖的类
package io.scalajs.npm.brake

import io.scalajs.RawOptions
import io.scalajs.nodejs.stream.{Readable, Writable}

import scala.scalajs.js
import scala.scalajs.js.annotation.{JSImport, ScalaJSDefined}
import scala.scalajs.js.|

/**
  * brake - throttle a stream with backpressure
  * @see https://www.npmjs.com/package/brake
  * @author [email protected]
  */
@js.native
trait Brake extends js.Object {

  /**
    * Return a transform stream b that applies backpressure when more data than the rate allows is written.
    * @param rate    the throttle rate
    * @param options the throttle options
    * @return a [[Readable]] / [[Writable]] instance
    */
  def apply(rate: Double, options: ThrottleOptions | RawOptions = js.native): Readable with Writable = js.native

}

/**
  * Brake Singleton
  * @author [email protected]
  */
@js.native
@JSImport("brake", JSImport.Namespace)
object Brake extends Brake

/**
  * Throttle Options
  * @param rate   How many bytes to emit for each interval of length period
  * @param period How often to check the output length in milliseconds. Default value: 1000.
  */
@ScalaJSDefined
class ThrottleOptions(var rate: js.UndefOr[Double] = js.undefined,
                      var period: js.UndefOr[Int] = js.undefined) extends js.Object 
开发者ID:scalajs-io,项目名称:brake,代码行数:44,代码来源:Brake.scala

示例3: GlobObjectEnrichment

//设置package包名称以及导入依赖的类
package io.scalajs.npm

import io.scalajs.RawOptions
import io.scalajs.util.PromiseHelper._

import scala.concurrent.Future
import scala.scalajs.js
import scala.scalajs.js.{Array, |}

/**
  * glob package object
  * @author [email protected]
  */
package object glob {

  type GlobError = js.Any

  type GlobCallback = js.Function2[GlobError, js.Array[String], Any]

  /**
    * Glob Enrichment
    * @param glob the given [[GlobClass glob]]
    */
  implicit class GlobObjectEnrichment(val glob: GlobClass) extends AnyVal {

    @inline
    def future(pattern: String, options: GlobOptions | RawOptions = null): Future[Array[String]] = {
      promiseWithError1[GlobError, js.Array[String]](glob(pattern, options, _))
    }

  }

} 
开发者ID:scalajs-io,项目名称:glob,代码行数:34,代码来源:package.scala

示例4: S3Enrichment

//设置package包名称以及导入依赖的类
package io.scalajs.npm.aws

import io.scalajs.RawOptions
import io.scalajs.util.PromiseHelper._

import scala.concurrent.Future
import scala.scalajs.js
import scala.scalajs.js.|

/**
  * aws.s3 package object
  * @author [email protected]
  */
package object s3 {
  type EncodingType = js.Object
  type IsTruncated = js.Object
  type KeyCount = js.Object
  type CommonPrefixList = js.Array[String]
  type NextToken = js.Object
  type ObjectList = js.Object
  type StartAfter = js.Object
  type Token = js.Object

  /**
    * AWS S3 Enrichment
    * @param s3 the [[S3]] instance
    */
  implicit class S3Enrichment(val s3: S3) extends AnyVal {

    @inline
    def getBucketLocationFuture(params: BucketParams | RawOptions): Future[GetBucketLocationOutput] = {
      promiseWithError1[AWSError, GetBucketLocationOutput](s3.getBucketLocation(params, _))
    }

  }

} 
开发者ID:scalajs-io,项目名称:aws-s3,代码行数:38,代码来源:package.scala

示例5: ConfigBase

//设置package包名称以及导入依赖的类
package io.scalajs.npm.aws

import io.scalajs.RawOptions

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport
import scala.scalajs.js.|

/**
  * AWS.ConfigBase
  * @author [email protected]
  */
@js.native
@JSImport("aws-sdk", "ConfigBase")
class ConfigBase(val options: ConfigurationOptions = js.native) extends ConfigurationOptions {

  /**
    * Loads credentials from the configuration object.
    */
  def getCredentials(callback: AWSError => Any): Unit = js.native

  /**
    * Loads configuration data from a JSON file into this config object.
    * Loading configuration will reset all existing configuration on the object.
    * This feature is not supported in the browser environment of the SDK.
    * @param path the path relative to your process's current working directory to load configuration from.
    */
  def loadFromPath(path: String): ConfigBase = js.native

  /**
    * Updates the current configuration object with new options.
    * @param options          a map of option keys and values.
    * @param allowUnknownKeys Whether unknown keys can be set on the configuration object.
    */
  def update(options: ConfigurationOptions | RawOptions, allowUnknownKeys: Boolean = js.native): Unit = js.native

  /**
    * Gets the promise dependency the SDK will use wherever Promises are returned.
    */
  def getPromisesDependency(): js.Function = js.native

  /**
    * Sets the promise dependency the SDK will use wherever Promises are returned.
    * @param dep - (function) a reference to a Promise constructor
    */
  def setPromisesDependency(dep: js.Function): Unit = js.native

} 
开发者ID:scalajs-io,项目名称:aws-s3,代码行数:49,代码来源:ConfigBase.scala


注:本文中的io.scalajs.RawOptions类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。