代码拉取完成,页面将自动刷新
package outputs
// Fail helper can be used by output factories, to create a failure response when
// loading an output must return an error.
func Fail(err error) (Group, error) { return Group{}, err }
// Success create a valid output Group response for a set of client instances.
func Success(batchSize, retry int, clients ...Client) (Group, error) {
return Group{
Clients: clients,
BatchSize: batchSize,
Retry: retry,
}, nil
}
// NetworkClients converts a list of NetworkClient instances into []Client.
func NetworkClients(netclients []NetworkClient) []Client {
clients := make([]Client, len(netclients))
for i, n := range netclients {
clients[i] = n
}
return clients
}
func SuccessNet(loadbalance bool, batchSize, retry int, netclients []NetworkClient) (Group, error) {
if !loadbalance {
return Success(batchSize, retry, NewFailoverClient(netclients))
}
clients := NetworkClients(netclients)
return Success(batchSize, retry, clients...)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。