(config outputs.Config)
| 50 | } |
| 51 | |
| 52 | func initHTTP(config outputs.Config) (outputs.OutputGroup, error) { |
| 53 | cfg, ok := config.Output.(Config) |
| 54 | if !ok { |
| 55 | return outputs.Fail(outputs.ErrInvalidConfig(outputs.HTTP, config.Output)) |
| 56 | } |
| 57 | |
| 58 | clients := make([]outputs.Client, len(cfg.Endpoints)) |
| 59 | for i, endpoint := range cfg.Endpoints { |
| 60 | _, err := url.Parse(endpoint) |
| 61 | if err != nil { |
| 62 | return outputs.Fail(err) |
| 63 | } |
| 64 | client, err := newHTTPClient(cfg) |
| 65 | if err != nil { |
| 66 | return outputs.Fail(err) |
| 67 | } |
| 68 | |
| 69 | clients[i] = &_http{ |
| 70 | client: client, |
| 71 | config: cfg, |
| 72 | url: endpoint, |
| 73 | } |
| 74 | } |
| 75 | |
| 76 | return outputs.Success(clients...), nil |
| 77 | } |
| 78 | |
| 79 | func (h *_http) Connect() error { return nil } |
| 80 | func (h *_http) Close() error { return nil } |
nothing calls this directly
no test coverage detected