config

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Mar 5, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const JSONNET_DEF = `` /* 1424-byte string literal not displayed */

Variables

View Source
var ReferenceConfig []byte

Functions

func PrettyPrint

func PrettyPrint(jsonnetSource string)

Types

type Config

type Config struct {
	SyncID    string      `json:"sync_id,omitempty"`
	Pipelines []*Pipeline `json:"pipelines"`
}

func Parse

func Parse(filename string, data []byte) (*Config, error)

func (Config) Filter added in v0.17.0

func (c Config) Filter(typeNames []string) *Config

Filter return a new config adjusted so all that remains is configuration pertaining to the given type names.

func (Config) Load

func (c Config) Load(context.Context) (Config, error)

Load returns currently loaded config

func (Config) Outputs

func (c Config) Outputs() []*output.Output

func (Config) Validate

func (c Config) Validate() error

type FileLoader

type FileLoader string

FileLoader loads config from a filepath

func (FileLoader) Load

func (l FileLoader) Load(context.Context) (*Config, error)

type Loader

type Loader interface {
	Load(context.Context) (*Config, error)
}

func NewCachedLoader

func NewCachedLoader(logger kitlog.Logger, loader Loader, ttl time.Duration) Loader

NewCachedLoader caches a loader to avoid repeated lookups.

type LoaderFunc

type LoaderFunc func(context.Context) (*Config, error)

func (LoaderFunc) Load

func (l LoaderFunc) Load(ctx context.Context) (*Config, error)

type Pipeline

type Pipeline struct {
	Sources []*source.Source `json:"sources"`
	Outputs []*output.Output `json:"outputs"`
}

func (Pipeline) Validate

func (p Pipeline) Validate() error

Jump to

Keyboard shortcuts

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