package config

import (
	"github.com/elastic/beats/libbeat/outputs"
	"time"
)

// Defaults for config variables which are not set
const (
	DefaultCron         string        = "@every 1m"
	DefaultTimeout      time.Duration = 60 * time.Second
	DefaultDocumentType string        = "httpbeat"
)

type HttpbeatConfig struct {
	Urls []UrlConfig
}

type UrlConfig struct {
	Cron         string
	Url          string
	BasicAuth    BasicAuthenticationConfig `config:"basic_auth"`
	Method       string
	Body         string
	Headers      map[string]string
	ProxyUrl     string `config:"proxy_url"`
	Timeout      *int64
	DocumentType string            `config:"document_type"`
	Fields       map[string]string `config:"fields"`
	SSL          *outputs.TLSConfig
	JsonDotMode  string `config:"json_dot_mode"`
}

type BasicAuthenticationConfig struct {
	Username string
	Password string
}

type ConfigSettings struct {
	Httpbeat HttpbeatConfig
}

package config

import (
	"github.com/elastic/beats/libbeat/outputs"
	"time"
)

// Defaults for config variables which are not set
const (
	DefaultCron         string        = "@every 1m"
	DefaultTimeout      time.Duration = 60 * time.Second
	DefaultDocumentType string        = "httpbeat"
)

/*
 Configuration for Httpbeat
 */
type HttpbeatConfig struct {
	Urls []UrlConfig
}

/*
 Configuration for single URL
 */
type UrlConfig struct {
	Cron         string
	Url          string
	BasicAuth    BasicAuthenticationConfig `config:"basic_auth"`
	Method       string
	Body         string
	Headers      map[string]string
	ProxyUrl     string `config:"proxy_url"`
	Timeout      *int64
	DocumentType string            `config:"document_type"`
	Fields       map[string]string `config:"fields"`
	SSL          *outputs.TLSConfig
	JsonDotMode  string `config:"json_dot_mode"`
}

/*
 Configuration for Basic authentication
 */
type BasicAuthenticationConfig struct {
	Username string
	Password string
}

type ConfigSettings struct {
	Httpbeat HttpbeatConfig
}

Upgrade to Beats v5.0.0-beta1 - Added comments
Upgrade to Beats v5.0.0-beta1
- Added comments
