config

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrConfigEmpty = fmt.Errorf("config is empty")
	ErrOutDirEmpty = fmt.Errorf("out_dir cannot be empty")

	ErrSourceUnregisteredDomain = func(source string, domain string) error {
		return fmt.Errorf("unregistered domain: %s for source: %s", domain, source)
	}

	ErrDomainEmpty         = fmt.Errorf("domain cannot be empty")
	ErrDomainAlreadyExists = func(domain string) error {
		return fmt.Errorf("domain: %s already has been added", domain)
	}
	ErrInvalidDomainAPI = func(d string) error {
		return fmt.Errorf("invalid api for domain: %s. allowed API domains are: %+v", d, domain.AllowedDomainsAPI)
	}
)

Functions

This section is empty.

Types

type Config

type Config struct {
	OutDir       string       `yaml:"outDir" json:"outDir"`
	Dependencies []Dependency `yaml:"dependencies" json:"dependencies"`
	Domains      []Domain     `yaml:"domains" json:"domains"`
}

func Get

func Get() *Config

func Load

func Load(configPath string, outputDir string) (_ *Config, err error)

type Dependency

type Dependency struct {
	Source string `yaml:"source" json:"source"`
}

type Domain

type Domain struct {
	Name string `yaml:"name" json:"name"`
	API  string `yaml:"api" json:"api"`
}

Jump to

Keyboard shortcuts

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