config

package
v0.13.2 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAuthedHTTPRequired added in v0.13.0

func IsAuthedHTTPRequired(cfg Config) bool

func Load

func Load(data []byte, cfg *Config) error

func LoadFile

func LoadFile(filename string, cfg *Config) error

Types

type Config

type Config struct {
	// GitLab client settings
	GitLab GitLab `default:"{}" yaml:"gitlab"`
	// List of recorder endpoints to export to
	Endpoints []Endpoint `default:"[]" yaml:"endpoints"`
	// Default settings for projects
	ProjectDefaults ProjectSettings `default:"{}" yaml:"project_defaults"`
	// List of project to export
	Projects []Project `default:"[]" yaml:"projects"`
	// List of namespaces of which to export projects
	Namespaces []Namespace `default:"[]" yaml:"namespaces"`
	// HTTP server settings
	HTTP HTTP `default:"{}" yaml:"http"`
	// Log configuration settings
	Log Log `default:"{}" yaml:"log"`
}

Config holds all the parameter settings for the application.

func Default

func Default() Config

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(v *yaml.Node) error

Config implements the Unmarshaler interface

type Endpoint

type Endpoint struct {
	Address string `default:"" yaml:"address"`
}

type GitLab

type GitLab struct {
	Url   string `default:"https://gitlab.com" yaml:"url"`
	Token string `default:"" yaml:"token"`

	Username string `default:"" yaml:"username"`
	Password string `default:"" yaml:"password"`

	Client struct {
		Rate struct {
			Limit float64 `default:"0.0" yaml:"limit"`
		} `yaml:"rate"`
	} `yaml:"client"`
}

type HTTP added in v0.7.0

type HTTP struct {
	Enabled bool   `default:"true" yaml:"enabled"`
	Host    string `default:"127.0.0.1" yaml:"host"`
	Port    string `default:"9100" yaml:"port"`
	Debug   bool   `default:"false" yaml:"debug"`
}

type Log added in v0.6.0

type Log struct {
	Level  string `default:"info" yaml:"level"`
	Format string `default:"text" yaml:"format"`
}

type Namespace added in v0.8.0

type Namespace struct {
	ProjectSettings `default:"{}" yaml:",inline"`

	Id   string `yaml:"id"`
	Kind string `default:"" yaml:"kind"`

	Visibility       string `default:"" yaml:"visibility"`
	WithShared       bool   `default:"false" yaml:"with_shared"`
	IncludeSubgroups bool   `default:"false" yaml:"include_subgroups"`

	ExcludeProjects []string `default:"[]" yaml:"exclude_projects"`
}

type Project

type Project struct {
	ProjectSettings `default:"{}" yaml:",inline"`

	Id int64 `yaml:"id"`
}

type ProjectCatchUp

type ProjectCatchUp struct {
	Enabled       bool   `default:"false" yaml:"enabled"`
	UpdatedAfter  string `default:"" yaml:"updated_after"`
	UpdatedBefore string `default:"" yaml:"updated_before"`
}

type ProjectExport

type ProjectExport struct {
	Sections      ProjectExportSections      `default:"{}" yaml:"sections"`
	TestReports   ProjectExportTestReports   `default:"{}" yaml:"testreports"`
	Reports       ProjectExportReports       `default:"{}" yaml:"reports"`
	Traces        ProjectExportTraces        `default:"{}" yaml:"traces"`
	Metrics       ProjectExportMetrics       `default:"{}" yaml:"metrics"`
	MergeRequests ProjectExportMergeRequests `default:"{}" yaml:"mergerequests"`
}

type ProjectExportMergeRequests added in v0.8.0

type ProjectExportMergeRequests struct {
	Enabled bool `default:"true" yaml:"enabled"`

	NoteEvents bool `default:"true" yaml:"note_events"`
}

type ProjectExportMetrics added in v0.6.0

type ProjectExportMetrics struct {
	Enabled bool `default:"true" yaml:"enabled"`
}

type ProjectExportReports added in v0.12.0

type ProjectExportReports struct {
	Enabled bool `default:"false" yaml:"enabled"`

	Junit ProjectExportReportsJunit `default:"{}" yaml:"junit"`
}

type ProjectExportReportsJunit added in v0.12.0

type ProjectExportReportsJunit struct {
	Enabled bool `default:"false" yaml:"enabled"`
}

type ProjectExportSections

type ProjectExportSections struct {
	Enabled bool `default:"true" yaml:"enabled"`
}

type ProjectExportTestReports

type ProjectExportTestReports struct {
	Enabled bool `default:"true" yaml:"enabled"`
}

type ProjectExportTraces

type ProjectExportTraces struct {
	Enabled bool `default:"true" yaml:"enabled"`
}

type ProjectSettings

type ProjectSettings struct {
	Export  ProjectExport  `default:"{}" yaml:"export"`
	CatchUp ProjectCatchUp `default:"{}" yaml:"catch_up"`
}

func DefaultProjectSettings

func DefaultProjectSettings() ProjectSettings

Jump to

Keyboard shortcuts

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