diff --git a/restapi/client.go b/restapi/client.go index 366bae70f5..36d285cbd6 100644 --- a/restapi/client.go +++ b/restapi/client.go @@ -110,7 +110,7 @@ func (c mcS3Client) removeNotificationConfig(arn string, event string, prefix st return c.client.RemoveNotificationConfig(arn, event, prefix, suffix) } -// Define MCSCredentials interface with all functions to be implemented +// MCSCredentials interface with all functions to be implemented // by mock when testing, it should include all needed minioCredentials.Credentials api calls // that are used within this project. type MCSCredentials interface { diff --git a/restapi/config.go b/restapi/config.go index 443ce7cfed..cc7f91b4e8 100644 --- a/restapi/config.go +++ b/restapi/config.go @@ -24,10 +24,19 @@ import ( "github.com/minio/minio/pkg/env" ) +// Port mcs default port var Port = "9090" + +// Hostname mcs hostname var Hostname = "localhost" + +// TLSHostname mcs tls hostname var TLSHostname = "localhost" + +// TLSPort mcs tls port var TLSPort = "9443" + +// TLSRedirect mcs tls redirect rule var TLSRedirect = "off" func getAccessKey() string { @@ -70,10 +79,14 @@ func getProductionMode() bool { return strings.ToLower(env.Get(McsProductionMode, "on")) == "on" } +// GetHostname gets mcs hostname set on env variable, +// default one or defined on run command func GetHostname() string { return strings.ToLower(env.Get(McsHostname, Hostname)) } +// GetPort gets mcs por set on env variable +// or default one func GetPort() int { port, err := strconv.Atoi(env.Get(McsPort, Port)) if err != nil { @@ -82,10 +95,14 @@ func GetPort() int { return port } +// GetSSLHostname gets mcs ssl hostname set on env variable +// or default one func GetSSLHostname() string { return strings.ToLower(env.Get(McsTLSHostname, TLSHostname)) } +// GetSSLPort gets mcs ssl port set on env variable +// or default one func GetSSLPort() int { port, err := strconv.Atoi(env.Get(McsTLSPort, TLSPort)) if err != nil {