NfsServer.ts overview

Models and constructors for the experimental NFSv4.1 server.

The server exports one live @effect-vfs/core volume over NFSv4.1 so that ordinary NFS clients can mount a virtual filesystem. It implements the supported read-only operations. Writable operation dispatch requires an explicit option and a volume that reports power-loss durability.

Since v0.1.0


errors

ConfigurationError (class)

Raised when a server option fails validation before the server starts.

The option field names the rejected configuration key.

Signature

declare class ConfigurationError

Source

Since v0.1.0

NfsServerError (class)

Raised when the NFS server cannot start or cannot continue listening.

Signature

declare class NfsServerError

Source

Since v0.1.0

models

LoopbackHost (type alias)

A literal IPv4 or IPv6 loopback address.

Signature

export type LoopbackHost = "127.0.0.1" | "::1"

Source

Since v0.1.0

NfsCredential (type alias)

RPC identity claims. They grant no authority until the application policy maps them.

Signature

type NfsCredential =
  | { readonly flavor: "none" }
  | {
      readonly flavor: "sys"
      readonly uid: number
      readonly gid: number
      readonly groups: ReadonlyArray<number>
      readonly machineName: string
    }

Source

Since v0.1.0

NfsIdentityPolicy (type alias)

A policy returns an identity for this volume or null to deny the request.

Signature

type NfsIdentityPolicy = (request: {
  readonly credential: NfsCredential
  readonly peer: NfsPeer
}) => NonNullable<Vfs.RootCallerOptions["identity"]> | null

Source

Since v0.1.0

NfsPeer (type alias)

Peer details from the transport; UNIX sockets do not expose a client IP or port.

Signature

type NfsPeer =
  | { readonly transport: "tcp"; readonly address: string; readonly port: number }
  | { readonly transport: "unix"; readonly address: null; readonly port: null; readonly path: string }

Source

Since v0.1.0

NfsServerAddress (type alias)

The bound server address.

Signature

export type NfsServerAddress =
  { readonly host: string; readonly port: number } | { readonly path: string }

Source

Since v0.1.0

NfsServerConfig (type alias)

Complete server configuration.

Signature

export type NfsServerConfig = {
  readonly leaseDurationSeconds: number
  readonly callbackTimeoutSeconds: number
  readonly limits: {
    readonly maxConnections: number
    readonly maxFragmentBytes: ByteSize.ByteSize
    readonly maxRecordBytes: ByteSize.ByteSize
    readonly maxFragmentsPerRecord: number
    readonly maxOpaqueBytes: ByteSize.ByteSize
    readonly maxStringBytes: ByteSize.ByteSize
    readonly maxArrayElements: number
    readonly maxAuthBytes: ByteSize.ByteSize
    readonly maxMachineNameBytes: ByteSize.ByteSize
    readonly maxSupplementaryGroups: number
    readonly maxCompoundBytes: ByteSize.ByteSize
    readonly maxOperations: number
    readonly maxBitmapWords: number
    readonly maxClients: number
    readonly maxIdentities: number
    readonly maxPendingClientReplacements: number
    readonly maxSessions: number
    readonly maxSlotsPerSession: number
    readonly maxReplayBytes: ByteSize.ByteSize
    readonly maxOpens: number
    readonly maxLockOwners: number
    readonly maxLocks: number
    readonly maxOwnerBytes: ByteSize.ByteSize
    readonly maxReadBytes: ByteSize.ByteSize
    readonly maxWriteBytes: ByteSize.ByteSize
    readonly maxReaddirEntries: number
    readonly maxReaddirReplyBytes: ByteSize.ByteSize
    readonly maxNameBytes: ByteSize.ByteSize
  }
}

Source

Since v0.1.0

NfsServerConfigOverrides (type alias)

Optional configuration accepted when constructing an NFS server.

Signature

