-
Notifications
You must be signed in to change notification settings - Fork 0
/
data_source_repository_conan_proxy.go
35 lines (29 loc) · 1.23 KB
/
data_source_repository_conan_proxy.go
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
package repository
import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/nduyphuong/terraform-provider-nexus/internal/schema/common"
repositorySchema "github.com/nduyphuong/terraform-provider-nexus/internal/schema/repository"
)
func DataSourceRepositoryConanProxy() *schema.Resource {
return &schema.Resource{
Description: "Use this data source to get an existing conan proxy repository.",
Read: dataSourceRepositoryConanProxyRead,
Schema: map[string]*schema.Schema{
// Common schemas
"id": common.DataSourceID,
"name": repositorySchema.DataSourceName,
"online": repositorySchema.DataSourceOnline,
// Proxy schemas
"cleanup": repositorySchema.DataSourceCleanup,
"http_client": repositorySchema.DataSourceHTTPClient,
"negative_cache": repositorySchema.DataSourceNegativeCache,
"proxy": repositorySchema.DataSourceProxy,
"routing_rule": repositorySchema.DataSourceRoutingRule,
"storage": repositorySchema.DataSourceStorage,
},
}
}
func dataSourceRepositoryConanProxyRead(resourceData *schema.ResourceData, m interface{}) error {
resourceData.SetId(resourceData.Get("name").(string))
return resourceConanProxyRepositoryRead(resourceData, m)
}