source

package
v0.0.0-...-e60230f Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2022 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Overview

Package source is a base for all config sources.

Index

Constants

This section is empty.

Variables

View Source
var Plugins = container.NewList[Source]() //nolint:gochecknoglobals

Plugins is the configsource plugin container.

Functions

This section is empty.

Types

type Data

type Data struct {
	// Source URL.
	URL *url.URL
	// Data holder.
	Data map[string]any
	// The Marshaler used to create Data -> map[string]any
	Marshaler marshaler.Marshaler
	// If there was an error while processing the URL.
	Error error

	// AdditionalConfigs is a list of configs that we also have to read.
	// or that have been injected by config.Read().
	AdditionalConfigs []*url.URL
}

Data holds a single config file marshaled to map[string]any.

type Source

type Source interface {
	fmt.Stringer

	// Schemes is a slice of schemes this reader supports.
	Schemes() []string

	// PrependSections indicates whether config.Read() has to prepend the result
	// with sections.
	PrependSections() bool

	// Read reads the url in u and returns it as map[string]any.
	Read(u *url.URL) Data
}

Source is a config source.

Directories

Path Synopsis
Package cli is the Cli component of orb.
Package cli is the Cli component of orb.

Jump to

Keyboard shortcuts

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