Dagger.Service (dagger v0.19.4)

View Source

A content-addressed service providing TCP connectivity.

Summary

Functions

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

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

A unique identifier for this Service.

Retrieves the list of ports provided by the service.

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

Forces evaluation of the pipeline in the engine.

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

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

Types

t()

@type t() :: %Dagger.Service{client: term(), query_builder: term()}

Functions

endpoint(service, optional_args \\ [])

@spec endpoint(t(), port: integer() | nil, scheme: String.t() | nil) ::
  {:ok, String.t()} | {:error, term()}

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.

hostname(service)

@spec hostname(t()) :: {:ok, String.t()} | {:error, term()}

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

id(service)

@spec id(t()) :: {:ok, Dagger.ServiceID.t()} | {:error, term()}

A unique identifier for this Service.

ports(service)

@spec ports(t()) :: {:ok, [Dagger.Port.t()]} | {:error, term()}

Retrieves the list of ports provided by the service.

start(service)

@spec start(t()) :: {:ok, t()} | {:error, term()}

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

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

stop(service, optional_args \\ [])

@spec stop(t(), [{:kill, boolean() | nil}]) :: {:ok, t()} | {:error, term()}

Stop the service.

sync(service)

@spec sync(t()) :: {:ok, t()} | {:error, term()}

Forces evaluation of the pipeline in the engine.

terminal(service, optional_args \\ [])

@spec terminal(t(), [{:cmd, [String.t()]}]) :: t()

up(service, optional_args \\ [])

@spec up(t(), ports: [Dagger.PortForward.t()], random: boolean() | nil) ::
  :ok | {:error, term()}

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

with_hostname(service, hostname)

@spec with_hostname(t(), String.t()) :: t()

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