Show / Hide Table of Contents

Class CommandLineMaintenanceInterfaceHost

Provides AMI in the form of the text commands with the syntax identical to OS shell commands.

Inheritance
object
Disposable
ApplicationMaintenanceInterfaceHost
CommandLineMaintenanceInterfaceHost
Implements
IDisposable
IHostedService
Inherited Members
ApplicationMaintenanceInterfaceHost.StartAsync(CancellationToken)
ApplicationMaintenanceInterfaceHost.StopAsync(CancellationToken)
ApplicationMaintenanceInterfaceHost.Backlog
ApplicationMaintenanceInterfaceHost.BufferSize
ApplicationMaintenanceInterfaceHost.ByteBufferAllocator
ApplicationMaintenanceInterfaceHost.CharBufferAllocator
ApplicationMaintenanceInterfaceHost.TextEncoding
Disposable.Dispose()
Disposable.Dispose(IEnumerable<IDisposable>)
Disposable.DisposeAsync(params IEnumerable<IAsyncDisposable>)
Disposable.Dispose<TDisposable>(params ReadOnlySpan<TDisposable>)
object.GetType()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: DotNext.Maintenance.CommandLine
Assembly: DotNext.MaintenanceServices.dll
Syntax
public sealed class CommandLineMaintenanceInterfaceHost : ApplicationMaintenanceInterfaceHost, IDisposable, IHostedService
Examples
echo "gc collect 2" | nc -U /path/to/endpoint.sock

Constructors

View Source

CommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint, IEnumerable<ApplicationMaintenanceCommand>, IAuthenticationHandler?, AuthorizationCallback?, ParserConfiguration?, ILoggerFactory?)

Initializes a new host.

Declaration
public CommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint endPoint, IEnumerable<ApplicationMaintenanceCommand> commands, IAuthenticationHandler? authentication = null, AuthorizationCallback? authorization = null, ParserConfiguration? configuration = null, ILoggerFactory? loggerFactory = null)
Parameters
Type Name Description
UnixDomainSocketEndPoint endPoint

Unix Domain Socket address used as a interaction point.

IEnumerable<ApplicationMaintenanceCommand> commands

A set of commands to be available for execution.

IAuthenticationHandler authentication

Optional authentication handler.

AuthorizationCallback authorization

A set of global authorization rules to be applied to all commands.

ParserConfiguration configuration

Command-line parser configuration.

ILoggerFactory loggerFactory

Optional logger factory.

Methods

View Source

ExecuteCommandAsync(IMaintenanceSession, ReadOnlyMemory<char>, CancellationToken)

Executes command asynchronously.

Declaration
protected override ValueTask ExecuteCommandAsync(IMaintenanceSession session, ReadOnlyMemory<char> command, CancellationToken token)
Parameters
Type Name Description
IMaintenanceSession session

Command session.

ReadOnlyMemory<char> command

The command to execute.

CancellationToken token

The token that is associated with the host lifetime.

Returns
Type Description
ValueTask

A task representing asynchronous execution of the command.

Overrides
ApplicationMaintenanceInterfaceHost.ExecuteCommandAsync(IMaintenanceSession, ReadOnlyMemory<char>, CancellationToken)

Implements

IDisposable
IHostedService

Extension Methods

BasicExtensions.As<T>(T)
BasicExtensions.IsBetween<T, TLowerBound, TUpperBound>(T, TLowerBound, TUpperBound)
BasicExtensions.IsOneOf<T>(T, params ReadOnlySpan<T>)
  • View Source
☀
☾
In this article
Back to top
Supported by the .NET Foundation
☀
☾