config

package
v0.3.9 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	REPLACE = "REPLACE"
	CREATE  = "CREATE"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Logging  Logging  `yaml:"logging"`
	Database Database `yaml:"database"`
	HTTP     HTTP     `yaml:"http"`
	Mtgjson  Mtgjson  `yaml:"mtgjson"`
	Scryfall Scryfall `yaml:"scryfall"`
	Storage  Storage  `yaml:"storage"`
}

func Load

func Load(path string) (*Config, error)

type Database

type Database struct {
	Host           string `yaml:"host"`
	Port           string `yaml:"port"`
	Database       string `yaml:"database"`
	Username       string `yaml:"username"`
	Password       string `yaml:"password"`
	MaxConnections int    `yaml:"maxConnections"`
}

func (Database) ConnectionURL added in v0.3.2

func (d Database) ConnectionURL() string

func (Database) MaxConnectionsOrDefault added in v0.3.2

func (d Database) MaxConnectionsOrDefault() int

type HTTP added in v0.3.2

type HTTP struct {
	Timeout time.Duration `yaml:"timeout"`
}

type Logging

type Logging struct {
	Level string `yaml:"level"`
}

func (Logging) LevelOrDefault

func (l Logging) LevelOrDefault() string

type Mtgjson

type Mtgjson struct {
	DownloadURL string `yaml:"downloadUrl"`
}

type Scryfall added in v0.3.0

type Scryfall struct {
	DownloadURL string `yaml:"downloadUrl"`
}

func (Scryfall) BuildJSONDownloadURL added in v0.3.2

func (i Scryfall) BuildJSONDownloadURL(setCode string, cardNumber string, lang string) string

type Storage added in v0.3.0

type Storage struct {
	Location string `yaml:"location"`
	Mode     string `yaml:"mode"`
}

Jump to

Keyboard shortcuts

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