config

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ElasticConfig

type ElasticConfig struct {
	Url        string `yaml:"url"`
	User       string `yaml:"user"`
	Password   string `yaml:"password"`
	CaCertPath string `yaml:"caCertPath"`
	NumWorker  int    `yaml:"numWorker"`
}

type Field added in v1.0.2

type Field struct {
	Name string `yaml:"name"`
	Type string `yaml:"type"`
}

type IReader

type IReader interface {
	ReadConfig() ([]byte, error)
}

Defining an interface so that functionality of 'readConfig()' can be mocked

type ImportConfig

type ImportConfig struct {
	PollingSeconds int           `yaml:"pollingSeconds"`
	Database       string        `yaml:"database"`
	Queries        []QueryModel  `yaml:"queries"`
	Elastic        ElasticConfig `yaml:"elastic"`
}

func ParseConfiguration

func ParseConfiguration(reader IReader) (*ImportConfig, error)

type JSONField added in v1.0.2

type JSONField struct {
	FieldName string  `yaml:"fieldName"`
	Fields    []Field `yaml:"fields"`
}

type QueryModel

type QueryModel struct {
	Index      string      `yaml:"index"`
	Query      string      `yaml:"query"`
	UpdateDate string      `yaml:"updateDate"`
	Fields     []Field     `yaml:"fields"`
	JSONFields []JSONField `yaml:"JSONFields"`
	Id         string      `yaml:"id"`
}

type Reader

type Reader struct {
	FileName string
}

func (*Reader) ReadConfig

func (r *Reader) ReadConfig() ([]byte, error)

'reader' implementing the Interface Function to read from actual file

Jump to

Keyboard shortcuts

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