Skip to content

Commit

Permalink
Add initial provider boilerplate
Browse files Browse the repository at this point in the history
  • Loading branch information
stuart-mclaren-hpe committed Aug 20, 2024
1 parent 5933998 commit b391c07
Show file tree
Hide file tree
Showing 2 changed files with 76 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/constants/constants.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// (C) Copyright 2021-2024 Hewlett Packard Enterprise Development LP

package constants

const (
ProviderType = "hpegl"
ProviderBlock = "pc"
)
68 changes: 68 additions & 0 deletions internal/provider/provider.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// (C) Copyright 2024 Hewlett Packard Enterprise Development LP

package provider

import (
"context"

"github.com/HewlettPackard/hpegl-pcbe-terraform-resources/internal/constants"
"github.com/hashicorp/terraform-plugin-framework/datasource"
"github.com/hashicorp/terraform-plugin-framework/provider"
"github.com/hashicorp/terraform-plugin-framework/resource"
)

var (
_ provider.Provider = &pcbeProvider{}
)

func New(version string) func() provider.Provider {
return func() provider.Provider {
return &pcbeProvider{
version: version,
}
}
}

type pcbeProviderModel struct {
}

type pcbeProvider struct {
version string
}

func (p *pcbeProvider) Metadata(
_ context.Context,
_ provider.MetadataRequest,
resp *provider.MetadataResponse,
) {
resp.TypeName = constants.ProviderType + "_" + constants.ProviderBlock
resp.Version = p.version
}

func (p *pcbeProvider) Schema(
_ context.Context,
_ provider.SchemaRequest,
resp *provider.SchemaResponse,
) {
}

func (p *pcbeProvider) Configure(
ctx context.Context,
req provider.ConfigureRequest,
resp *provider.ConfigureResponse,
) {
}

// DataSources defines the data sources implemented in the provider.
func (p *pcbeProvider) DataSources(
_ context.Context,
) []func() datasource.DataSource {
return []func() datasource.DataSource{}
}

// Resources defines the resources implemented in the provider.
func (p *pcbeProvider) Resources(
_ context.Context,
) []func() resource.Resource {
return []func() resource.Resource{}
}

0 comments on commit b391c07

Please sign in to comment.