config

package
v0.0.0-...-b7e9043 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoints []Endpoint `yaml:"endpoints"`
	// The port to listen on
	Server  Server  `yaml:"server"`
	Metrics Metrics `yaml:"metrics"`
	Debug   bool    `yaml:"debug"`
}

func LoadConfig

func LoadConfig(file string) (*Config, error)

load the config from a file. the file should either be the one provided, or config.yaml or config.yml

func NewConfig

func NewConfig() *Config

A function to create a new config object

type Endpoint

type Endpoint struct {
	Name         string   `yaml:"name"`
	Address      string   `yaml:"address"`
	Headers      []Header `yaml:"headers"`
	Query        string   `yaml:"query"`
	QueryOffsets []string `yaml:"query_offsets"`
}
type Header struct {
	Name  string `yaml:"name"`
	Value string `yaml:"value"`
}

type Metrics

type Metrics struct {
	Prefix string `yaml:"prefix"`
}

type Server

type Server struct {

	// The port to listen on
	Port            int    `yaml:"port"`
	MetricsEndpoint string `yaml:"metrics_endpoint"`
}

Jump to

Keyboard shortcuts

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