config

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2023 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPanelsPath      = "schemas/panels"
	DefaultQueriesPath     = "schemas/queries"
	DefaultDatasourcesPath = "schemas/datasources"
	DefaultVariablesPath   = "schemas/variables"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Readonly will deactivate any HTTP POST, PUT, DELETE endpoint
	Readonly bool `json:"readonly" yaml:"readonly"`
	// Database contains the different configuration depending on the database you want to use
	Database Database `json:"database" yaml:"database"`
	// Schemas contains the configuration to get access to the CUE schemas
	Schemas Schemas `json:"schemas" yaml:"schemas"`
}

func Resolve

func Resolve(configFile string, dbFolder string, dbExtension string) (Config, error)

type Database

type Database struct {
	File *File              `json:"file,omitempty" yaml:"file,omitempty"`
	Etcd *config.EtcdConfig `json:"etcd,omitempty" yaml:"etcd,omitempty"`
}

func (*Database) Verify

func (d *Database) Verify() error

type File

type File struct {
	Folder        string        `json:"folder" yaml:"folder"`
	FileExtension FileExtension `json:"file_extension" yaml:"file_extension"`
}

func (*File) Verify

func (f *File) Verify() error

type FileExtension

type FileExtension string
const (
	YAMLExtension FileExtension = "yaml"
	JSONExtension FileExtension = "json"
)

type Schemas

type Schemas struct {
	PanelsPath      string        `yaml:"panels_path,omitempty"`
	QueriesPath     string        `yaml:"queries_path,omitempty"`
	DatasourcesPath string        `yaml:"datasources_path,omitempty"`
	VariablesPath   string        `yaml:"variables_path,omitempty"`
	Interval        time.Duration `yaml:"interval,omitempty"`
}

func (Schemas) MarshalJSON added in v0.13.0

func (s Schemas) MarshalJSON() ([]byte, error)

func (*Schemas) Verify

func (s *Schemas) Verify() error

Jump to

Keyboard shortcuts

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