ShorebirdCommandService class abstract

Abstract service for executing Shorebird commands with proper error handling and result management.

This class provides a consistent interface for executing Shorebird commands while handling errors, logging, and result processing in a standardized way.

Usage

Subclass this class to create specific Shorebird command services:

class MyCommandService extends ShorebirdCommandService {
  MyCommandService(super.config);

  @override
  Future<void> validate() async {
    // Validate service-specific requirements
  }

  @override
  String buildCommand() {
    // Build the command string
  }
}
Mixed-in types
Implementers

Constructors

ShorebirdCommandService(ShorebirdCommandConfig config)
Creates a new service instance with the provided configuration.

Properties

config ShorebirdCommandConfig
The configuration for command execution
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildCommand() String
Builds the command string for execution.
execute() Future<ShorebirdResult>
Executes the Shorebird command and returns the result.
formatCommandArgs(List<String> args) String
Creates a formatted command argument string.
logCommand(String command) → void
Logs the command that is about to be executed.
inherited
logCommandComplete(String commandName, Duration duration) → void
Logs the completion of a command execution.
inherited
logCommandStart(String commandName, String flavor) → void
Logs the start of a command execution.
inherited
logDebug(String message) → void
Logs debug information (only when debug mode is enabled).
inherited
logError(String message) → void
Logs an error message.
inherited
logInfo(String message, {String prefix = 'Info'}) → void
Logs an informational message.
inherited
logSetup(String component) → void
Logs a setup step.
inherited
logStep(String step) → void
Logs a step in the execution process.
inherited
logSuccess(String message) → void
Logs a success message.
inherited
logValidation(String item) → void
Logs a validation step.
inherited
logWarning(String message) → void
Logs a warning message.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requireConfigValue(String? value, String fieldName) → void
Validates that a required configuration value is present.
toString() String
A string representation of this object.
inherited
validate() Future<void>
Validates the configuration before execution.

Operators

operator ==(Object other) bool
The equality operator.
inherited