Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana committed Oct 14, 2019
1 parent 796f622 commit d0e9b70
Show file tree
Hide file tree
Showing 19 changed files with 168 additions and 258 deletions.
8 changes: 8 additions & 0 deletions cmd/config/bool-flag.go
Expand Up @@ -56,6 +56,14 @@ func (bf *BoolFlag) UnmarshalJSON(data []byte) (err error) {
return err
}

// FormatBool prints stringified version of boolean.
func FormatBool(b bool) string {
if b {
return "on"
}
return "off"
}

// ParseBool returns the boolean value represented by the string.
// It accepts 1, t, T, TRUE, true, True, 0, f, F, FALSE, false, False.
// Any other value returns an error.
Expand Down
3 changes: 1 addition & 2 deletions cmd/config/config.go
Expand Up @@ -51,8 +51,6 @@ const (

CompressionExtensions = "extensions"
CompressionMimeTypes = "mime_types"

LoggerHTTPEndpoint = "endpoint"
)

// Top level config constants.
Expand Down Expand Up @@ -100,6 +98,7 @@ var SubSystems = []string{
CompressionSubSys,
KmsVaultSubSys,
LoggerHTTPSubSys,
LoggerHTTPAuditSubSys,
NotifyAMQPSubSys,
NotifyESSubSys,
NotifyKafkaSubSys,
Expand Down
2 changes: 1 addition & 1 deletion cmd/config/errors.go
Expand Up @@ -215,7 +215,7 @@ Example 1:
ErrInvalidCompressionIncludesValue = newErrFn(
"Invalid compression include value",
"Please check the passed value",
"Compress extensions/mime-types are delimited by `,`. For eg, MINIO_COMPRESS_ATTR=\"A,B,C\"",
"Compress extensions/mime-types are delimited by `,`. For eg, MINIO_COMPRESS_MIMETYPES=\"A,B,C\"",
)

ErrInvalidGWSSEValue = newErrFn(
Expand Down
26 changes: 14 additions & 12 deletions cmd/config/notify/legacy.go
Expand Up @@ -32,10 +32,10 @@ func SetNotifyKafka(s config.Config, kName string, cfg target.KafkaArgs) error {
target.KafkaTopic: cfg.Topic,
target.KafkaQueueDir: cfg.QueueDir,
target.KafkaQueueLimit: strconv.Itoa(int(cfg.QueueLimit)),
target.KafkaTLSEnable: strconv.FormatBool(cfg.TLS.Enable),
target.KafkaTLSSkipVerify: strconv.FormatBool(cfg.TLS.SkipVerify),
target.KafkaTLSEnable: config.FormatBool(cfg.TLS.Enable),
target.KafkaTLSSkipVerify: config.FormatBool(cfg.TLS.SkipVerify),
target.KafkaTLSClientAuth: strconv.Itoa(int(cfg.TLS.ClientAuth)),
target.KafkaSASLEnable: strconv.FormatBool(cfg.SASL.Enable),
target.KafkaSASLEnable: config.FormatBool(cfg.SASL.Enable),
target.KafkaSASLUsername: cfg.SASL.User,
target.KafkaSASLPassword: cfg.SASL.Password,
}
Expand All @@ -60,11 +60,13 @@ func SetNotifyAMQP(s config.Config, amqpName string, cfg target.AMQPArgs) error
target.AmqpRoutingKey: cfg.RoutingKey,
target.AmqpExchangeType: cfg.ExchangeType,
target.AmqpDeliveryMode: strconv.Itoa(int(cfg.DeliveryMode)),
target.AmqpMandatory: strconv.FormatBool(cfg.Mandatory),
target.AmqpInternal: strconv.FormatBool(cfg.Immediate),
target.AmqpDurable: strconv.FormatBool(cfg.Durable),
target.AmqpNoWait: strconv.FormatBool(cfg.NoWait),
target.AmqpAutoDeleted: strconv.FormatBool(cfg.AutoDeleted),
target.AmqpMandatory: config.FormatBool(cfg.Mandatory),
target.AmqpInternal: config.FormatBool(cfg.Immediate),
target.AmqpDurable: config.FormatBool(cfg.Durable),
target.AmqpNoWait: config.FormatBool(cfg.NoWait),
target.AmqpAutoDeleted: config.FormatBool(cfg.AutoDeleted),
target.AmqpQueueDir: cfg.QueueDir,
target.AmqpQueueLimit: strconv.Itoa(int(cfg.QueueLimit)),
}

return nil
Expand Down Expand Up @@ -181,8 +183,8 @@ func SetNotifyNSQ(s config.Config, nsqName string, cfg target.NSQArgs) error {
}(),
target.NSQAddress: cfg.NSQDAddress.String(),
target.NSQTopic: cfg.Topic,
target.NSQTLSEnable: strconv.FormatBool(cfg.TLS.Enable),
target.NSQTLSSkipVerify: strconv.FormatBool(cfg.TLS.SkipVerify),
target.NSQTLSEnable: config.FormatBool(cfg.TLS.Enable),
target.NSQTLSSkipVerify: config.FormatBool(cfg.TLS.SkipVerify),
target.NSQQueueDir: cfg.QueueDir,
target.NSQQueueLimit: strconv.Itoa(int(cfg.QueueLimit)),
}
Expand All @@ -208,7 +210,7 @@ func SetNotifyNATS(s config.Config, natsName string, cfg target.NATSArgs) error
target.NATSUsername: cfg.Username,
target.NATSPassword: cfg.Password,
target.NATSToken: cfg.Token,
target.NATSSecure: strconv.FormatBool(cfg.Secure),
target.NATSSecure: config.FormatBool(cfg.Secure),
target.NATSPingInterval: strconv.FormatInt(cfg.PingInterval, 10),
target.NATSQueueDir: cfg.QueueDir,
target.NATSQueueLimit: strconv.Itoa(int(cfg.QueueLimit)),
Expand All @@ -219,7 +221,7 @@ func SetNotifyNATS(s config.Config, natsName string, cfg target.NATSArgs) error
return config.StateDisabled
}(),
target.NATSStreamingClusterID: cfg.Streaming.ClusterID,
target.NATSStreamingAsync: strconv.FormatBool(cfg.Streaming.Async),
target.NATSStreamingAsync: config.FormatBool(cfg.Streaming.Async),
target.NATSStreamingMaxPubAcksInFlight: strconv.Itoa(cfg.Streaming.MaxPubAcksInflight),
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/crypto/config.go
Expand Up @@ -97,7 +97,7 @@ const (
// SetKMSConfig -
func SetKMSConfig(s config.Config, cfg KMSConfig) {
s[config.KmsVaultSubSys][config.Default] = config.KVS{
KMSAutoEncryption: strconv.FormatBool(cfg.AutoEncryption),
KMSAutoEncryption: config.FormatBool(cfg.AutoEncryption),
KMSEndpoint: cfg.Vault.Endpoint,
KMSCAPath: cfg.Vault.CAPath,
KMSAuthType: cfg.Vault.Auth.Type,
Expand Down
23 changes: 13 additions & 10 deletions cmd/logger/config.go
Expand Up @@ -51,6 +51,9 @@ const (
EnvLoggerHTTPAuthToken = "MINIO_LOGGER_HTTP_AUTH_TOKEN"

EnvLoggerHTTPAuditEndpoint = "MINIO_LOGGER_HTTP_AUDIT_ENDPOINT"
EnvLoggerHTTPAuditAuthToken = "MINIO_LOGGER_HTTP_AUDIT_AUTH_TOKEN"

// Legacy
EnvAuditLoggerHTTPEndpoint = "MINIO_AUDIT_LOGGER_HTTP_ENDPOINT"
EnvAuditLoggerHTTPAuthToken = "MINIO_AUDIT_LOGGER_HTTP_AUTH_TOKEN"
)
Expand Down Expand Up @@ -84,7 +87,7 @@ func NewConfig() Config {
return cfg
}

// SetLoggerHTTPAudit -
// SetLoggerHTTPAudit - helper for migrating older config to newer KV format.
func SetLoggerHTTPAudit(scfg config.Config, k string, args HTTP) {
scfg[config.LoggerHTTPAuditSubSys][k] = config.KVS{
config.State: func() string {
Expand All @@ -98,7 +101,7 @@ func SetLoggerHTTPAudit(scfg config.Config, k string, args HTTP) {
}
}

// SetLoggerHTTP -
// SetLoggerHTTP helper for migrating older config to newer KV format.
func SetLoggerHTTP(scfg config.Config, k string, args HTTP) {
scfg[config.LoggerHTTPSubSys][k] = config.KVS{
config.State: func() string {
Expand Down Expand Up @@ -157,13 +160,13 @@ func LookupConfig(scfg config.Config) (Config, error) {
if kv.Get(config.State) != config.StateEnabled {
continue
}
endpointEnv := EnvLoggerHTTPEndpoint
endpointEnv := EnvLoggerHTTPAuditEndpoint
if starget != defaultTarget {
endpointEnv = EnvLoggerHTTPEndpoint + defaultTarget + starget
endpointEnv = EnvLoggerHTTPAuditEndpoint + defaultTarget + starget
}
authTokenEnv := EnvLoggerHTTPAuthToken
authTokenEnv := EnvLoggerHTTPAuditAuthToken
if starget != defaultTarget {
authTokenEnv = EnvLoggerHTTPAuthToken + defaultTarget + starget
authTokenEnv = EnvLoggerHTTPAuditAuthToken + defaultTarget + starget
}
cfg.HTTP[starget] = HTTP{
Enabled: true,
Expand All @@ -189,13 +192,13 @@ func LookupConfig(scfg config.Config) (Config, error) {
}

for _, target := range loggerAuditTargets {
endpointEnv := EnvLoggerHTTPEndpoint
endpointEnv := EnvLoggerHTTPAuditEndpoint
if target != defaultTarget {
endpointEnv = EnvLoggerHTTPEndpoint + defaultTarget + target
endpointEnv = EnvLoggerHTTPAuditEndpoint + defaultTarget + target
}
authTokenEnv := EnvLoggerHTTPAuthToken
authTokenEnv := EnvLoggerHTTPAuditAuthToken
if target != defaultTarget {
authTokenEnv = EnvLoggerHTTPAuthToken + defaultTarget + target
authTokenEnv = EnvLoggerHTTPAuditAuthToken + defaultTarget + target
}
cfg.HTTP[target] = HTTP{
Enabled: true,
Expand Down

0 comments on commit d0e9b70

Please sign in to comment.