Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MatchPattern ¶
func MatchPattern(fp string, patterns []MapPattern) (string, bool)
MatchPattern matches regex against entity's path to find alternate api key.
func WithReplacing ¶
func WithReplacing(config Config) heartbeat.HandleOption
WithReplacing initializes and returns a heartbeat handle option, which can be used in a heartbeat processing pipeline to replace default api key for a heartbeat following the provided configurations.
Types ¶
type Config ¶
type Config struct { // DefaultAPIKey contains the default api key. DefaultAPIKey string // Patterns contains the overridden api key per path. MapPatterns []MapPattern }
Config contains apikey project detection configurations.
type MapPattern ¶
type MapPattern struct { // APIKey is the project related api key. APIKey string // Regex is the regular expression for a specific path. Regex regex.Regex }
MapPattern contains [project_api_key] data.
Click to show internal directories.
Click to hide internal directories.