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.