func New(cfg *Config) (*Proxy, error) {
	if err := cfg.validate(); err != nil {
		return nil, err
	}

	cwd, err := os.Getwd()
	if err != nil {
		return nil, err
	}

	config := concierge.Config{
		Args:        []string{"-windows-service", "-log_file=\\etc\\rancher\\wins\\csi-proxy.log", "-logtostderr=false"},
		Description: "Manages the Kubernetes CSI Proxy application.",
		DisplayName: "CSI Proxy",
		EnvVars:     nil,
	}

	service, err := concierge.New(serviceName, filepath.Join(cwd, exeName), &config)
	if err != nil {
		return nil, err
	}

	return &Proxy{
		cfg:         cfg,
		serviceName: serviceName,
		binaryName:  exeName,
		binaryPath:  filepath.Join(cwd, exeName),
		concierge:   service,
	}, nil
}
// New creates a new Proxy struct
New creates a new Proxy struct
// New creates a new Proxy struct
func New(cfg *Config) (*Proxy, error) {
	if err := cfg.validate(); err != nil {
		return nil, err
	}
	cwd, err := os.Getwd()
	if err != nil {
		return nil, err
	}
	config := concierge.Config{
		Args:        []string{"-windows-service", "-log_file=\\etc\\rancher\\wins\\csi-proxy.log", "-logtostderr=false"},
		Description: "Manages the Kubernetes CSI Proxy application.",
		DisplayName: "CSI Proxy",
		EnvVars:     nil,
	}
	service, err := concierge.New(serviceName, filepath.Join(cwd, exeName), &config)
	if err != nil {
		return nil, err
	}
	return &Proxy{
		cfg:         cfg,
		serviceName: serviceName,
		binaryName:  exeName,
		binaryPath:  filepath.Join(cwd, exeName),
		concierge:   service,
	}, nil
}
func New ( cfg * Config ) ( * Proxy , error ) { if err := cfg . validate ( ) ; err != nil { return nil , err } cwd , err := os . Getwd ( ) if err != nil { return nil , err } config := concierge . Config { Args : [ ] string { " " , " \\ \\ \\ \\ " , " " } , Description : " " , DisplayName : " " , EnvVars : nil , } service , err := concierge . New ( serviceName , filepath . Join ( cwd , exeName ) , & config ) if err != nil { return nil , err } return & Proxy { cfg : cfg , serviceName : serviceName , binaryName : exeName , binaryPath : filepath . Join ( cwd , exeName ) , concierge : service , } , nil }
New creates a new Proxy struct
New creates a new Proxy struct