/
config_validator.go
28 lines (23 loc) · 1012 Bytes
/
config_validator.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
// Copyright (c) HashiCorp, Inc.
// SPDX-License-Identifier: MPL-2.0
package provider
import "context"
// ConfigValidator describes reusable Provider configuration validation functionality.
type ConfigValidator interface {
// Description describes the validation in plain text formatting.
//
// This information may be automatically added to provider plain text
// descriptions by external tooling.
Description(context.Context) string
// MarkdownDescription describes the validation in Markdown formatting.
//
// This information may be automatically added to provider Markdown
// descriptions by external tooling.
MarkdownDescription(context.Context) string
// ValidateProvider performs the validation.
//
// This method name is separate from the ConfigValidator
// interface ValidateDataSource method name and ResourceConfigValidator
// interface ValidateResource method name to allow generic validators.
ValidateProvider(context.Context, ValidateConfigRequest, *ValidateConfigResponse)
}