export type NfsServerConfigOverrides = {
  readonly leaseDurationSeconds?: number
  readonly callbackTimeoutSeconds?: number
  readonly limits?: {
    readonly maxConnections?: number
    readonly maxFragmentBytes?: ByteSize.ByteSize
    readonly maxRecordBytes?: ByteSize.ByteSize
    readonly maxFragmentsPerRecord?: number
    readonly maxOpaqueBytes?: ByteSize.ByteSize
    readonly maxStringBytes?: ByteSize.ByteSize
    readonly maxArrayElements?: number
    readonly maxAuthBytes?: ByteSize.ByteSize
    readonly maxMachineNameBytes?: ByteSize.ByteSize
    readonly maxSupplementaryGroups?: number
    readonly maxCompoundBytes?: ByteSize.ByteSize
    readonly maxOperations?: number
    readonly maxBitmapWords?: number
    readonly maxClients?: number
    readonly maxIdentities?: number
    readonly maxPendingClientReplacements?: number
    readonly maxSessions?: number
    readonly maxSlotsPerSession?: number
    readonly maxReplayBytes?: ByteSize.ByteSize
    readonly maxOpens?: number
    readonly maxLockOwners?: number
    readonly maxLocks?: number
    readonly maxOwnerBytes?: ByteSize.ByteSize
    readonly maxReadBytes?: ByteSize.ByteSize
    readonly maxWriteBytes?: ByteSize.ByteSize
    readonly maxReaddirEntries?: number
    readonly maxReaddirReplyBytes?: ByteSize.ByteSize
    readonly maxNameBytes?: ByteSize.ByteSize
  }
}

Source

Since v0.1.0

NfsServerLimitOverrides (type alias)

A selective override of the default NFS server resource policy.

Signature

export type NfsServerLimitOverrides = {
  readonly maxConnections?: number
  readonly maxFragmentBytes?: ByteSize.ByteSize
  readonly maxRecordBytes?: ByteSize.ByteSize
  readonly maxFragmentsPerRecord?: number
  readonly maxOpaqueBytes?: ByteSize.ByteSize
  readonly maxStringBytes?: ByteSize.ByteSize
  readonly maxArrayElements?: number
  readonly maxAuthBytes?: ByteSize.ByteSize
  readonly maxMachineNameBytes?: ByteSize.ByteSize
  readonly maxSupplementaryGroups?: number
  readonly maxCompoundBytes?: ByteSize.ByteSize
  readonly maxOperations?: number
  readonly maxBitmapWords?: number
  readonly maxClients?: number
  readonly maxIdentities?: number
  readonly maxPendingClientReplacements?: number
  readonly maxSessions?: number
  readonly maxSlotsPerSession?: number
  readonly maxReplayBytes?: ByteSize.ByteSize
  readonly maxOpens?: number
  readonly maxLockOwners?: number
  readonly maxLocks?: number
  readonly maxOwnerBytes?: ByteSize.ByteSize
  readonly maxReadBytes?: ByteSize.ByteSize
  readonly maxWriteBytes?: ByteSize.ByteSize
  readonly maxReaddirEntries?: number
  readonly maxReaddirReplyBytes?: ByteSize.ByteSize
  readonly maxNameBytes?: ByteSize.ByteSize
}

Source

Since v0.1.0

NfsServerLimits (type alias)

Every resource bound enforced by the preview server.

Signature

export type NfsServerLimits = {
  readonly maxConnections: number
  readonly maxFragmentBytes: ByteSize.ByteSize
  readonly maxRecordBytes: ByteSize.ByteSize
  readonly maxFragmentsPerRecord: number
  readonly maxOpaqueBytes: ByteSize.ByteSize
  readonly maxStringBytes: ByteSize.ByteSize
  readonly maxArrayElements: number
  readonly maxAuthBytes: ByteSize.ByteSize
  readonly maxMachineNameBytes: ByteSize.ByteSize
  readonly maxSupplementaryGroups: number
  readonly maxCompoundBytes: ByteSize.ByteSize
  readonly maxOperations: number
  readonly maxBitmapWords: number
  readonly maxClients: number
  readonly maxIdentities: number
  readonly maxPendingClientReplacements: number
  readonly maxSessions: number
  readonly maxSlotsPerSession: number
  readonly maxReplayBytes: ByteSize.ByteSize
  readonly maxOpens: number
  readonly maxLockOwners: number
  readonly maxLocks: number
  readonly maxOwnerBytes: ByteSize.ByteSize
  readonly maxReadBytes: ByteSize.ByteSize
  readonly maxWriteBytes: ByteSize.ByteSize
  readonly maxReaddirEntries: number
  readonly maxReaddirReplyBytes: ByteSize.ByteSize
  readonly maxNameBytes: ByteSize.ByteSize
}

