diff options
author | vlad <vlad@driver.xyz> | 2017-06-13 10:25:55 -0700 |
---|---|---|
committer | vlad <vlad@driver.xyz> | 2017-06-13 10:25:55 -0700 |
commit | 0000a65ab4479a2a40e2d6468036438e9705b4aa (patch) | |
tree | 60c868828741e7e5367aa7b6d167abbdaf91d5b8 /src/main/scala/xyz/driver/common/auth/RequestId.scala | |
download | rest-query-0000a65ab4479a2a40e2d6468036438e9705b4aa.tar.gz rest-query-0000a65ab4479a2a40e2d6468036438e9705b4aa.tar.bz2 rest-query-0000a65ab4479a2a40e2d6468036438e9705b4aa.zip |
Initial extraction of Driver non-specific utilities
Diffstat (limited to 'src/main/scala/xyz/driver/common/auth/RequestId.scala')
-rw-r--r-- | src/main/scala/xyz/driver/common/auth/RequestId.scala | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/main/scala/xyz/driver/common/auth/RequestId.scala b/src/main/scala/xyz/driver/common/auth/RequestId.scala new file mode 100644 index 0000000..771145c --- /dev/null +++ b/src/main/scala/xyz/driver/common/auth/RequestId.scala @@ -0,0 +1,15 @@ +package xyz.driver.common.auth + +import xyz.driver.common.logging._ +import xyz.driver.common.auth.RequestId._ +import xyz.driver.common.utils.RandomUtils + +final case class RequestId(value: String = RandomUtils.randomString(IdLength)) + +object RequestId { + + private val IdLength = 20 + + implicit def toPhiString(x: RequestId): PhiString = phi"RequestId(${Unsafe(x.value)})" + +} |