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
ApplicationMaintenanceInterfaceHost.SocketFileMode
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, ILoggerFactory?)

Initializes a new host.

Declaration
public CommandLineMaintenanceInterfaceHost(UnixDomainSocketEndPoint endPoint, ILoggerFactory? loggerFactory = null)
Parameters
Type Name Description
UnixDomainSocketEndPoint endPoint

Unix Domain Socket address used as an interaction point.

ILoggerFactory loggerFactory

Optional logger factory.

Properties

View Source

Authentication

Gets or sets authentication handler.

Declaration
public IAuthenticationHandler? Authentication { get; init; }
Property Value
Type Description
IAuthenticationHandler
View Source

Authorization

Gets or sets authorization handler.

Declaration
public AuthorizationCallback? Authorization { get; init; }
Property Value
Type Description
AuthorizationCallback
View Source

ParserSettings

Gets or sets parser settings.

Declaration
public ParserConfiguration ParserSettings { get; init; }
Property Value
Type Description
ParserConfiguration

Methods

View Source

AddCommands(params IEnumerable<ApplicationMaintenanceCommand>)

Registers maintenance commands.

Declaration
public void AddCommands(params IEnumerable<ApplicationMaintenanceCommand> commands)
Parameters
Type Name Description
IEnumerable<ApplicationMaintenanceCommand> commands

A set of commands to register.

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
☀
☾