forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(chocolateyGH-14) Define ISourceRunner
- Loading branch information
1 parent
9a7ac27
commit f1ec25c
Showing
3 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
70 changes: 70 additions & 0 deletions
70
src/chocolatey/infrastructure.app/services/ISourceRunner.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Copyright © 2011 - Present RealDimensions Software, LLC | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
namespace chocolatey.infrastructure.app.services | ||
{ | ||
using System; | ||
using System.Collections.Concurrent; | ||
using configuration; | ||
using domain; | ||
using results; | ||
|
||
public interface ISourceRunner | ||
{ | ||
/// <summary> | ||
/// Gets the source type the source runner implements | ||
/// </summary> | ||
/// <value> | ||
/// The type of the source. | ||
/// </value> | ||
SourceType SourceType { get; } | ||
|
||
/// <summary> | ||
/// Ensures the application that controls a source is installed | ||
/// </summary> | ||
/// <param name="config">The configuration.</param> | ||
/// <param name="ensureAction">The action to continue with as part of the install</param> | ||
void ensure_source_app_installed(ChocolateyConfiguration config, Action<PackageResult> ensureAction); | ||
|
||
/// <summary> | ||
/// Run list in noop mode | ||
/// </summary> | ||
/// <param name="config">The configuration.</param> | ||
void list_noop(ChocolateyConfiguration config); | ||
|
||
/// <summary> | ||
/// Lists/searches for packages from the source feed | ||
/// </summary> | ||
/// <param name="config">The configuration.</param> | ||
/// <param name="logResults">Should results be logged?</param> | ||
/// <returns></returns> | ||
ConcurrentDictionary<string, PackageResult> list_run(ChocolateyConfiguration config, bool logResults); | ||
|
||
/// <summary> | ||
/// Run install in noop mode | ||
/// </summary> | ||
/// <param name="config">The configuration.</param> | ||
/// <param name="continueAction">The action to continue with for each noop test install.</param> | ||
void install_noop(ChocolateyConfiguration config, Action<PackageResult> continueAction); | ||
|
||
/// <summary> | ||
/// Installs packages from the source feed | ||
/// </summary> | ||
/// <param name="config">The configuration.</param> | ||
/// <param name="continueAction">The action to continue with when install is successful.</param> | ||
/// <returns>results of installs</returns> | ||
ConcurrentDictionary<string, PackageResult> install_run(ChocolateyConfiguration config, Action<PackageResult> continueAction); | ||
} | ||
} |