Source

Since v0.1.0

NfsServerLocalOptions (type alias)

Validated configuration paired with the live volume and caller capabilities.

Signature

type NfsServerLocalOptions = NfsServerConfigOverrides & {
  readonly volume: Vfs.Volume
  readonly caller: Vfs.Caller
  readonly writable?: never
  readonly policy?: never
  readonly peer?: never
  readonly allowNonLoopback?: never
  readonly acceptedFlavors?: never
}

Source

Since v0.1.0

NfsServerNetworkTcpAddress (type alias)

A TCP address that may be reachable beyond the local host.

Signature

export type NfsServerNetworkTcpAddress = { readonly host: string; readonly port: number }

Source

Since v0.1.0

NfsServerNetworkedOptions (type alias)

Network server configuration with application-supplied identity and peer policies.

Signature

type NfsServerNetworkedOptions = NfsServerConfigOverrides & {
  readonly volume: Vfs.Volume
  /** Enable mutations only for a volume qualified to survive power loss. */
  readonly writable?: true
  readonly policy: NfsIdentityPolicy
  /** Evaluated in each accepted socket's context; null closes a connection without a trustworthy peer. */
  readonly peer: Effect.Effect<NfsPeer | null>
  /** Required when the supplied socket server binds outside loopback. */
  readonly allowNonLoopback?: true
  /** Flavors advertised by SECINFO; defaults to AUTH_SYS only. */
  readonly acceptedFlavors?: ReadonlyArray<"sys" | "none">
  readonly caller?: never
}

Source

Since v0.1.0

NfsServerOptions (type alias)

Configuration for a local caller or an application-authenticated network server.

Signature

type NfsServerOptions = NfsServerLocalOptions | NfsServerNetworkedOptions

Source

Since v0.1.0

NfsServerTcpAddress (type alias)

A bound loopback TCP address.

Signature

export type NfsServerTcpAddress = { readonly host: "127.0.0.1" | "::1"; readonly port: number }

Source

Since v0.1.0

NfsServerUnixAddress (type alias)

A bound UNIX-domain socket path.

Signature

export type NfsServerUnixAddress = { readonly path: string }

Source

Since v0.1.0

Port (type alias)

A TCP port, including 0 for an ephemeral port.

Signature

export type Port = number

Source

Since v0.1.0

schemas

LoopbackHost

Schema for a literal IPv4 or IPv6 loopback address.

Signature

declare const LoopbackHost: Schema.Literals<readonly ["127.0.0.1", "::1"]>

Source

Since v0.1.0

NfsServerAddress

Schema for the bound server address: TCP or a UNIX-domain socket path.

Signature

declare const NfsServerAddress: Schema.Union<
  readonly [
    Schema.Struct<{ readonly host: Schema.NonEmptyString; readonly port: Schema.Finite }>,
    Schema.Struct<{ readonly path: Schema.NonEmptyString }>
  ]
>

Source

Since v0.1.0

NfsServerConfig

Complete server configuration schema with a frozen default policy.

Signature

