package
0.8.3
Repository: https://github.com/lalamove/konfig.git
Documentation: pkg.go.dev

# README

HTTP Loader

Loads config from a source over HTTP

Usage

Basic usage with a json source and a poll watcher

httpLoader := klhttp.New(&klhttp.Config{
	Sources: []Source{
		{
			URL: "https://konfig.io/config.json",
			Method: "GET",
			Parser: kpjson.Parser,
		},
	},
	Watch: true,
	Rater: kwpoll.Time(10 * time.Second), // Rater is the rater for the poll watcher
})

# Functions

New returns a new Loader with the given Config.

# Variables

ErrNoSources is the error thrown when creating an Loader without sources.

# Structs

Config is the configuration of the Loader.
Loader loads a configuration remotely.
Source is an HTTP source and a Parser.

# Interfaces

Client is the interface used to send the HTTP request.