TypeScript SDK Reference
api/client.gen.Host
Information about the host environment.
Hierarchy
-
BaseClient
↳
Host
Constructors
constructor
new Host(parent?
, _id?
): Host
Constructor is used for internal usage only, do not create object from it.
Parameters
Name | Type |
---|---|
parent? | Object |
parent.ctx | Context |
parent.queryTree? | QueryTree [] |
_id? | HostID |
Returns
Overrides
BaseClient.constructor
Properties
_id
Private
Optional
Readonly
_id: HostID
= undefined
Methods
directory
directory(path
, opts?
): Directory
Accesses a directory on the host.
Parameters
Name | Type | Description |
---|---|---|
path | string | Location of the directory to access (e.g., "."). |
opts? | HostDirectoryOpts | - |
Returns
file
file(path
): File
Accesses a file on the host.
Parameters
Name | Type | Description |
---|---|---|
path | string | Location of the file to retrieve (e.g., "README.md"). |
Returns
id
id(): Promise
<HostID
>
A unique identifier for this Host.
Returns
Promise
<HostID
>
service
service(opts?
): Service
Creates a service that forwards traffic to a specified address via the host.
Parameters
Name | Type |
---|---|
opts? | HostServiceOpts |
Returns
setSecretFile
setSecretFile(name
, path
): Secret
Sets a secret given a user-defined name and the file path on the host, and returns the secret.
The file is limited to a size of 512000 bytes.
Parameters
Name | Type | Description |
---|---|---|
name | string | The user defined name for this secret. |
path | string | Location of the file to set as a secret. |
Returns
tunnel
tunnel(service
, opts?
): Service
Creates a tunnel that forwards traffic from the host to a service.
Parameters
Name | Type | Description |
---|---|---|
service | Service | Service to send traffic from the tunnel. |
opts? | HostTunnelOpts | - |
Returns
unixSocket
unixSocket(path
): Socket
Accesses a Unix socket on the host.
Parameters
Name | Type | Description |
---|---|---|
path | string | Location of the Unix socket (e.g., "/var/run/docker.sock"). |