declare const NfsServerConfig: Schema.Struct<{
  readonly leaseDurationSeconds: Schema.Finite
  readonly callbackTimeoutSeconds: Schema.Finite
  readonly limits: Schema.Struct<{
    readonly maxConnections: Schema.Finite
    readonly maxFragmentBytes: Schema.ByteSize
    readonly maxRecordBytes: Schema.ByteSize
    readonly maxFragmentsPerRecord: Schema.Finite
    readonly maxOpaqueBytes: Schema.ByteSize
    readonly maxStringBytes: Schema.ByteSize
    readonly maxArrayElements: Schema.Finite
    readonly maxAuthBytes: Schema.ByteSize
    readonly maxMachineNameBytes: Schema.ByteSize
    readonly maxSupplementaryGroups: Schema.Finite
    readonly maxCompoundBytes: Schema.ByteSize
    readonly maxOperations: Schema.Finite
    readonly maxBitmapWords: Schema.Finite
    readonly maxClients: Schema.Finite
    readonly maxIdentities: Schema.Finite
    readonly maxPendingClientReplacements: Schema.Finite
    readonly maxSessions: Schema.Finite
    readonly maxSlotsPerSession: Schema.Finite
    readonly maxReplayBytes: Schema.ByteSize
    readonly maxOpens: Schema.Finite
    readonly maxLockOwners: Schema.Finite
    readonly maxLocks: Schema.Finite
    readonly maxOwnerBytes: Schema.ByteSize
    readonly maxReadBytes: Schema.ByteSize
    readonly maxWriteBytes: Schema.ByteSize
    readonly maxReaddirEntries: Schema.Finite
    readonly maxReaddirReplyBytes: Schema.ByteSize
    readonly maxNameBytes: Schema.ByteSize
  }> & {
    constrained: {
      readonly maxConnections: number
      readonly maxFragmentBytes: ByteSize.ByteSize
      readonly maxRecordBytes: ByteSize.ByteSize
      readonly maxFragmentsPerRecord: number
      readonly maxOpaqueBytes: ByteSize.ByteSize
      readonly maxStringBytes: ByteSize.ByteSize
      readonly maxArrayElements: number
      readonly maxAuthBytes: ByteSize.ByteSize
      readonly maxMachineNameBytes: ByteSize.ByteSize
      readonly maxSupplementaryGroups: number
      readonly maxCompoundBytes: ByteSize.ByteSize
      readonly maxOperations: number
      readonly maxBitmapWords: number
      readonly maxClients: number
      readonly maxIdentities: number
      readonly maxPendingClientReplacements: number
      readonly maxSessions: number
      readonly maxSlotsPerSession: number
      readonly maxReplayBytes: ByteSize.ByteSize
      readonly maxOpens: number
      readonly maxLockOwners: number
      readonly maxLocks: number
      readonly maxOwnerBytes: ByteSize.ByteSize
      readonly maxReadBytes: ByteSize.ByteSize
      readonly maxWriteBytes: ByteSize.ByteSize
      readonly maxReaddirEntries: number
      readonly maxReaddirReplyBytes: ByteSize.ByteSize
      readonly maxNameBytes: ByteSize.ByteSize
    }
    default: {
      readonly maxConnections: number
      readonly maxFragmentBytes: ByteSize.ByteSize
      readonly maxRecordBytes: ByteSize.ByteSize
      readonly maxFragmentsPerRecord: number
      readonly maxOpaqueBytes: ByteSize.ByteSize
      readonly maxStringBytes: ByteSize.ByteSize
      readonly maxArrayElements: number
      readonly maxAuthBytes: ByteSize.ByteSize
      readonly maxMachineNameBytes: ByteSize.ByteSize
      readonly maxSupplementaryGroups: number
      readonly maxCompoundBytes: ByteSize.ByteSize
      readonly maxOperations: number
      readonly maxBitmapWords: number
      readonly maxClients: number
      readonly maxIdentities: number
      readonly maxPendingClientReplacements: number
      readonly maxSessions: number
      readonly maxSlotsPerSession: number
      readonly maxReplayBytes: ByteSize.ByteSize
      readonly maxOpens: number
      readonly maxLockOwners: number
      readonly maxLocks: number
      readonly maxOwnerBytes: ByteSize.ByteSize
      readonly maxReadBytes: ByteSize.ByteSize
      readonly maxWriteBytes: ByteSize.ByteSize
      readonly maxReaddirEntries: number
      readonly maxReaddirReplyBytes: ByteSize.ByteSize
      readonly maxNameBytes: ByteSize.ByteSize
    }
  }
}> & {
  default: {
    readonly leaseDurationSeconds: number
    readonly callbackTimeoutSeconds: number
    readonly limits: {
      readonly maxConnections: number
      readonly maxFragmentBytes: ByteSize.ByteSize
      readonly maxRecordBytes: ByteSize.ByteSize
      readonly maxFragmentsPerRecord: number
      readonly maxOpaqueBytes: ByteSize.ByteSize
      readonly maxStringBytes: ByteSize.ByteSize
      readonly maxArrayElements: number
      readonly maxAuthBytes: ByteSize.ByteSize
      readonly maxMachineNameBytes: ByteSize.ByteSize
      readonly maxSupplementaryGroups: number
      readonly maxCompoundBytes: ByteSize.ByteSize
      readonly maxOperations: number
      readonly maxBitmapWords: number
      readonly maxClients: number
      readonly maxIdentities: number
      readonly maxPendingClientReplacements: number
      readonly maxSessions: number
      readonly maxSlotsPerSession: number
      readonly maxReplayBytes: ByteSize.ByteSize
      readonly maxOpens: number
      readonly maxLockOwners: number
      readonly maxLocks: number
      readonly maxOwnerBytes: ByteSize.ByteSize
      readonly maxReadBytes: ByteSize.ByteSize
      readonly maxWriteBytes: ByteSize.ByteSize
      readonly maxReaddirEntries: number
      readonly maxReaddirReplyBytes: ByteSize.ByteSize
      readonly maxNameBytes: ByteSize.ByteSize
    }
  }
}

