configuration

package
v0.0.0-...-795570d Latest Latest
Warning

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

Go to latest
Published: May 29, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DYNAMIC_RULE = "dynamic"
	STATIC_RULE  = "static"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AppConfig

type AppConfig struct {
	Path           string        `yaml:"path"`
	ChannelTimeout time.Duration `yaml:"channelTimeout"`
}

type BotConfig

type BotConfig struct {
	Token                string  `yaml:"token"`
	ChatIds              []int64 `yaml:"chatIds"`
	KafkaConsumerGroupId string  `yaml:"kafkaConsumerGroupId"`
}

type Configuration

type Configuration struct {
	App        *AppConfig        `yaml:"app"`
	Source     *SourceConfig     `yaml:"source"`
	Scrapper   *ScrapperConfig   `yaml:"scrapper"`
	Bot        *BotConfig        `yaml:"bot"`
	Logger     *LoggerConfig     `yaml:"logger"`
	DataLoader *DataLoaderConfig `yaml:"dataLoader"`
	Events     *EventsConfig     `yaml:"events"`
	Kafka      *KafkaConfig      `yaml:"kafka"`
	Mongo      *MongoConfig      `yaml:"mongo"`
	Rules      []Rule
}

func GetConfig

func GetConfig() *Configuration

func (*Configuration) AppPath

func (c *Configuration) AppPath() string

func (*Configuration) BotConsumerGroupId

func (c *Configuration) BotConsumerGroupId() string

func (*Configuration) ChannelTimeout

func (c *Configuration) ChannelTimeout() time.Duration

func (*Configuration) DataLoaderConsumerGroupId

func (c *Configuration) DataLoaderConsumerGroupId() string

func (*Configuration) HasPredefinedEvents

func (c *Configuration) HasPredefinedEvents() bool

type DataLoaderConfig

type DataLoaderConfig struct {
	KafkaConsumerGroupId string `yaml:"kafkaConsumerGroupId"`
}

type EventsConfig

type EventsConfig struct {
	Matches      []string      `yaml:"matches"`
	StopFlag     string        `yaml:"stopFlag"`
	GraceEndTime time.Duration `yaml:"graceEndTime"`
	CountDown    int           `yaml:"countDown"`
}

type KafkaConfig

type KafkaConfig struct {
	Topic           string `yaml:"topic"`
	Protocol        string `yaml:"protocol"`
	Address         string `yaml:"address"`
	ConsumerGroupId string `yaml:"consumerGroupId"`
}

type LoggerConfig

type LoggerConfig struct {
	CompletionStep int `yaml:"completionStep"`
}

type MongoConfig

type MongoConfig struct {
	Hostname               string `yaml:"hostname"`
	Port                   int    `yaml:"port"`
	Database               string `yaml:"database"`
	ReplicaSet             string `yaml:"replicaSet"`
	DirectConnection       bool   `yaml:"directConnection"`
	MatchesCollection      string `yaml:"matchesCollection"`
	AssetsCollection       string `yaml:"assetsCollection"`
	UsersCollection        string `yaml:"usersCollection"`
	TransactionsCollection string `yaml:"transactionsCollection"`
}

type Rule

type Rule struct {
	Pattern string  `yaml:"pattern"`
	Score   float64 `yaml:"score"`
	Pos     int     `yaml:"pos"`
	Type    string  `yaml:"type"`
}

type Rules

type Rules struct {
	ScoringRules []Rule `yaml:"scoringRules"`
}

type ScrapperConfig

type ScrapperConfig struct {
	Url                      string `yaml:"url"`
	ResultsPath              string `yaml:"resultsPath"`
	FixturesPath             string `yaml:"fixturesPath"`
	MatchRowsSelector        string `yaml:"matchRowsSelector"`
	HrefPattern              string `yaml:"hrefPattern"`
	MoreCommentsSelector     string `yaml:"moreCommentsSelector"`
	MoreCommentsTextSelector string `yaml:"moreCommentsTextSelector"`
	CommentarySelector       string `yaml:"commentarySelector"`
	CommentaryParams         string `yaml:"commentaryParams"`
	InfoSelector             string `yaml:"infoSelector"`
	InfoParams               string `yaml:"infoParams"`
	LineupsSelector          string `yaml:"lineupsSelector"`
	HomeTeamSelector         string `yaml:"homeTeamSelector"`
	AwaySelector             string `yaml:"awaySelector"`
	AwayTeamSelector         string `yaml:"awayTeamSelector"`
	SubstituteSelector       string `yaml:"substituteSelector"`
	LineupsParams            string `yaml:"lineupsParams"`
	UrlProperty              string `yaml:"urlProperty"`
	CommentaryStartFlag      string `yaml:"commentaryStartFlag"`
	CommentaryEndFlag        string `yaml:"commentaryEndFlag"`
	LineupStartFlag          string `yaml:"lineupStartFlag"`
	SubstitutesStartFlag     string `yaml:"substitutesStartFlag"`
}

type SourceConfig

type SourceConfig struct {
	Update      bool   `yaml:"update"`
	MatchesPath string `yaml:"matchesPath"`
}

Jump to

Keyboard shortcuts

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