4 instantiations of ResolvedPort
Aspire.Hosting (4)
ApplicationModel\ResolvedPort.cs (4)
34
public static ResolvedPort Explicit(int port) =>
new
() { Value = port, IsAllocated = false };
41
public static ResolvedPort Allocated(int port) =>
new
() { Value = port, IsAllocated = true };
48
public static ResolvedPort Implicit(int port) =>
new
() { Value = port, IsImplicit = true };
54
public static ResolvedPort None() =>
new
() { Value = null, IsAllocated = false };
27 references to ResolvedPort
Aspire.Hosting (27)
ApplicationModel\ResolvedEndpoint.cs (2)
21
public
ResolvedPort
TargetPort { get; init; }
28
public
ResolvedPort
ExposedPort { get; init; }
ApplicationModel\ResolvedPort.cs (14)
30
/// Creates a <see cref="
ResolvedPort
"/> with an explicitly specified port.
33
/// <returns>A <see cref="
ResolvedPort
"/> with IsAllocated set to false.</returns>
34
public static
ResolvedPort
Explicit(int port) => new() { Value = port, IsAllocated = false };
37
/// Creates a <see cref="
ResolvedPort
"/> with an allocated port.
40
/// <returns>A <see cref="
ResolvedPort
"/> with IsAllocated set to true.</returns>
41
public static
ResolvedPort
Allocated(int port) => new() { Value = port, IsAllocated = true };
44
/// Creates a <see cref="
ResolvedPort
"/> with an implicitly inferred port.
47
/// <returns>A <see cref="
ResolvedPort
"/> with IsImplicit set to true.</returns>
48
public static
ResolvedPort
Implicit(int port) => new() { Value = port, IsImplicit = true };
51
/// Creates a <see cref="
ResolvedPort
"/> with no port (null).
53
/// <returns>A <see cref="
ResolvedPort
"/> with Value set to null.</returns>
54
public static
ResolvedPort
None() => new() { Value = null, IsAllocated = false };
57
/// Implicitly converts a <see cref="
ResolvedPort
"/> to a nullable int.
59
public static implicit operator int?(
ResolvedPort
resolvedPort) => resolvedPort.Value;
ApplicationModel\ResourceExtensions.cs (11)
793
ResolvedPort
targetPort = (resource, endpoint.UriScheme, endpoint.TargetPort, endpoint.Port) switch
796
(_, _, int target, _) =>
ResolvedPort
.Explicit(target),
799
(ContainerResource, _, null, int port) =>
ResolvedPort
.Implicit(port),
803
(ProjectResource, string uriScheme, null, _) when IsHttpScheme(uriScheme) && !httpSchemesEncountered.Contains(uriScheme) =>
ResolvedPort
.None(),
806
_ =>
ResolvedPort
.Allocated(portAllocator.AllocatePort())
816
ResolvedPort
exposedPort = (endpoint.UriScheme, endpoint.Port, targetPort.Value) switch
819
(_, int port, _) =>
ResolvedPort
.Explicit(port),
822
(_, null, int targetPortValue) =>
ResolvedPort
.Implicit(targetPortValue),
825
("http", null, null) =>
ResolvedPort
.None(),
826
("https", null, null) =>
ResolvedPort
.None(),
829
_ =>
ResolvedPort
.Allocated(portAllocator.AllocatePort())