config

package
v1.9.0-crc0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2025 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Column

type Column struct {
	ID   string `yaml:"id" json:"id"`
	Name string `yaml:"name" json:"name"`

	Group      string   `yaml:"group,omitempty" json:"group,omitempty"`
	Field      string   `yaml:"field,omitempty" json:"field,omitempty"`
	Fields     []string `yaml:"fields,omitempty" json:"fields,omitempty"`
	Calculated string   `yaml:"calculated,omitempty" json:"calculated,omitempty"`
	Tooltip    string   `yaml:"tooltip,omitempty" json:"tooltip,omitempty"`
	DocURL     string   `yaml:"docURL,omitempty" json:"docURL,omitempty"`
	Filter     string   `yaml:"filter,omitempty" json:"filter,omitempty"`
	Default    bool     `yaml:"default,omitempty" json:"default,omitempty"`
	Width      int      `yaml:"width,omitempty" json:"width,omitempty"`
	Feature    string   `yaml:"feature,omitempty" json:"feature,omitempty"`
}

type Config

type Config struct {
	Loki       Loki       `yaml:"loki" json:"loki"`
	Prometheus Prometheus `yaml:"prometheus" json:"prometheus"`
	Frontend   Frontend   `yaml:"frontend" json:"frontend"`
	Server     Server     `yaml:"server,omitempty" json:"server,omitempty"`
	Path       string     `yaml:"-" json:"-"`
}

func ReadFile

func ReadFile(version, date, filename string) (*Config, error)

func (*Config) GetAuthChecker

func (c *Config) GetAuthChecker() (auth.Checker, error)

func (*Config) IsLokiEnabled

func (c *Config) IsLokiEnabled() bool

func (*Config) IsPromEnabled

func (c *Config) IsPromEnabled() bool

func (*Config) Validate

func (c *Config) Validate() error

type Duration

type Duration struct {
	time.Duration
}

Duration is a wrapper of time.Duration that allows json marshaling.

func (Duration) MarshalJSON

func (d Duration) MarshalJSON() ([]byte, error)

func (Duration) MarshalYAML

func (d Duration) MarshalYAML() (interface{}, error)

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(b []byte) error

func (*Duration) UnmarshalYAML

func (d *Duration) UnmarshalYAML(unmarshal func(interface{}) error) error

type FieldConfig

type FieldConfig struct {
	Name        string `yaml:"name" json:"name"`
	Type        string `yaml:"type" json:"type"`
	Format      string `yaml:"format,omitempty" json:"format,omitempty"`
	Description string `yaml:"description" json:"description"`
	// lokiLabel flag is for documentation only. Use loki.labels instead
	Filter string `yaml:"filter,omitempty" json:"filter,omitempty"`
}

type Filter

type Filter struct {
	ID                     string `yaml:"id" json:"id"`
	Name                   string `yaml:"name" json:"name"`
	Component              string `yaml:"component" json:"component"`
	Category               string `yaml:"category,omitempty" json:"category,omitempty"`
	AutoCompleteAddsQuotes bool   `yaml:"autoCompleteAddsQuotes,omitempty" json:"autoCompleteAddsQuotes,omitempty"`
	Hint                   string `yaml:"hint,omitempty" json:"hint,omitempty"`
	Examples               string `yaml:"examples,omitempty" json:"examples,omitempty"`
	DocURL                 string `yaml:"docUrl,omitempty" json:"docUrl,omitempty"`
	Placeholder            string `yaml:"placeholder,omitempty" json:"placeholder,omitempty"`
}

type FlowDirection

type FlowDirection string
const (
	Egress       FlowDirection = "Egress"
	Ingress      FlowDirection = "Ingress"
	AnyDirection FlowDirection = "Any"
)

type Frontend

type Frontend struct {
	BuildVersion    string        `yaml:"buildVersion" json:"buildVersion"`
	BuildDate       string        `yaml:"buildDate" json:"buildDate"`
	RecordTypes     []string      `yaml:"recordTypes" json:"recordTypes"`
	PortNaming      PortNaming    `yaml:"portNaming" json:"portNaming"`
	Panels          []string      `yaml:"panels" json:"panels"`
	Columns         []Column      `yaml:"columns" json:"columns"`
	Filters         []Filter      `yaml:"filters" json:"filters"`
	Scopes          []Scope       `yaml:"scopes" json:"scopes"`
	QuickFilters    []QuickFilter `yaml:"quickFilters" json:"quickFilters"`
	AlertNamespaces []string      `yaml:"alertNamespaces" json:"alertNamespaces"`
	Sampling        int           `yaml:"sampling" json:"sampling"`
	Features        []string      `yaml:"features" json:"features"`
	Fields          []FieldConfig `yaml:"fields" json:"fields"`
	DataSources     []string      `yaml:"dataSources" json:"dataSources"`
	LokiMocks       bool          `yaml:"lokiMocks,omitempty" json:"lokiMocks,omitempty"`
	PromLabels      []string      `yaml:"promLabels" json:"promLabels"`
	MaxChunkAgeMs   int           `yaml:"maxChunkAgeMs,omitempty" json:"maxChunkAgeMs,omitempty"` // populated at query time
}

func (*Frontend) GetAggregateKeyLabels

func (c *Frontend) GetAggregateKeyLabels() map[string][]string

type Loki

