config

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package config holds the definition of the configuration file and some methods to load and validate it

Index

Constants

This section is empty.

Variables

View Source
var ErrCatalogEntryNotFound = errors.New("catalog entry not found")

ErrCatalogEntryNotFound signalizes a catalog entry with the given name was not found

Functions

This section is empty.

Types

type File

type File struct {
	Catalog       []database.CatalogEntry `yaml:"catalog"`
	CheckInterval time.Duration           `yaml:"check_interval"`
}

File represents the configuration file content

func New

func New() *File

New creates a new empty File object with defaults

func (File) CatalogEntryByTag

func (f File) CatalogEntryByTag(name, tag string) (database.CatalogEntry, error)

CatalogEntryByTag retrieves a catalog entry by its name or returns and ErrCatalogEntryNotFound if it does not exist

func (*File) Load

func (f *File) Load(filepath string) error

Load loads the contents of the configuration file in the filesystem into the File object

func (File) ValidateCatalog

func (f File) ValidateCatalog() error

ValidateCatalog checks whether invalid fetchers are used or the configuration of the fetcher is not suitable for the given fetcher

Jump to

Keyboard shortcuts

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