Skip to content

Latest commit

 

History

History
25 lines (22 loc) · 478 Bytes

README.md

File metadata and controls

25 lines (22 loc) · 478 Bytes

File Loader

File loader loads config from files

Usage

Basic usage with files and json parser and a watcher

fileLoader := klfile.New(&klfile.Config{
	Files: []File{
		{
			Path: "./config.json",
			Parser: kpjson.Parser,
		},
	},
	Watch: true,
	Rate: 1 * time.Second, // Rate for the polling watching the file changes
})

Simplified syntax:

fileLoader := klfile.
	NewFileLoader("config-files", kpjson.Parser, "file1.json", "file2.json").
	WithWatcher()