All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.avast.gradle.dockercompose.ServiceInfo.groovy Maven / Gradle / Ivy

There is a newer version: 0.17.12
Show newest version
package com.avast.gradle.dockercompose

import groovy.transform.Immutable

@Immutable(knownImmutableClasses = [ContainerInfo], copyWith = true)
class ServiceInfo {
    String name
    /* Key is instance name, for example service_1 */
    Map containerInfos = [:]

    String getHost() { firstContainer?.serviceHost.host }
    Map getPorts() { tcpPorts }
    Map getTcpPorts() { firstContainer?.tcpPorts ?: [:] }
    Map getUdpPorts() { firstContainer?.udpPorts ?: [:] }
    Integer getPort() { firstContainer?.port }
    Integer getTcpPort() { firstContainer?.tcpPort }
    Integer getUdpPort() { firstContainer?.udpPort }

    ContainerInfo getFirstContainer() {
        containerInfos.values()?.find()
    }

    def propertyMissing(String name) {
        return containerInfos[name]
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy