the-moby-effect
Version:
Moby/Docker API client built using effect-ts
175 lines • 8.84 kB
TypeScript
import type * as HttpBody from "@effect/platform/HttpBody";
import type * as HttpClientError from "@effect/platform/HttpClientError";
import type * as Layer from "effect/Layer";
import type * as ParseResult from "effect/ParseResult";
import * as HttpClient from "@effect/platform/HttpClient";
import * as Socket from "@effect/platform/Socket";
import * as Effect from "effect/Effect";
import * as Stream from "effect/Stream";
import * as MobyDemux from "../../MobyDemux.js";
import { ContainerChange, ContainerConfig, ContainerCreateRequest, ContainerCreateResponse, ContainerInspectResponse, ContainerListResponseItem, ContainerPruneResponse, ContainerStatsResponse, ContainerTopResponse, ContainerUpdateResponse, ContainerWaitResponse } from "../generated/index.js";
/**
* @since 1.0.0
* @category Errors
*/
export declare const ContainersErrorTypeId: unique symbol;
/**
* @since 1.0.0
* @category Errors
*/
export type ContainersErrorTypeId = typeof ContainersErrorTypeId;
/**
* @since 1.0.0
* @category Errors
*/
export declare const isContainersError: (u: unknown) => u is ContainersError;
declare const ContainersError_base: new <A extends Record<string, any>>(args: import("effect/Types").Simplify<A>) => import("effect/Cause").YieldableError & Record<typeof ContainersErrorTypeId, typeof ContainersErrorTypeId> & {
readonly _tag: "ContainersError";
} & Readonly<A>;
/**
* @since 1.0.0
* @category Errors
*/
export declare class ContainersError extends ContainersError_base<{
method: string;
cause: ParseResult.ParseError | HttpClientError.HttpClientError | HttpBody.HttpBodyError | Socket.SocketError | unknown;
}> {
get message(): string;
}
declare const Containers_base: Effect.Service.Class<Containers, "@the-moby-effect/endpoints/Containers", {
readonly accessors: false;
readonly dependencies: readonly [];
readonly effect: Effect.Effect<{
list: (options?: {
readonly all?: boolean | undefined;
readonly limit?: number | undefined;
readonly size?: boolean | undefined;
readonly filters?: {
ancestor?: string | undefined;
before?: string | undefined;
expose?: `${number}/${string}` | `${number}-${number}/${string}` | undefined;
exited?: number | undefined;
health?: "starting" | "healthy" | "unhealthy" | "none" | undefined;
id?: string | undefined;
isolation?: "default" | "process" | "hyperv" | undefined;
"is-task"?: true | false | undefined;
label?: Record<string, string> | undefined;
name?: string | undefined;
network?: string | undefined;
publish?: `${number}/${string}` | `${number}-${number}/${string}` | undefined;
since?: string | undefined;
status?: "created" | "restarting" | "running" | "removing" | "paused" | "exited" | "dead" | undefined;
volume?: string | undefined;
} | undefined;
} | undefined) => Effect.Effect<ReadonlyArray<ContainerListResponseItem>, ContainersError, never>;
create: (options: {
readonly name?: string | undefined;
readonly platform?: string | undefined;
readonly spec: typeof ContainerCreateRequest.Encoded;
}) => Effect.Effect<ContainerCreateResponse, ContainersError, never>;
inspect: (id: string, options?: {
readonly size?: boolean | undefined;
} | undefined) => Effect.Effect<ContainerInspectResponse, ContainersError, never>;
top: (id: string, options?: {
readonly ps_args?: string | undefined;
} | undefined) => Effect.Effect<ContainerTopResponse, ContainersError, never>;
logs: (id: string, options?: {
readonly follow?: boolean | undefined;
readonly stdout?: boolean | undefined;
readonly stderr?: boolean | undefined;
readonly since?: number | undefined;
readonly until?: number | undefined;
readonly timestamps?: boolean | undefined;
readonly tail?: string | undefined;
} | undefined) => Stream.Stream<string, ContainersError, never>;
changes: (id: string) => Effect.Effect<ReadonlyArray<ContainerChange> | null, ContainersError>;
export: (id: string) => Stream.Stream<Uint8Array, ContainersError, never>;
stats: (id: string, options?: {
readonly stream?: boolean | undefined;
readonly "one-shot"?: boolean | undefined;
} | undefined) => Stream.Stream<ContainerStatsResponse, ContainersError, never>;
resize: (id: string, options?: {
readonly h?: number | undefined;
readonly w?: number | undefined;
} | undefined) => Effect.Effect<void, ContainersError, never>;
start: (id: string, options?: {
readonly detachKeys?: string | undefined;
} | undefined) => Effect.Effect<void, ContainersError, never>;
stop: (id: string, options?: {
readonly signal?: string | undefined;
readonly t?: number | undefined;
} | undefined) => Effect.Effect<void, ContainersError, never>;
restart: (id: string, options?: {
readonly signal?: string | undefined;
readonly t?: number | undefined;
} | undefined) => Effect.Effect<void, ContainersError, never>;
kill: (id: string, options?: {
readonly signal?: string | undefined;
} | undefined) => Effect.Effect<void, ContainersError, never>;
update: (id: string, options: {
readonly spec: ContainerConfig;
}) => Effect.Effect<ContainerUpdateResponse, ContainersError, never>;
rename: (id: string, options: {
readonly name: string;
}) => Effect.Effect<void, ContainersError, never>;
pause: (id: string) => Effect.Effect<void, ContainersError, never>;
unpause: (id: string) => Effect.Effect<void, ContainersError, never>;
attach: (id: string, options?: {
readonly detachKeys?: string | undefined;
readonly logs?: boolean | undefined;
readonly stream?: boolean | undefined;
readonly stdin?: boolean | undefined;
readonly stdout?: boolean | undefined;
readonly stderr?: boolean | undefined;
} | undefined) => Effect.Effect<MobyDemux.RawSocket | MobyDemux.MultiplexedSocket, ContainersError, never>;
attachWebsocket: (id: string, options?: {
readonly detachKeys?: string | undefined;
readonly logs?: boolean | undefined;
readonly stream?: boolean | undefined;
readonly stdin?: boolean | undefined;
readonly stdout?: boolean | undefined;
readonly stderr?: boolean | undefined;
} | undefined) => Effect.Effect<MobyDemux.RawSocket, ContainersError, never>;
wait: (id: string, options?: {
readonly condition?: string | undefined;
} | undefined) => Effect.Effect<ContainerWaitResponse, ContainersError, never>;
delete: (id: string, options?: {
readonly v?: boolean | undefined;
readonly force?: boolean | undefined;
readonly link?: boolean | undefined;
} | undefined) => Effect.Effect<void, ContainersError, never>;
archive: (id: string, options: {
readonly path: string;
}) => Stream.Stream<Uint8Array, ContainersError, never>;
archiveInfo: (id: string, options: {
readonly path: string;
}) => Effect.Effect<void, ContainersError, never>;
putArchive: <E1>(id: string, options: {
readonly path: string;
readonly noOverwriteDirNonDir?: string | undefined;
readonly copyUIDGID?: string | undefined;
readonly stream: Stream.Stream<Uint8Array, E1, never>;
}) => Effect.Effect<void, ContainersError, never>;
prune: (options?: {
readonly filters?: {
until?: string;
label?: Record<string, string> | undefined;
} | undefined;
} | undefined) => Effect.Effect<ContainerPruneResponse, ContainersError, never>;
}, never, HttpClient.HttpClient | Socket.WebSocketConstructor>;
}>;
/**
* @since 1.0.0
* @category Services
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Container
*/
export declare class Containers extends Containers_base {
}
/**
* @since 1.0.0
* @category Layers
* @see https://docs.docker.com/reference/api/engine/latest/#tag/Container
*/
export declare const ContainersLayer: Layer.Layer<Containers, never, HttpClient.HttpClient | Socket.WebSocketConstructor>;
export {};
//# sourceMappingURL=containers.d.ts.map