Source

Since v0.1.0

NfsServerConfigOverrides

Optional configuration accepted when constructing an NFS server.

Signature

declare const NfsServerConfigOverrides: Schema.Struct<{
  readonly leaseDurationSeconds: Schema.optionalKey<Schema.Finite>
  readonly callbackTimeoutSeconds: Schema.optionalKey<Schema.Finite>
  readonly limits: Schema.optionalKey<
    Schema.Struct<{
      readonly maxConnections: Schema.optionalKey<Schema.Finite>
      readonly maxFragmentBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxRecordBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxFragmentsPerRecord: Schema.optionalKey<Schema.Finite>
      readonly maxOpaqueBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxStringBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxArrayElements: Schema.optionalKey<Schema.Finite>
      readonly maxAuthBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxMachineNameBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxSupplementaryGroups: Schema.optionalKey<Schema.Finite>
      readonly maxCompoundBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxOperations: Schema.optionalKey<Schema.Finite>
      readonly maxBitmapWords: Schema.optionalKey<Schema.Finite>
      readonly maxClients: Schema.optionalKey<Schema.Finite>
      readonly maxIdentities: Schema.optionalKey<Schema.Finite>
      readonly maxPendingClientReplacements: Schema.optionalKey<Schema.Finite>
      readonly maxSessions: Schema.optionalKey<Schema.Finite>
      readonly maxSlotsPerSession: Schema.optionalKey<Schema.Finite>
      readonly maxReplayBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxOpens: Schema.optionalKey<Schema.Finite>
      readonly maxLockOwners: Schema.optionalKey<Schema.Finite>
      readonly maxLocks: Schema.optionalKey<Schema.Finite>
      readonly maxOwnerBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxReadBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxWriteBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxReaddirEntries: Schema.optionalKey<Schema.Finite>
      readonly maxReaddirReplyBytes: Schema.optionalKey<Schema.ByteSize>
      readonly maxNameBytes: Schema.optionalKey<Schema.ByteSize>
    }>
  >
}>

Source

Since v0.1.0

NfsServerLimitOverrides

Schema for selectively overriding the default NFS server resource policy.

Signature

