Documentation
¶
Index ¶
Constants ¶
const ( PyroscopeConfigPath = ".pyroscope.yaml" LanguageUnknown = Language("") LanguageGo = Language("go") LanguageJava = Language("java") LanguagePython = Language("python") LanguageJavaScript = Language("javascript") )
const ( VersionUnknown = Version("") VersionV1 = Version("v1") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 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
type SourceCodeConfig ¶
type SourceCodeConfig struct {
Mappings []MappingConfig `yaml:"mappings"`
}
SourceCodeConfig contains source code mapping configuration