Skip to content

Instantly share code, notes, and snippets.

@bschaeffer
Last active July 8, 2020 12:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bschaeffer/2cc497396bd10dbfa0b34214871c5752 to your computer and use it in GitHub Desktop.
Save bschaeffer/2cc497396bd10dbfa0b34214871c5752 to your computer and use it in GitHub Desktop.
func newHTTPOutput(_ outputs.IndexManager, _ beat.Info, stats outputs.Observer, cfg *common.Config) (outputs.Group, error) {
config := clientConfig{}
if err := cfg.Unpack(&config); err != nil {
return outputs.Fail(err)
}
clients := make([]outputs.NetworkClient, config.Workers)
for i := 0; i < config.Workers; i++ {
clients[i] = &httpClient{
stats: stats,
endpoint: config.Endpoint,
}
}
return outputs.Success(confg.BatchSize, config.RetryLimit, clients...)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment