config

package
v0.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 7, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	User     string `json:"user,omitempty"`
	Password string `json:"password,omitempty"`
}

type Config

type Config struct {
	AuthURI    string     `json:"authURI"`
	FFSURI     string     `json:"ffsURI"`
	FFSQueries []FFSQuery `json:"ffsQueries"`
	Prometheus Prometheus `json:"prometheus,omitempty"`
	Debugging  bool       `json:"debugging,omitempty"`
	IPAPI      IPAPI      `json:"ip-api,omitempty"`
}

Configuration File structs

func ReadConfig

func ReadConfig(configLocation string) (*Config, error)

ReadConfig - read a configuration file from a specified location configLocation - string which contains the location of the configuration file Returns Config - config struct of the configuration file (can be a "new" struct as well) error - any errors which have been caught

type Elasticsearch

type Elasticsearch struct {
	NumberOfShards        int       `json:"numberOfShards,omitempty"`
	NumberOfReplicas      int       `json:"numberOfReplicas,omitempty"`
	IndexName             string    `json:"indexName,omitempty"`
	IndexTimeAppend       string    `json:"indexTimeAppend,omitempty"`
	IndexTimeGen          string    `json:"indexTimeGen,omitempty"`
	ElasticURL            []string  `json:"elasticUrl,omitempty"`
	UseCustomIndexPattern bool      `json:"useCustomIndexPattern"`
	BasicAuth             BasicAuth `json:"basicAuth,omitempty"`
	Sniffing              bool      `json:"sniffing,omitempty"`
	BestCompression       bool      `json:"bestCompression,omitempty"`
	RefreshInterval       int       `json:"refreshInterval,omitempty"`
	Aliases               []string  `json:"aliases,omitempty"`
}

type FFSQuery

type FFSQuery struct {
	Name                 string        `json:"name"`
	Username             string        `json:"username"`
	Password             string        `json:"password"`
	Interval             string        `json:"interval"`
	TimeGap              string        `json:"timeGap"`
	Query                ffs.Query     `json:"query"`
	OutputType           string        `json:"outputType"`
	OutputLocation       string        `json:"outputLocation,omitempty"`
	Elasticsearch        Elasticsearch `json:"elasticsearch,omitempty"`
	Logstash             Logstash      `json:"logstash,omitempty"`
	EsStandardized       string        `json:"esStandardized,omitempty"`
	ValidIpAddressesOnly bool          `json:"validIpAddressesOnly"`
	MaxConcurrentQueries *int          `json:"max_concurrent_queries,omitempty"`
}

type IPAPI

type IPAPI struct {
	Enabled    bool        `json:"enabled,omitempty"`
	URL        string      `json:"url,omitempty"`
	APIKey     string      `json:"apiKey,omitempty"`
	Fields     string      `json:"fields,omitempty"`
	Lang       string      `json:"lang,omitempty"`
	LocalCache *LocalCache `json:"local_cache,omitempty"`
}

type LocalCache added in v0.2.4

type LocalCache struct {
	Enabled               bool           `json:"enabled,omitempty"`
	Persist               bool           `json:"persist,omitempty"`
	WriteInterval         string         `json:"write_interval,omitempty"`
	WriteIntervalDuration *time.Duration `json:"write_interval_duration,omitempty"`
	WriteLocation         string         `json:"write_location,omitempty"`
	SuccessAge            string         `json:"success_age,omitempty"`
	SuccessAgeDuration    *time.Duration `json:"success_age_duration,omitempty"`
	FailedAge             string         `json:"failed_age,omitempty"`
	FailedAgeDuration     *time.Duration `json:"failed_age_duration,omitempty"`
}

type Logstash added in v0.1.0

type Logstash struct {
	LogstashURL []string `json:"logstashURL"`
}

type Prometheus

type Prometheus struct {
	Enabled bool `json:"enabled,omitempty"`
	Port    int  `json:"port,omitempty"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL