config

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2021 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 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 JSONFields

type JSONFields []struct {
	FieldName  string `yaml:"fieldName"`
	Attributes struct {
		AttributeName string `yaml:"attributeName"`
		AttributeType string `yaml:"attributeType"`
	} `yaml:"attributes"`
}

type QueryModel

type QueryModel struct {
	Index      string     `yaml:"index"`
	Query      string     `yaml:"query"`
	UpdateDate string     `yaml:"updateDate"`
	JSONFields JSONFields `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