package org.wfanet.measurement.service.testing.storage

import kotlin.properties.Delegates
import org.wfanet.measurement.common.commandLineMain
import org.wfanet.measurement.service.common.CommonServer
import picocli.CommandLine

private class FakeStorageServiceFlags {
  @set:CommandLine.Option(
    names = ["--port", "-p"],
    description = ["TCP port for gRPC server."],
    required = true,
    defaultValue = "8080"
  )
  var port: Int by Delegates.notNull()
    private set
}

@CommandLine.Command(
  name = "gcp_worker_server",
  mixinStandardHelpOptions = true,
  showDefaultValues = true
)
private fun run(@CommandLine.Mixin fakeStorageServiceFlags: FakeStorageServiceFlags) {
  CommonServer(
    "FakeStorageService",
    fakeStorageServiceFlags.port,
    FakeStorageService()
  ).start().blockUntilShutdown()
}

fun main(args: Array<String>) = commandLineMain(::run, args)

package org.wfanet.measurement.service.testing.storage

import org.wfanet.measurement.common.commandLineMain
import org.wfanet.measurement.service.common.CommonServer
import picocli.CommandLine

@CommandLine.Command(
  name = "fake_storage_server",
  mixinStandardHelpOptions = true,
  showDefaultValues = true
)
private fun run(
  @CommandLine.Mixin commonServerFlags: CommonServer.Flags) {
  CommonServer.fromFlags(
    commonServerFlags,
    "FakeStorageService",
    FakeStorageService()
  ).start().blockUntilShutdown()
}

fun main(args: Array<String>) = commandLineMain(::run, args)

Fix storage fake to support verbose logging.
Fix storage fake to support verbose logging.

Bug: 162265237
Change-Id: I7e2ab61872bb781e2a915ddcfb87c758b080cde7

world-federation-of-advertisers/cross-media-measurement,world-federation-of-advertisers/cross-media-measurement,world-federation-of-advertisers/cross-media-measurement