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
}

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
}

--- 
+++ 
@@ -12,10 +12,16 @@
 	DefaultDocumentType string        = "httpbeat"
 )
 
+/*
+ Configuration for Httpbeat
+ */
 type HttpbeatConfig struct {
 	Urls []UrlConfig
 }
 
+/*
+ Configuration for single URL
+ */
 type UrlConfig struct {
 	Cron         string
 	Url          string
@@ -31,6 +37,9 @@
 	JsonDotMode  string `config:"json_dot_mode"`
 }
 
+/*
+ Configuration for Basic authentication
+ */
 type BasicAuthenticationConfig struct {
 	Username string
 	Password string
Upgrade to Beats v5.0.0-beta1
- Added comments
