config

package
v0.0.0-...-cdfe82c Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EnvFile = ".env"
)

Functions

func InitConfig

func InitConfig(file string, config *AppConfig) api_error.ApiErr

Types

type AppConfig

type AppConfig struct {
	Server struct {
		Host                 string `envconfig:"SERVER_HOST"`
		Port                 string `envconfig:"SERVER_PORT" default:"8080"`
		TlsPort              string `envconfig:"SERVER_TLS_PORT" default:"8443"`
		GracefulShutdownTime int    `envconfig:"GRACEFUL_SHUTDOWN_TIME" default:"10"`
		UseTls               bool   `envconfig:"USE_TLS" default:"false"`
		CertFile             string `envconfig:"CERT_FILE" default:"./cert/cert.pem"`
		KeyFile              string `envconfig:"KEY_FILE" default:"./cert/cert.key"`
	}
	Gin struct {
		Mode         string `envconfig:"GIN_MODE" default:"release"`
		TemplatePath string `envconfig:"TEMPLATE_PATH" default:"./templates/"`
	}
	Misc struct {
		TestCrawl    bool   `envconfig:"TEST_CRAWL" default:"false"`
		TestDate     string `envconfig:"TEST_DATE" default:"2024/01/15"`
		FileSaveFile string `envconfig:"FILE_SAVE_FILE" default:"files.dta"`
	}
	Crawl struct {
		RootFolder     string   `envconfig:"ROOT_FOLDER" default:"Z:\\sendungen"`
		Extensions     []string `envconfig:"EXTENSIONS" default:".mp3,.m4a,.wav"`
		FfprobePath    string   `envconfig:"FFPROBE_PATH" default:"/usr/bin/ffprobe"`
		FfProbeTimeOut int      `envconfig:"FFPROBE_TIMEOUT" default:"60"`
		CrawlCycleMin  int      `envconfig:"CRAWL_CYCLE_MIN" default:"20"`
	}
	Export struct {
		ExportFolder        string   `envconfig:"EXPORT_FOLDER" default:"C:\\TEMP"`
		ShortDeltaAllowance float64  `envconfig:"SHORT_DELTA_ALLOWANCE" default:"5.0"`
		LongDeltaAllowance  float64  `envconfig:"LONG_DELTA_ALLOWANCE" default:"8.0"`
		MairListUrl         string   `envconfig:"MAIRLIST_URL" default:"http://localhost:9300/"`
		MairListUser        string   `envconfig:"MAIRLIST_USER" default:"dbtest"`
		MairListPassword    string   `envconfig:"MAIRLIST_PASS" default:"dbtest"`
		AppendPlaylist      bool     `envconfig:"APPEND_PLAYLIST" default:"false"`
		PrependJingle       bool     `envconfig:"PREPEND_JINGLE" default:"false"`
		JingleIds           []string `envconfig:"JINGLE_IDS"`
	}
	CalCms struct {
		QueryCalCms bool   `envconfig:"QUERY_CALCMS" default:"false"`
		CmsUrl      string `envconfig:"CALCMS_URL" default:"https://programm.coloradio.org/agenda/events.cgi"`
		Template    string `envconfig:"CALCMS_TEMPLATE" default:"event.json-p"`
	}
	RunTime struct {
		Router             *gin.Engine
		ListenAddr         string
		StartDate          time.Time
		CrawlRunNumber     int
		LastCrawlDate      time.Time
		FilesInList        int
		LastExportDate     time.Time
		LastExportFileName string
		CrawlRunning       bool
		ExportRunning      bool
		CleanRunning       bool
	}
}

Jump to

Keyboard shortcuts

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