func (d *Driver) TaskConfigSchema() (*hclspec.Spec, error) {
	return taskConfigSpec, nil
}
TaskConfigSchema returns the HCL schema for the configuration of a task.
package iis
import (
	"context"
	"fmt"
	"time"
	"github.com/hashicorp/go-hclog"
	log "github.com/hashicorp/go-hclog"
	"github.com/hashicorp/nomad/client/stats"
	"github.com/hashicorp/nomad/drivers/shared/eventer"
	"github.com/hashicorp/nomad/plugins/base"
	"github.com/hashicorp/nomad/plugins/drivers"
	"github.com/hashicorp/nomad/plugins/shared/hclspec"
	"github.com/hashicorp/nomad/plugins/shared/structs"
)
const (
	pluginName = "win_iis"
	pluginVersion = "0.2.0"
	fingerprintPeriod = 30 * time.Second
	taskHandleVersion = 1
)
var (
	pluginInfo = &base.PluginInfoResponse{
		Type:              base.PluginTypeDriver,
		PluginApiVersions: []string{drivers.ApiVersion010},
		PluginVersion:     pluginVersion,
		Name:              pluginName,
	}
	configSpec = hclspec.NewObject(map[string]*hclspec.Spec{
		"enabled": hclspec.NewDefault(
			hclspec.NewAttr("enabled", "bool", false),
			hclspec.NewLiteral("true"),
		),
		"stats_interval": hclspec.NewAttr("stats_interval", "string", false),
	})
	taskConfigSpec = hclspec.NewObject(map[string]*hclspec.Spec{
		"path":                hclspec.NewAttr("path", "string", true),
		"site_config_path":    hclspec.NewAttr("site_config_path", "string", false),
		"apppool_config_path": hclspec.NewAttr("apppool_config_path", "string", false),
		"apppool_identity":    hclspec.NewAttr("apppool_identity", "string", false),
		"bindings": hclspec.NewBlockList("bindings", hclspec.NewObject(map[string]*hclspec.Spec{
			"hostname":  hclspec.NewAttr("hostname", "string", false),
			"ipaddress": hclspec.NewAttr("ipaddress", "string", false),
			"port":      hclspec.NewAttr("port", "string", true),
			"type":      hclspec.NewAttr("type", "string", true),
			"cert_hash": hclspec.NewAttr("cert_hash", "string", false),
		})),
	})
	capabilities = &drivers.Capabilities{
		SendSignals: false,
		Exec:        false,
		FSIsolation: drivers.FSIsolationNone,
	}
)
type Config struct {
	Enabled       bool   `codec:"enabled"`
	StatsInterval string `codec:"stats_interval"`
}
type TaskConfig struct {
	Path              string       `codec:"path"`
	AppPoolConfigPath string       `codec:"apppool_config_path"`
	SiteConfigPath    string       `codec:"site_config_path"`
	AppPoolIdentity   string       `codec:"apppool_identity"`
	Bindings          []iisBinding `codec:"bindings"`
}
type TaskState struct {
	StartedAt time.Time
}
type Driver struct {
	eventer *eventer.Eventer
	config *Config
	nomadConfig *base.ClientDriverConfig
	tasks *taskStore
	ctx context.Context
	signalShutdown context.CancelFunc
	logger log.Logger
}
func NewIISDriver(logger hclog.Logger) drivers.DriverPlugin {
	ctx, cancel := context.WithCancel(context.Background())
	logger = logger.Named(pluginName)
	return &Driver{
		eventer:        eventer.NewEventer(ctx, logger),
		config:         &Config{},
		tasks:          newTaskStore(),
		ctx:            ctx,
		signalShutdown: cancel,
		logger:         logger,
	}
}
func (d *Driver) PluginInfo() (*base.PluginInfoResponse, error) {
	return pluginInfo, nil
}
func (d *Driver) ConfigSchema() (*hclspec.Spec, error) {
	return configSpec, nil
}
func (d *Driver) SetConfig(cfg *base.Config) error {
	var config Config
	if len(cfg.PluginConfig) != 0 {
		if err := base.MsgPackDecode(cfg.PluginConfig, &config); err != nil {
			return err
		}
	}
	d.config = &config
	if cfg.AgentConfig != nil {
		d.nomadConfig = cfg.AgentConfig.Driver
	}
	return nil
}