class Service extends AbstractObject implements IdAble

A content-addressed service providing TCP connectivity.

Properties

$lastQuery from  AbstractObject

Methods

__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

null|array|string|int|float|bool
queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

string
endpoint(int|null $port = null, string|null $scheme = '')

Retrieves an endpoint that clients can use to reach this container.

string
hostname()

Retrieves a hostname which can be used by clients to reach this container.

id()

A unique identifier for this Service.

array
ports()

Retrieves the list of ports provided by the service.

start()

Start the service and wait for its health checks to succeed.

stop(bool|null $kill = false)

Stop the service.

void
up(array|null $ports = null, bool|null $random = false)

Creates a tunnel that forwards traffic from the caller's network to this service.

withHostname(string $hostname)

Configures a hostname which can be used by clients within the session to reach this container.

Details

in AbstractObject at line 13
__construct(AbstractClient $client, QueryBuilderChain $queryBuilderChain)

No description

Parameters

AbstractClient $client
QueryBuilderChain $queryBuilderChain

in AbstractObject at line 19
protected null|array|string|int|float|bool queryLeaf(QueryBuilder $leafQueryBuilder, string $leafKey)

No description

Parameters

QueryBuilder $leafQueryBuilder
string $leafKey

Return Value

null|array|string|int|float|bool

at line 23
string endpoint(int|null $port = null, string|null $scheme = '')

Retrieves an endpoint that clients can use to reach this container.

If no port is specified, the first exposed port is used. If none exist an error is returned.

If a scheme is specified, a URL is returned. Otherwise, a host:port pair is returned.

Parameters

int|null $port
string|null $scheme

Return Value

string

at line 38
string hostname()

Retrieves a hostname which can be used by clients to reach this container.

Return Value

string

at line 47
AbstractId id()

A unique identifier for this Service.

Return Value

AbstractId

at line 56
array ports()

Retrieves the list of ports provided by the service.

Return Value

array

at line 67
ServiceId start()

Start the service and wait for its health checks to succeed.

Services bound to a Container do not need to be manually started.

Return Value

ServiceId

at line 76
ServiceId stop(bool|null $kill = false)

Stop the service.

Parameters

bool|null $kill

Return Value

ServiceId

at line 88
void up(array|null $ports = null, bool|null $random = false)

Creates a tunnel that forwards traffic from the caller's network to this service.

Parameters

array|null $ports
bool|null $random

Return Value

void

at line 103
Service withHostname(string $hostname)

Configures a hostname which can be used by clients within the session to reach this container.

Parameters

string $hostname

Return Value

Service