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

Commit

Permalink
Trivial format fixes [SKIP CI] (#1630)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sam Chen authored Jul 25, 2017
1 parent ce3e4e5 commit f435eca
Showing 1 changed file with 29 additions and 29 deletions.
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)
}
}

0 comments on commit f435eca

Please # to comment.