YAML extension support documentation (#655)

* Yaml extension support documentation

* Fixed Typos
pull/660/head
Buddhika Chathuranga 2020-08-22 16:21:14 +05:30 committed by GitHub
parent 149a91a88e
commit ba562f20f7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 52 additions and 5 deletions

View File

@ -22,10 +22,10 @@ Generic extension creation guideline:
* Extension DLL should reference the `WinSWCore` library.
* The extension should extend the `AbstractWinSWExtension` class.
* The extension then can override event handlers offered by the upper class.
* The extension should implement the configuration parsing from the `XmlNode`.
* The extension should implement the configuration parsing from the `XmlNode` and `YamlExtensionConfiguration`.
* The extension should support disabling from the configuration file.
WinSW engine will automatically locate your extension using the class name in the [XML configuration file](../xmlConfigFile.md).
WinSW engine will automatically locate your extension using the class name in the [XML configuration file](../xmlConfigFile.md) or [YAML configuration file](../yamlConfigFile.md).
See configuration samples provided for the extensions in the core.
For extensions from external DLLs, the `className` field should also specify the assembly name.
It can be done via fully qualified class name or just by the `${CLASS_NAME}, ${ASSEMBLY_NAME}` declaration.

View File

@ -11,7 +11,9 @@ Since: WinSW 2.0.
## Usage
The extension can be configured via the [XML configuration file](../xmlConfigFile.md). Configuration sample:
The extension can be configured via the [XML configuration file](../xmlConfigFile.md) or [YAML configuration file](../yamlConfigFile.md).
### XML configuration sample
```xml
<?xml version="1.0" encoding="utf-8" ?>
@ -42,6 +44,26 @@ The extension can be configured via the [XML configuration file](../xmlConfigFil
</service>
```
### YAML configuration sample
```yaml
id: sampleService
name: Sample Service
description: This is a stub service.
executable: '%BASE%\sleep.bat'
arguments: arg1 arg2
log:
mode: roll
extensions:
- id: killRunawayProcess
enabled: yes
className: winsw.Plugins.RunawayProcessKiller.RunawayProcessKillerExtension
settings:
pidfile: 'foo/bar/pid.txt'
stopTimeOut: 5000
StopParentFirst: true
```
## Notes
* The current implementation of the the extension checks only the root process (started executable)

View File

@ -9,8 +9,9 @@ Since: WinSW 2.0.
## Usage
The extension can be configured via the [XML configuration file](../xmlConfigFile.md).
Configuration sample:
The extension can be configured via the [XML configuration file](../xmlConfigFile.md) or [YAML configuration file](../yamlConfigFile.md).
### XML configuration sample
```xml
<?xml version="1.0" encoding="utf-8" ?>
@ -33,6 +34,30 @@ Configuration sample:
</service>
```
### YAML configuration sample
```yaml
id: sampleService
name: Sample Service
description: This is a stub service.
executable: '%BASE%\sleep.bat'
arguments: arg1 arg2
log:
mode: roll
extensions:
- id: mapNetworDirs
className: winsw.Plugins.SharedDirectoryMapper.SharedDirectoryMapper
enabled: true
settings:
mapping:
- enabled: false
label: N
uncpath: \\UNC
- enabled: false
label: M
uncpath: \\UNC2
```
## Notes
* If the extension fails to map the drive, the startup fails