forked from Azure/azure-functions-host
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWorkerDescription.cs
53 lines (45 loc) · 1.91 KB
/
WorkerDescription.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
using System.Collections.Generic;
using System.IO;
using Newtonsoft.Json;
namespace Microsoft.Azure.WebJobs.Script.Abstractions
{
public class WorkerDescription
{
/// <summary>
/// Gets or sets the name of the supported language. This is the same name as the IConfiguration section for the worker.
/// </summary>
[JsonProperty(PropertyName = "language")]
public string Language { get; set; }
/// <summary>
/// Gets or sets the supported file extension type. Functions are registered with workers based on extension.
/// </summary>
[JsonProperty(PropertyName = "extension")]
public string Extension { get; set; }
/// <summary>
/// Gets or sets the default executable path.
/// </summary>
[JsonProperty(PropertyName = "defaultExecutablePath")]
public string DefaultExecutablePath { get; set; }
/// <summary>
/// Gets or sets the default path to the worker (relative to the bin/workers/{language} directory)
/// </summary>
[JsonProperty(PropertyName = "defaultWorkerPath")]
public string DefaultWorkerPath { get; set; }
/// <summary>
/// Gets or sets the default base directory for the worker
/// </summary>
[JsonProperty(PropertyName = "workerDirectory")]
public string WorkerDirectory { get; set; }
/// <summary>
/// Gets or sets the default path to the worker (relative to the bin/workers/{language} directory)
/// </summary>
[JsonProperty(PropertyName = "arguments")]
public List<string> Arguments { get; set; }
public string GetWorkerPath()
{
return Path.Combine(WorkerDirectory, DefaultWorkerPath);
}
}
}