GenericKontainer

abstract class GenericKontainer(kontainerSpec: KontainerSpec, delegate: PlatformKontainer) : Kontainer

Provides an abstract Kontainer implementation to handle common Kontainer actions. Delegates to a platform specific parent Kontainer to run the given kontainerSpec.

Author

Scott Rossillo

Constructors

Link copied to clipboard
fun GenericKontainer(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
abstract fun waitForReady(timeout: Long)

Blocks until this Kontainer is ready to accept requests.

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.

Inheritors

Link copied to clipboard