config

package
v0.0.0-...-68712e6 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context) context.Context

func ReadConfig

func ReadConfig(r io.Reader, d interface{}) error

func ReadTokensFile

func ReadTokensFile(cfg *TwitchScrape, overwrite bool)

Types

type AppConfig

type AppConfig struct {
	Website      `toml:"website"`
	Debug        `toml:"debug"`
	Database     `toml:"database"`
	Redis        `toml:"redis"`
	Metrics      `toml:"metrics"`
	TwitchScrape `toml:"twitchscrape"`
}

func FromContext

func FromContext(ctx context.Context) *AppConfig

func ReadSettingsFile

func ReadSettingsFile() *AppConfig

type Database

type Database struct {
	DSN                string `toml:"dsn"`
	MaxIdleConnections int    `toml:"maxidleconnections"`
	MaxConnections     int    `toml:"maxconnections"`
}

type Debug

type Debug struct {
	Debug   bool   `toml:"debug"`
	Logfile string `toml:"logfile"`
}

type Metrics

type Metrics struct {
	URL      string `toml:"url"`
	Username string `toml:"username"`
	Password string `toml:"password"`
}

type Redis

type Redis struct {
	Addr     string `toml:"addr"`
	Password string `toml:"password"`
	DBIndex  int    `toml:"dbindex"`
	PoolSize int    `toml:"poolsize"`
}

type TwitchScrape

type TwitchScrape struct {
	ClientID     string `toml:"clientid"`
	ClientSecret string `toml:"clientsecret"`
	AccessToken  string `toml:"accesstoken"`
	RefreshToken string `toml:"refreshtoken"`
	GetSubURL    string `toml:"getsuburl"`
	ModSubURL    string `toml:"modsuburl"`
	SubURL       string `toml:"suburl"`
	PollMinutes  int64  `toml:"pollminutes"`
	Password     string `toml:"password"`
	Channel      string `toml:"channel"`
	ChannelID    string `toml:"channelid"`
}

type TwitchTokens

type TwitchTokens struct {
	AccessToken  string `toml:"accesstoken"`
	RefreshToken string `toml:"refreshtoken"`
}

type Website

type Website struct {
	Addr          string `toml:"addr"`
	BaseHost      string `toml:"basehost"`
	CDNHost       string `toml:"cdnhost"`
	PrivateAPIKey string `toml:"privateapikey"`
}

Jump to

Keyboard shortcuts

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