declare const NfsServerLimitOverrides: Schema.Struct<{
  readonly maxConnections: Schema.optionalKey<Schema.Finite>
  readonly maxFragmentBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxRecordBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxFragmentsPerRecord: Schema.optionalKey<Schema.Finite>
  readonly maxOpaqueBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxStringBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxArrayElements: Schema.optionalKey<Schema.Finite>
  readonly maxAuthBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxMachineNameBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxSupplementaryGroups: Schema.optionalKey<Schema.Finite>
  readonly maxCompoundBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxOperations: Schema.optionalKey<Schema.Finite>
  readonly maxBitmapWords: Schema.optionalKey<Schema.Finite>
  readonly maxClients: Schema.optionalKey<Schema.Finite>
  readonly maxIdentities: Schema.optionalKey<Schema.Finite>
  readonly maxPendingClientReplacements: Schema.optionalKey<Schema.Finite>
  readonly maxSessions: Schema.optionalKey<Schema.Finite>
  readonly maxSlotsPerSession: Schema.optionalKey<Schema.Finite>
  readonly maxReplayBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxOpens: Schema.optionalKey<Schema.Finite>
  readonly maxLockOwners: Schema.optionalKey<Schema.Finite>
  readonly maxLocks: Schema.optionalKey<Schema.Finite>
  readonly maxOwnerBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxReadBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxWriteBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxReaddirEntries: Schema.optionalKey<Schema.Finite>
  readonly maxReaddirReplyBytes: Schema.optionalKey<Schema.ByteSize>
  readonly maxNameBytes: Schema.optionalKey<Schema.ByteSize>
}>

Source

Since v0.1.0

NfsServerLimits

Schema for every resource bound enforced by the preview server, with frozen presets.

Signature

declare const NfsServerLimits: Schema.Struct<{
  readonly maxConnections: Schema.Finite
  readonly maxFragmentBytes: Schema.ByteSize
  readonly maxRecordBytes: Schema.ByteSize
  readonly maxFragmentsPerRecord: Schema.Finite
  readonly maxOpaqueBytes: Schema.ByteSize
  readonly maxStringBytes: Schema.ByteSize
  readonly maxArrayElements: Schema.Finite
  readonly maxAuthBytes: Schema.ByteSize
  readonly maxMachineNameBytes: Schema.ByteSize
  readonly maxSupplementaryGroups: Schema.Finite
  readonly maxCompoundBytes: Schema.ByteSize
  readonly maxOperations: Schema.Finite
  readonly maxBitmapWords: Schema.Finite
  readonly maxClients: Schema.Finite
  readonly maxIdentities: Schema.Finite
  readonly maxPendingClientReplacements: Schema.Finite
  readonly maxSessions: Schema.Finite
  readonly maxSlotsPerSession: Schema.Finite
  readonly maxReplayBytes: Schema.ByteSize
  readonly maxOpens: Schema.Finite
  readonly maxLockOwners: Schema.Finite
  readonly maxLocks: Schema.Finite
  readonly maxOwnerBytes: Schema.ByteSize
  readonly maxReadBytes: Schema.ByteSize
  readonly maxWriteBytes: Schema.ByteSize
  readonly maxReaddirEntries: Schema.Finite
  readonly maxReaddirReplyBytes: Schema.ByteSize
  readonly maxNameBytes: Schema.ByteSize
}> & {
  constrained: {
    readonly maxConnections: number
    readonly maxFragmentBytes: ByteSize.ByteSize
    readonly maxRecordBytes: ByteSize.ByteSize
    readonly maxFragmentsPerRecord: number
    readonly maxOpaqueBytes: ByteSize.ByteSize
    readonly maxStringBytes: ByteSize.ByteSize
    readonly maxArrayElements: number
    readonly maxAuthBytes: ByteSize.ByteSize
    readonly maxMachineNameBytes: ByteSize.ByteSize
    readonly maxSupplementaryGroups: number
    readonly maxCompoundBytes: ByteSize.ByteSize
    readonly maxOperations: number
    readonly maxBitmapWords: number
    readonly maxClients: number
    readonly maxIdentities: number
    readonly maxPendingClientReplacements: number
    readonly maxSessions: number
    readonly maxSlotsPerSession: number
    readonly maxReplayBytes: ByteSize.ByteSize
    readonly maxOpens: number
    readonly maxLockOwners: number
    readonly maxLocks: number
    readonly maxOwnerBytes: ByteSize.ByteSize
    readonly maxReadBytes: ByteSize.ByteSize
    readonly maxWriteBytes: ByteSize.ByteSize
    readonly maxReaddirEntries: number
    readonly maxReaddirReplyBytes: ByteSize.ByteSize
    readonly maxNameBytes: ByteSize.ByteSize
  }
  default: {
    readonly maxConnections: number
    readonly maxFragmentBytes: ByteSize.ByteSize
    readonly maxRecordBytes: ByteSize.ByteSize
    readonly maxFragmentsPerRecord: number
    readonly maxOpaqueBytes: ByteSize.ByteSize
    readonly maxStringBytes: ByteSize.ByteSize
    readonly maxArrayElements: number
    readonly maxAuthBytes: ByteSize.ByteSize
    readonly maxMachineNameBytes: ByteSize.ByteSize
    readonly maxSupplementaryGroups: number
    readonly maxCompoundBytes: ByteSize.ByteSize
    readonly maxOperations: number
    readonly maxBitmapWords: number
    readonly maxClients: number
    readonly maxIdentities: number
    readonly maxPendingClientReplacements: number
    readonly maxSessions: number
    readonly maxSlotsPerSession: number
    readonly maxReplayBytes: ByteSize.ByteSize
    readonly maxOpens: number
    readonly maxLockOwners: number
    readonly maxLocks: number
    readonly maxOwnerBytes: ByteSize.ByteSize
    readonly maxReadBytes: ByteSize.ByteSize
    readonly maxWriteBytes: ByteSize.ByteSize
    readonly maxReaddirEntries: number
    readonly maxReaddirReplyBytes: ByteSize.ByteSize
    readonly maxNameBytes: ByteSize.ByteSize
  }
}

