本文整理匯總了Golang中github.com/minio/cli.Args.Get方法的典型用法代碼示例。如果您正苦於以下問題:Golang Args.Get方法的具體用法?Golang Args.Get怎麽用?Golang Args.Get使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/minio/cli.Args
的用法示例。
在下文中一共展示了Args.Get方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: enableLog2File
func enableLog2File(conf *config, args cli.Args) {
if conf.IsSysloggingEnabled() {
fatalIf(probe.NewError(errInvalidArgument), "Syslog logging already enabled. Please remove before enabling file.", nil)
}
if conf.IsMongoLoggingEnabled() {
fatalIf(probe.NewError(errInvalidArgument), "Mongo logging already enabled. Please remove before enabling file.", nil)
}
conf.FileLogger.Filename = args.Get(0)
err := saveConfig(conf.configV2)
fatalIf(err.Trace(), "Unable to save config.", nil)
}
示例2: enableLog2Syslog
func enableLog2Syslog(conf *config, args cli.Args) {
if conf.IsFileLoggingEnabled() {
fatalIf(probe.NewError(errInvalidArgument), "File logging already enabled. Please remove before enabling syslog.", nil)
}
if conf.IsMongoLoggingEnabled() {
fatalIf(probe.NewError(errInvalidArgument), "Mongo logging already enabled. Please remove before enabling syslog.", nil)
}
conf.SyslogLogger.Addr = args.Get(0)
conf.SyslogLogger.Network = args.Get(1)
err := saveConfig(conf.configV2)
fatalIf(err.Trace(), "Unable to save config.", nil)
}
示例3: enableLog2File
func enableLog2File(conf *config, args cli.Args) {
if conf.IsSysloggingEnabled() {
Infoln("Syslog logging already enabled. Removing automatically by enabling file logging.")
conf.SyslogLogger.Addr = ""
conf.SyslogLogger.Network = ""
}
if conf.IsMongoLoggingEnabled() {
Infoln("Mongo logging already enabled. Removing automatically by enabling file logging.")
conf.MongoLogger.Addr = ""
conf.MongoLogger.DB = ""
conf.MongoLogger.Collection = ""
}
conf.FileLogger.Filename = args.Get(0)
err := saveConfig(conf.configV2)
fatalIf(err.Trace(), "Unable to save file logging config.", nil)
}
示例4: enableLog2Mongo
func enableLog2Mongo(conf *config, args cli.Args) {
if conf.IsFileLoggingEnabled() {
fatalIf(probe.NewError(errInvalidArgument), "File logging already enabled. Please remove before enabling mongo.", nil)
}
if conf.IsSysloggingEnabled() {
fatalIf(probe.NewError(errInvalidArgument), "Syslog logging already enabled. Please remove before enabling mongo.", nil)
}
conf.MongoLogger.Addr = args.Get(0)
conf.MongoLogger.DB = args.Get(1)
conf.MongoLogger.Collection = args.Get(2)
err := saveConfig(conf.configV2)
fatalIf(err.Trace(), "Unable to save config.", nil)
}