config

package
v2.0.2 Latest Latest
Warning

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

Go to latest
Published: May 7, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PyroscopeConfigPath = ".pyroscope.yaml"

	LanguageUnknown    = Language("")
	LanguageGo         = Language("go")
	LanguageJava       = Language("java")
	LanguagePython     = Language("python")
	LanguageJavaScript = Language("javascript")
)
View Source
const (
	VersionUnknown = Version("")
	VersionV1      = Version("v1")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FileSpec

type FileSpec struct {
	Path         string
	FunctionName string
}

type GitHubMappingConfig

type GitHubMappingConfig struct {
	Owner string `yaml:"owner"`
	Repo  string `yaml:"repo"`
	Ref   string `yaml:"ref"`
	Path  string `yaml:"path"`
}

GitHubMappingConfig contains configuration for GitHub repository mappings

func (*GitHubMappingConfig) Validate

func (m *GitHubMappingConfig) Validate() error

type Language

type Language string

type LocalMappingConfig

type LocalMappingConfig struct {
	Path string `yaml:"path"`
}

LocalMappingConfig contains configuration for local path mappings

func (*LocalMappingConfig) Validate

func (m *LocalMappingConfig) Validate() error

type MappingConfig

type MappingConfig struct {
	Path         []Match `yaml:"path"`
	FunctionName []Match `yaml:"function_name"`
	Language     string  `yaml:"language"`

	Source Source `yaml:"source"`
}

MappingConfig represents a single source code path mapping

func (*MappingConfig) Match

func (m *MappingConfig) Match(file FileSpec) int

Returns -1 if no match, otherwise the number of characters that matched

func (*MappingConfig) Validate

func (m *MappingConfig) Validate() error

Validate checks if a mapping configuration is valid

type Match

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

Match represents how mappings a single source code path mapping

type PyroscopeConfig

type PyroscopeConfig struct {
	Version    Version
	SourceCode SourceCodeConfig `yaml:"source_code"`
}

PyroscopeConfig represents the structure of .pyroscope.yaml configuration file

func ParsePyroscopeConfig

func ParsePyroscopeConfig(data []byte) (*PyroscopeConfig, error)

ParsePyroscopeConfig parses a configuration from bytes

func (*PyroscopeConfig) FindMapping

func (c *PyroscopeConfig) FindMapping(file FileSpec) *MappingConfig

FindMapping finds a mapping configuration that matches the given FileSpec Returns nil if no matching mapping is found

func (*PyroscopeConfig) Validate

func (c *PyroscopeConfig) Validate() error

Validate checks if the configuration is valid

type Source

type Source struct {
	Local  *LocalMappingConfig  `yaml:"local,omitempty"`
	GitHub *GitHubMappingConfig `yaml:"github,omitempty"`
}

Source represents how mappings retrieve the source

func (*Source) Validate

func (m *Source) Validate() error

Validate checks if a source configuration is valid

type SourceCodeConfig

type SourceCodeConfig struct {
	Mappings []MappingConfig `yaml:"mappings"`
}

SourceCodeConfig contains source code mapping configuration

type Version

type Version string

Jump to

Keyboard shortcuts

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