Golint cleanup from top level

This commit is contained in:
Harshavardhana
2015-03-05 21:09:16 -08:00
parent 540723d7ae
commit c00d1461b9
8 changed files with 56 additions and 31 deletions

View File

@@ -34,10 +34,10 @@ type Config struct {
type Server struct{}
// Start http server
func Start(handler http.Handler, config HttpServerConfig) (chan<- string, <-chan error, *Server) {
func Start(handler http.Handler, config Config) (chan<- string, <-chan error, *Server) {
ctrlChannel := make(chan string)
errorChannel := make(chan error)
server := HttpServer{}
server := Server{}
go start(ctrlChannel, errorChannel, handler, config, &server)
return ctrlChannel, errorChannel, &server
}

View File

@@ -45,8 +45,8 @@ type MinioAPI struct {
StorageType StorageType
}
// WebUIApi - webui related
type WebUIApi struct {
// WebAPI - webui related
type WebAPI struct {
Websocket bool // TODO
}
@@ -66,15 +66,15 @@ func getHTTPChannels(configs []Config) (ctrlChans []chan<- string, statusChans [
var statusChan <-chan error
for _, config := range configs {
switch k := config.ApiType.(type) {
case MinioApi:
switch k := config.APIType.(type) {
case MinioAPI:
{
// configure web server
var storage mstorage.Storage
var httpConfig = httpserver.Config{}
httpConfig.Address = config.Address
httpConfig.Websocket = false
httpConfig.TLS = config.Tls
httpConfig.TLS = config.TLS
if config.CertFile != "" {
httpConfig.CertFile = config.CertFile
@@ -85,22 +85,22 @@ func getHTTPChannels(configs []Config) (ctrlChans []chan<- string, statusChans [
ctrlChans, statusChans, storage = getStorageChannels(k.StorageType)
// start minio api in a web server, pass storage driver into it
ctrlChan, statusChan, _ = httpserver.Start(minioapi.HttpHandler(config.Domain, storage), httpConfig)
ctrlChan, statusChan, _ = httpserver.Start(minioapi.HTTPHandler(config.Domain, storage), httpConfig)
ctrlChans = append(ctrlChans, ctrlChan)
statusChans = append(statusChans, statusChan)
}
case WebUIApi:
case WebAPI:
{
var httpConfig = httpserver.Config{}
httpConfig.Address = config.Address
httpConfig.TLS = config.Tls
httpConfig.TLS = config.TLS
httpConfig.CertFile = config.CertFile
httpConfig.KeyFile = config.KeyFile
httpConfig.Websocket = k.Websocket
ctrlChan, statusChan, _ = httpserver.Start(webuiapi.HttpHandler(), httpConfig)
ctrlChan, statusChan, _ = httpserver.Start(webuiapi.HTTPHandler(), httpConfig)
ctrlChans = append(ctrlChans, ctrlChan)
statusChans = append(statusChans, statusChan)