type Loki struct {
	URL                string            `yaml:"url" json:"url"`
	Labels             []string          `yaml:"labels" json:"labels"`
	FieldsType         map[string]string `yaml:"fieldsType" json:"fieldsType"`
	FieldsFormat       map[string]string `yaml:"fieldsFormat" json:"fieldsFormat"`
	StatusURL          string            `yaml:"statusUrl,omitempty" json:"statusUrl,omitempty"`
	Timeout            Duration          `yaml:"timeout,omitempty" json:"timeout,omitempty"`
	TenantID           string            `yaml:"tenantID,omitempty" json:"tenantID,omitempty"`
	TokenPath          string            `yaml:"tokenPath,omitempty" json:"tokenPath,omitempty"`
	SkipTLS            bool              `yaml:"skipTls,omitempty" json:"skipTls,omitempty"`
	CAPath             string            `yaml:"caPath,omitempty" json:"caPath,omitempty"`
	StatusSkipTLS      bool              `yaml:"statusSkipTls,omitempty" json:"statusSkipTls,omitempty"`
	StatusCAPath       string            `yaml:"statusCaPath,omitempty" json:"statusCaPath,omitempty"`
	StatusUserCertPath string            `yaml:"statusUserCertPath,omitempty" json:"statusUserCertPath,omitempty"`
	StatusUserKeyPath  string            `yaml:"statusUserKeyPath,omitempty" json:"statusUserKeyPath,omitempty"`
	UseMocks           bool              `yaml:"useMocks,omitempty" json:"useMocks,omitempty"`
	ForwardUserToken   bool              `yaml:"forwardUserToken,omitempty" json:"forwardUserToken,omitempty"`
	// contains filtered or unexported fields
}

func (*Loki) GetStatusURL

func (l *Loki) GetStatusURL() string

func (*Loki) IsArray

func (l *Loki) IsArray(v string) bool

func (*Loki) IsIP

func (l *Loki) IsIP(v string) bool

func (*Loki) IsLabel

func (l *Loki) IsLabel(key string) bool

func (*Loki) IsNumeric

func (l *Loki) IsNumeric(v string) bool

type MetricInfo

type MetricInfo struct {
	Enabled    bool          `yaml:"enabled" json:"enabled"`
	Name       string        `yaml:"name,omitempty" json:"name,omitempty"`
	Type       string        `yaml:"type,omitempty" json:"type,omitempty"`
	ValueField string        `yaml:"valueField,omitempty" json:"valueField,omitempty"`
	Direction  FlowDirection `yaml:"direction,omitempty" json:"direction,omitempty"`
	Labels     []string      `yaml:"labels,omitempty" json:"labels,omitempty"`
}

type PortNaming

type PortNaming struct {
	Enable    bool              `yaml:"enable" json:"enable"`
	PortNames map[string]string `yaml:"portNames" json:"portNames"`
}

type Prometheus

type Prometheus struct {
	URL              string       `yaml:"url" json:"url"`
	DevURL           string       `yaml:"devUrl,omitempty" json:"devUrl,omitempty"`
	Timeout          Duration     `yaml:"timeout,omitempty" json:"timeout,omitempty"`
	TokenPath        string       `yaml:"tokenPath,omitempty" json:"tokenPath,omitempty"`
	SkipTLS          bool         `yaml:"skipTls,omitempty" json:"skipTls,omitempty"`
	CAPath           string       `yaml:"caPath,omitempty" json:"caPath,omitempty"`
	ForwardUserToken bool         `yaml:"forwardUserToken,omitempty" json:"forwardUserToken,omitempty"`
	Metrics          []MetricInfo `yaml:"metrics,omitempty" json:"metrics,omitempty"`
}

type QuickFilter

type QuickFilter struct {
	Name   string            `yaml:"name" json:"name"`
	Filter map[string]string `yaml:"filter" json:"filter"`

	Default bool `yaml:"default,omitempty" json:"default,omitempty"`
}

type Scope

type Scope struct {
	ID          string   `yaml:"id" json:"id"`
	Name        string   `yaml:"name" json:"name"`
	Description string   `yaml:"description" json:"description"`
	Labels      []string `yaml:"labels" json:"labels"`
	Feature     string   `yaml:"feature,omitempty" json:"feature,omitempty"`
	Groups      []string `yaml:"groups,omitempty" json:"groups,omitempty"`
	Filter      string   `yaml:"filter,omitempty" json:"filter,omitempty"`
	Filters     []string `yaml:"filters,omitempty" json:"filters,omitempty"`
	StepInto    string   `yaml:"stepInto,omitempty" json:"stepInto,omitempty"`
}

type Server

type Server struct {
	Port        int    `yaml:"port,omitempty" json:"port,omitempty"`
	MetricsPort int    `yaml:"metricsPort,omitempty" json:"metricsPort,omitempty"`
	CertPath    string `yaml:"certPath,omitempty" json:"certPath,omitempty"`
	KeyPath     string `yaml:"keyPath,omitempty" json:"keyPath,omitempty"`
	CORSOrigin  string `yaml:"corsOrigin,omitempty" json:"corsOrigin,omitempty"`
	CORSMethods string `yaml:"corsMethods,omitempty" json:"corsMethods,omitempty"`
	CORSHeaders string `yaml:"corsHeaders,omitempty" json:"corsHeaders,omitempty"`
	CORSMaxAge  string `yaml:"corsMaxAge,omitempty" json:"corsMaxAge,omitempty"`
	AuthCheck   string `yaml:"authCheck,omitempty" json:"authCheck,omitempty"`
}

Jump to

Keyboard shortcuts

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