the-moby-effect
Version:
Moby/Docker API client built using effect-ts
29 lines (26 loc) • 1.04 kB
text/typescript
import * as Schema from "effect/Schema";
import * as MobyNumber from "../schemas/number.ts";
export class SwarmPortConfig extends Schema.Class<SwarmPortConfig>("SwarmPortConfig")(
{
Name: Schema.optional(Schema.String),
Protocol: Schema.optional(Schema.Literals(["tcp", "udp", "sctp"])),
TargetPort: Schema.optional(
MobyNumber.NumberFromWireString.check(
Schema.isInt(),
Schema.isBetween({ minimum: 0, maximum: 2 ** 32 - 1 })
)
),
PublishedPort: Schema.optional(
MobyNumber.NumberFromWireString.check(
Schema.isInt(),
Schema.isBetween({ minimum: 0, maximum: 2 ** 32 - 1 })
)
),
PublishMode: Schema.optional(Schema.Literals(["ingress", "host"])),
},
{
identifier: "SwarmPortConfig",
title: "swarm.PortConfig",
documentation: "https://pkg.go.dev/github.com/docker/docker@v28.4.0+incompatible/api/types/swarm#PortConfig",
}
) {}