Source

Since v0.1.0

NfsServerNetworkTcpAddress

Schema for a TCP address that may be reachable beyond the local host.

Signature

declare const NfsServerNetworkTcpAddress: Schema.Struct<{
  readonly host: Schema.NonEmptyString
  readonly port: Schema.Finite
}>

Source

Since v0.1.0

NfsServerTcpAddress

Schema for a bound loopback TCP address.

Signature

declare const NfsServerTcpAddress: Schema.Struct<{
  readonly host: Schema.Literals<readonly ["127.0.0.1", "::1"]>
  readonly port: Schema.Finite
}>

Source

Since v0.1.0

NfsServerUnixAddress

Schema for a bound UNIX-domain socket path. A filesystem socket is reachable only from the same host, so it counts as a local address alongside loopback TCP.

Signature

declare const NfsServerUnixAddress: Schema.Struct<{ readonly path: Schema.NonEmptyString }>

Source

Since v0.1.0

Port

Schema for a TCP port, including 0 for an ephemeral port.

Signature

declare const Port: Schema.Finite

Source

Since v0.1.0

services

NfsServer (class)

The running NFS server and its bound address.

Successful construction starts the scoped listener. Wait on awaitTermination while the scope is open to observe a listener failure as NfsServerError. The wait returns normally after scope shutdown interrupts the listener. Interrupting a wait leaves the listener running.

Example

import { NfsServer } from "@effect-vfs/nfs/NfsServer"
import * as Vfs from "@effect-vfs/core/VirtualFileSystem"
import * as Effect from "effect/Effect"
 
const serve = Effect.scoped(
  Effect.gen(function* () {
    const volume = yield* Vfs.make()
    const caller = yield* volume.caller()
    const server = yield* NfsServer.make({ volume, caller })
    yield* server.awaitTermination
  })
)

Signature

declare class NfsServer

Source

Since v0.1.0