url

package module
v2.9.1 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2020 License: Apache-2.0 Imports: 7 Imported by: 0

README

URL Source

The URL source reads config from a url.

It uses the Content-Type header as the format e.g application/json becomes json. The content itself is not touched. If we can't find a format we'll use the encoder format.

New Source

Specify url source with url. Defaults to http://localhost:8080/config.

urlSource := url.NewSource(
	url.WithURL("http://api.example.com/config"),
)

Load Source

Load the source into config

// Create new config
conf := config.NewConfig()

// Load url source
conf.Load(urlSource)

Documentation

Overview

Package url loads changesets from a url

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultURL = "http://localhost:8080/config"
)

Functions

func NewSource

func NewSource(opts ...source.Option) source.Source

func WithURL

func WithURL(u string) source.Option

Types

This section is empty.

Jump to

Keyboard shortcuts

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