Documentation ¶
Index ¶
- Constants
- Variables
- func Difference(a, b []string) []string
- func EqualStringSlices(a, b []string) bool
- func GetFirstKey(data any, searchKey string, defaultValue any) any
- func GetKeys(data any, searchKey string, maxMatches int) []any
- func GetRequiredOutputs() []string
- func Intersect(a, b []string) []string
- func JsonCompact(v any) string
- func LoadPlugins[T any](paths []string) ([]T, error)
- func MergeRequiredOutputs(userConfig map[string]map[string]string, prefix string) map[string]map[string]string
- type OutputRequestFailure
- type RequestHelper
- func (h *RequestHelper) CatchExceptions() []any
- func (h *RequestHelper) CheckHTTPResponse(response *http.Response) bool
- func (h *RequestHelper) GetRequest(url string, headers map[string]string) (*http.Response, error)
- func (h *RequestHelper) GetRequestRetry(url string, headers map[string]string, exceptions []any) (*http.Response, error)
- func (h *RequestHelper) PostRequest(url string, headers map[string]string, data any) (*http.Response, error)
- func (h *RequestHelper) PostRequestRetry(url string, headers map[string]string, data any, exceptions []any) (*http.Response, error)
- func (h *RequestHelper) PutRequest(url string, headers map[string]string, data any) (*http.Response, error)
- func (h *RequestHelper) PutRequestRetry(url string, headers map[string]string, data any, exceptions []any) (*http.Response, error)
- func (h *RequestHelper) RetryOnException(fn func() (*http.Response, error), exceptions []any) (*http.Response, error)
Constants ¶
View Source
const ( MaxRetryAttempts = 5 DefaultRequestTimeout = 3*time.Second + 50*time.Millisecond // Close to 3.05 DefaultServiceURL = "https://example.com/api" // Replace with actual URL )
View Source
const DATETIME_FORMAT = "2006-01-02T15:04:05.000Z"
Variables ¶
View Source
var REQUIRED_OUTPUTS = map[string]map[string]string{
"aws-firehose": {
"alerts": "{prefix}_streamalert_alert_delivery",
},
}
Functions ¶
func Difference ¶
difference returns the difference of two slices (a - b)
func EqualStringSlices ¶
EqualStringSlices checks if two string slices are equal
func GetKeys ¶
GetKeys searches for a key anywhere in the nested data structure, returning all associated values.
func GetRequiredOutputs ¶
func GetRequiredOutputs() []string
GetRequiredOutputs iterates through the required outputs and collapses to the right format
func JsonCompact ¶
func LoadPlugins ¶
Types ¶
type OutputRequestFailure ¶
func (*OutputRequestFailure) Error ¶
func (e *OutputRequestFailure) Error() string
type RequestHelper ¶
type RequestHelper struct{}
func (*RequestHelper) CatchExceptions ¶
func (h *RequestHelper) CatchExceptions() []any
func (*RequestHelper) CheckHTTPResponse ¶
func (h *RequestHelper) CheckHTTPResponse(response *http.Response) bool
func (*RequestHelper) GetRequest ¶
func (*RequestHelper) GetRequestRetry ¶
func (*RequestHelper) PostRequest ¶
func (*RequestHelper) PostRequestRetry ¶
func (*RequestHelper) PutRequest ¶
func (*RequestHelper) PutRequestRetry ¶
func (*RequestHelper) RetryOnException ¶
Click to show internal directories.
Click to hide internal directories.