Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Trivial format fixes [SKIP CI] #1630

Merged
merged 1 commit into from
Jul 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
58 changes: 29 additions & 29 deletions client_plugin/vmdk_plugin/main_windows.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
package main

import (
"github.com/kardianos/service"
log "github.com/Sirupsen/logrus"
log "github.com/Sirupsen/logrus"
"github.com/kardianos/service"
)

// pluginService is a wrapper for vDVS plugin server so that the plugin can
Expand All @@ -27,43 +27,43 @@ import (
type pluginService struct{}

func (p *pluginService) Start(s service.Service) error {
// Start should not block. Do the actual work async.
go p.run()
return nil
// Start should not block. Do the actual work async.
go p.run()
return nil
}

func (p *pluginService) run() {
// Do work here
startPluginServer()
// Do work here
startPluginServer()
}

func (p *pluginService) Stop(s service.Service) error {
// Stop should not block. Return directly.
return nil
// Stop should not block. Return directly.
return nil
}

// startDaemon starts vDVS plugin daemon on Windows
func startDaemon() {
svcConfig := &service.Config {
Name: "vdvs",
DisplayName: "vSphere Docker Volume Service",
Description: "Enables user to run stateful containerized applications on top of VMware vSphere.",
}
svcConfig := &service.Config{
Name: "vdvs",
DisplayName: "vSphere Docker Volume Service",
Description: "Enables user to run stateful containerized applications on top of VMware vSphere.",
}

ps := &pluginService{}
svc, err := service.New(ps, svcConfig)
if err != nil {
log.Fatal("Failed to create the service: ", err)
}
ps := &pluginService{}
svc, err := service.New(ps, svcConfig)
if err != nil {
log.Fatal("Failed to create the service: ", err)
}

logger, err := svc.Logger(nil)
if err != nil {
log.Fatal("Failed to get service logger: ", err)
}
err = svc.Run()
if err != nil {
log.Fatal("Failed to run the service: ", err)
logger.Error(err)
}
logger, err := svc.Logger(nil)
if err != nil {
log.Fatal("Failed to get service logger: ", err)
}

err = svc.Run()
if err != nil {
log.Fatal("Failed to run the service: ", err)
logger.Error(err)
}
}