GenericTcpKontainer

open class GenericTcpKontainer(kontainerSpec: KontainerSpec, delegate: PlatformKontainer) : GenericKontainer

Provides a base implementation's GenericKontainer.waitForReady based on TCP socket connectivity to the Kontainer's default TCP port.

Author

Scott Rossillo

Constructors

Link copied to clipboard
fun GenericTcpKontainer(kontainerSpec: KontainerSpec, delegate: PlatformKontainer)

Functions

Link copied to clipboard
open override fun getAddress(): String?

Returns the platform assigned address at which this Kontainer can be reached the application that started this Kontainer. The returned address may be an IP address or hostname depending on the platform on which it's running.

Link copied to clipboard
open override fun getDirectAddress(): String?

Returns the platform assigned address at which this Kontainer can be directly reached by other Kontainers running on the platform.

Link copied to clipboard
open override fun getPort(): Int?

Returns the platform assigned default port for this Kontainer. The default port is the first port specified by this Kontainer's KontainerSpec.

open override fun getPort(containerPort: Int): Int?

Returns the platform assigned port mapped to the given exposed containerPort defined by this Kontainer's KontainerSpec.

Link copied to clipboard
open suspend override fun remove()

Removes this Kontainer for the running platform. Once a Kontainer is removed, it cannot be restarted.

Link copied to clipboard
open override fun removeSync()

Removes this Kontainer synchronously from the running platform.

Link copied to clipboard
suspend override fun start(timeout: Long)

Starts this Kontainer asynchronously with the given timeout.

Link copied to clipboard
open override fun startSync(timeout: Long)

Starts this Kontainer synchronously with the given timeout, blocking the current thread until this Kontainer starts or the timeout is reached.

Link copied to clipboard
open override fun waitForReady(timeout: Long)

Waits until this Kontainer's default TCP port is up and accepting requests or the given timeout is reached.

Properties

Link copied to clipboard
open override val id: String

The platform assigned identifier for this Kontainer.

Link copied to clipboard
open override val kontainerSpec: KontainerSpec

The Kontainer specification for this Kontainer.