Class ServiceMap
Describes a collection of services deployed to Kubernetes or that run in a simulated unit test environment. This is simply a dictionary mapping case sensitive service names to ServiceDescription records for each service.
note
ServiceMap is a somewhat dated concept that doesn't make a lot of sense in the Kubernetes world. We recommend that new code avoid this.
Namespace: Neon.Service
Assembly: Neon.Common.dll
Syntax
public class ServiceMap : Dictionary<string, ServiceDescription>
Properties
this[string]
Indexer mapping service names to their ServiceDescription.
Declaration
public ServiceDescription this[string name] { get; set; }
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The service name. |
Property Value
| Type | Description |
|---|---|
| ServiceDescription | The service description or |
Methods
Add(ServiceDescription)
Adds a service description to the map.
Declaration
public void Add(ServiceDescription description)
Parameters
| Type | Name | Description |
|---|---|---|
| ServiceDescription | description | The service descrioption. |
Add(string, ServiceDescription)
Adds the named service description.
Declaration
public void Add(string name, ServiceDescription description)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The service name. |
| ServiceDescription | description | The service description. |
GetServiceEndpoint(string, string)
Returns the named endpoint for the specified service.
Declaration
public ServiceEndpoint GetServiceEndpoint(string serviceName, string endpointName = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | serviceName | The target service name. |
| string | endpointName | Optionally specifies the target endpoint name (defaults to Empty). |
Returns
| Type | Description |
|---|---|
| ServiceEndpoint | The requested service endpoint. |
Exceptions
| Type | Condition |
|---|---|
| KeyNotFoundException | Thrown if the requested service or endpoint does not exist. |
GetServiceEndpointUri(string, string)
Returns the named endpoint Uri for the specified service.
Declaration
public Uri GetServiceEndpointUri(string serviceName, string endpointName = "")
Parameters
| Type | Name | Description |
|---|---|---|
| string | serviceName | The target service name. |
| string | endpointName | Optionally specifies the target endpoint name (defaults to Empty). |
Returns
| Type | Description |
|---|---|
| Uri | The requested service endpoint Uri. |
Exceptions
| Type | Condition |
|---|---|
| KeyNotFoundException | Thrown if the requested service or endpoint does not exist. |