6 instantiations of PostgresServerResource
Aspire.Hosting.Azure.Tests (1)
PublicApiTests\PostgreSQLPublicApiTests.cs (1)
140var innerResource = new PostgresServerResource("postgre", userName, resource);
Aspire.Hosting.PostgreSQL (1)
PostgresBuilderExtensions.cs (1)
52var postgresServer = new PostgresServerResource(name, userName?.Resource, passwordParameter);
Aspire.Hosting.PostgreSQL.Tests (4)
PostgrePublicApiTests.cs (4)
258var postgresParentResource = new PostgresServerResource("postgresServer", userName, builder.Resource); 278var postgresParentResource = new PostgresServerResource("postgresServer", userName, builder.Resource); 311var action = () => new PostgresServerResource(name, userName, builder.Resource); 326var action = () => new PostgresServerResource(name, userName, password);
66 references to PostgresServerResource
Aspire.Hosting.Azure.PostgreSQL (14)
AzurePostgresExtensions.cs (9)
19private static IResourceBuilder<T> WithLoginAndPassword<T>(this IResourceBuilder<T> builder, PostgresServerResource postgresResource) 32private static IResourceBuilder<PostgresServerResource> PublishAsAzurePostgresFlexibleServerInternal( 33this IResourceBuilder<PostgresServerResource> builder, 98public static IResourceBuilder<PostgresServerResource> PublishAsAzurePostgresFlexibleServer(this IResourceBuilder<PostgresServerResource> builder) 107public static IResourceBuilder<PostgresServerResource> AsAzurePostgresFlexibleServer(this IResourceBuilder<PostgresServerResource> builder) 207public static IResourceBuilder<AzurePostgresFlexibleServerResource> RunAsContainer(this IResourceBuilder<AzurePostgresFlexibleServerResource> builder, Action<IResourceBuilder<PostgresServerResource>>? configureContainer = null) 343var containerResource = azureResource.InnerResource;
AzurePostgresFlexibleServerResource.cs (2)
54internal PostgresServerResource? InnerResource { get; private set; } 88internal void SetInnerResource(PostgresServerResource innerResource)
AzurePostgresResource.cs (3)
11/// <param name="innerResource"><see cref="PostgresServerResource"/> that this resource wraps.</param> 14public class AzurePostgresResource(PostgresServerResource innerResource, Action<AzureResourceInfrastructure> configureInfrastructure) 17private readonly PostgresServerResource _innerResource = innerResource ?? throw new ArgumentNullException(nameof(innerResource));
Aspire.Hosting.Azure.Tests (5)
AzurePostgresExtensionsTests.cs (1)
162IResourceBuilder<PostgresServerResource>? innerPostgres = null;
PublicApiTests\PostgreSQLPublicApiTests.cs (4)
16IResourceBuilder<PostgresServerResource> builder = null!; 31IResourceBuilder<PostgresServerResource> builder = null!; 125PostgresServerResource innerResource = null!; 140var innerResource = new PostgresServerResource("postgre", userName, resource);
Aspire.Hosting.PostgreSQL (31)
PostgresBuilderExtensions.cs (26)
41public static IResourceBuilder<PostgresServerResource> AddPostgres(this IDistributedApplicationBuilder builder, 52var postgresServer = new PostgresServerResource(name, userName?.Resource, passwordParameter); 105.WithEndpoint(port: port, targetPort: 5432, name: PostgresServerResource.PrimaryEndpointName) // Internal port is always 5432. 132/// Note that by default calling <see cref="AddDatabase(IResourceBuilder{PostgresServerResource}, string, string?)"/> 138public static IResourceBuilder<PostgresDatabaseResource> AddDatabase(this IResourceBuilder<PostgresServerResource> builder, [ResourceName] string name, string? databaseName = null) 181where T : PostgresServerResource 209var postgresInstances = builder.ApplicationBuilder.Resources.OfType<PostgresServerResource>(); 285public static IResourceBuilder<PostgresServerResource> WithPgWeb(this IResourceBuilder<PostgresServerResource> builder, Action<IResourceBuilder<PgWebContainerResource>>? configureContainer = null, string? containerName = null) 369public static IResourceBuilder<PostgresServerResource> WithDataVolume(this IResourceBuilder<PostgresServerResource> builder, string? name = null, bool isReadOnly = false) 384public static IResourceBuilder<PostgresServerResource> WithDataBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = false) 400public static IResourceBuilder<PostgresServerResource> WithInitBindMount(this IResourceBuilder<PostgresServerResource> builder, string source, bool isReadOnly = true) 414public static IResourceBuilder<PostgresServerResource> WithInitFiles(this IResourceBuilder<PostgresServerResource> builder, string source) 453public static IResourceBuilder<PostgresServerResource> WithPassword(this IResourceBuilder<PostgresServerResource> builder, IResourceBuilder<ParameterResource> password) 468public static IResourceBuilder<PostgresServerResource> WithUserName(this IResourceBuilder<PostgresServerResource> builder, IResourceBuilder<ParameterResource> userName) 483public static IResourceBuilder<PostgresServerResource> WithHostPort(this IResourceBuilder<PostgresServerResource> builder, int? port) 486return builder.WithEndpoint(PostgresServerResource.PrimaryEndpointName, endpoint => 521private static string WritePgAdminServerJson(IEnumerable<PostgresServerResource> postgresInstances) 531foreach (var postgresInstance in postgresInstances)
PostgresDatabaseResource.cs (4)
11/// A resource that represents a PostgreSQL database. This is a child resource of a <see cref="PostgresServerResource"/>. 16public class PostgresDatabaseResource(string name, string databaseName, PostgresServerResource postgresParentResource) 17: Resource(name), IResourceWithParent<PostgresServerResource>, IResourceWithConnectionString 22public PostgresServerResource Parent { get; } = postgresParentResource ?? throw new ArgumentNullException(nameof(postgresParentResource));
PostgresServerResource.cs (1)
15/// Initializes a new instance of the <see cref="PostgresServerResource"/> class.
Aspire.Hosting.PostgreSQL.Tests (14)
AddPostgresTests.cs (4)
177var postgresResource = Assert.Single(appModel.Resources.OfType<PostgresServerResource>()); 646var resource = Assert.Single(builder.Resources.OfType<PostgresServerResource>());
PostgrePublicApiTests.cs (10)
74IResourceBuilder<PostgresServerResource> builder = null!; 103IResourceBuilder<PostgresServerResource> builder = null!; 138IResourceBuilder<PostgresServerResource> builder = null!; 149IResourceBuilder<PostgresServerResource> builder = null!; 160IResourceBuilder<PostgresServerResource> builder = null!; 189IResourceBuilder<PostgresServerResource> builder = null!; 203IResourceBuilder<PostgresServerResource> builder = null!; 258var postgresParentResource = new PostgresServerResource("postgresServer", userName, builder.Resource); 278var postgresParentResource = new PostgresServerResource("postgresServer", userName, builder.Resource); 293PostgresServerResource postgresParentResource = null!;
Aspire.Hosting.Tests (2)
DistributedApplicationBuilderExtensionsTests.cs (1)
23var incorrectTypeException = Assert.Throws<InvalidOperationException>(() => appBuilder.CreateResourceBuilder<PostgresServerResource>("redis"));
ResourceNotificationTests.cs (1)
425typeof(PostgresServerResource)