< Summary - Kestrun — Combined Coverage

Information
Class: Public.Server.Add-KrListenUnixSocket
Assembly: Kestrun.PowerShell.Public
File(s): /home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Server/Add-KrListenUnixSocket.ps1
Tag: Kestrun/Kestrun@2d87023b37eb91155071c91dd3d6a2eeb3004705
Line coverage
0%
Covered lines: 0
Uncovered lines: 6
Coverable lines: 6
Total lines: 50
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Coverage history

Coverage history 0 25 50 75 100 09/08/2025 - 20:34:03 Line coverage: 0% (0/8) Total lines: 52 Tag: Kestrun/Kestrun@3790ee5884494a7a2a829344a47743e0bf492e7209/09/2025 - 05:44:24 Line coverage: 0% (0/8) Total lines: 53 Tag: Kestrun/Kestrun@a26a91936c400a7f2324671b2222643fb772438110/13/2025 - 16:52:37 Line coverage: 0% (0/6) Total lines: 50 Tag: Kestrun/Kestrun@10d476bee71c71ad215bb8ab59f219887b5b4a5e

Metrics

File(s)

/home/runner/work/Kestrun/Kestrun/src/PowerShell/Kestrun/Public/Server/Add-KrListenUnixSocket.ps1

#LineLine coverage
 1<#
 2.SYNOPSIS
 3    Adds a Unix socket listener to a Kestrun server instance.
 4.DESCRIPTION
 5    This function adds a Unix socket listener to the specified Kestrun server instance, allowing it to listen for incomi
 6.PARAMETER Server
 7    The Kestrun server instance to which the Unix socket listener will be added. This parameter is optional and can be p
 8.PARAMETER SocketPath
 9    The path of the Unix domain socket on which the server will listen for incoming requests. This parameter is mandator
 10.PARAMETER PassThru
 11    If specified, the cmdlet will return the modified server instance after adding the Unix socket listener
 12.EXAMPLE
 13    Add-KrListenUnixSocket -Server $server -SocketPath "/tmp/mysocket"
 14    Adds a Unix socket listener with the specified path to the given Kestrun server instance.
 15.NOTES
 16    This function is designed to be used in the context of a Kestrun server setup and allows for flexible configuration 
 17    The Unix socket listener will be added to the server's options and will be used when the server is started to listen
 18#>
 19function Add-KrListenUnixSocket {
 20    [KestrunRuntimeApi('Definition')]
 21    [CmdletBinding(defaultParameterSetName = 'NoCert')]
 22    [OutputType([Kestrun.Hosting.KestrunHost])]
 23    param(
 24        [Parameter(Mandatory = $false, ValueFromPipeline = $true)]
 25        [Kestrun.Hosting.KestrunHost]$Server,
 26
 27        [Parameter(Mandatory = $true)]
 28        [string]$SocketPath,
 29
 30        [Parameter()]
 31        [switch]$PassThru
 32    )
 33    begin {
 034        if (-not $IsWindows) {
 035            Write-Warning 'This function is for Windows Operating Systems only, as named pipes are not supported nativel
 36        }
 37        # Ensure the server instance is resolved
 038        $Server = Resolve-KestrunServer -Server $Server
 39    }
 40    process {
 41        # Add the Unix socket listener to the server options
 042        $Server.Options.ListenUnixSockets.Add($SocketPath)
 43
 044        if ($PassThru.IsPresent) {
 45            # Return the modified server instance
 046            return $Server
 47        }
 48    }
 49}
 50

Methods/Properties

Add-KrListenUnixSocket()