PlatformKontainer

interface PlatformKontainer : Kontainer

Provides an interface to be implemented by Kontainer delegates capable of translating method invocations into vendor platform calls.

Author

Scott Rossillo

See also

io.microkt.kontainers.docker.domain.DockerKontainer
io.microkt.kontainers.kubernetes.domain.KubernetesKontainer

Functions

Link copied to clipboard
abstract 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
abstract 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
abstract 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.

abstract 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
abstract suspend fun remove()

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

Link copied to clipboard
open fun removeSync()

Removes this Kontainer synchronously from the running platform.

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

Starts this Kontainer asynchronously with the given timeout.

Link copied to clipboard
open 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.

Properties

Link copied to clipboard
abstract val id: String

The platform assigned identifier for this Kontainer.

Link copied to clipboard
abstract val kontainerSpec: KontainerSpec

The Kontainer specification for this Kontainer.