-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
64 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package enrichment | ||
|
||
import ( | ||
"alertmanager/logging" | ||
) | ||
|
||
func Noop_Enrichment(args string) (string, error) { | ||
logr := logging.GetLogger() | ||
|
||
logr.Info("Noop enrichment Called") | ||
|
||
return "Noop called", nil | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package utils | ||
|
||
// A lookup table for name -> function | ||
// Functions are pretty generic. | ||
// Accepts a string of args (todo: make this more generic) | ||
// there are no timeouts yet (todo) | ||
// each function is supposed to handle its own arg structure and how to parse it. | ||
// todo | ||
// there has to be a better way to do this with interfaces and gorotines and channels | ||
|
||
type FunctionLut map[string]func(string) (string, error) | ||
|
||
func (flut FunctionLut) Add(fname string, f func(string) (string, error)) FunctionLut { | ||
flut[fname] = f | ||
|
||
return flut | ||
} |