config_handlers

package
v0.0.0-...-6307f30 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2024 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertConfigToModel

func ConvertConfigToModel(originsConfig []OriginInfo) []model.OriginInfo

ConvertConfigToModel converts a slice of config_handlers.OriginInfo to a slice of model.OriginInfo

func LoadApiKey

func LoadApiKey(filePath, domain string) (string, error)

loadApiKey loads the API key for a given domain from a YAML file

Types

type Config

type Config struct {
	Origins []OriginInfo `yaml:"origins"`
}

type OriginInfo

type OriginInfo struct {
	IATA               string `yaml:"IATA"`
	City               string `yaml:"City"`
	Country            string `yaml:"Country"`
	DepartureStartDate string `yaml:"DepartureStartDate"`
	DepartureEndDate   string `yaml:"DepartureEndDate"`
	ArrivalStartDate   string `yaml:"ArrivalStartDate"`
	ArrivalEndDate     string `yaml:"ArrivalEndDate"`
	SkyScannerID       string `yaml:"SkyScannerID"`
}

func LoadOrigins

func LoadOrigins(filename string) ([]OriginInfo, error)

type Secrets

type Secrets struct {
	APIKeys map[string]string `yaml:"api_keys"`
}

Secrets represents the structure of the secrets.yaml file.

Jump to

Keyboard shortcuts

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