Documentation
¶
Index ¶
Constants ¶
View Source
const (
// CloudFlareURL main API URL - for resty only
CloudFlareURL = "https://api.cloudflare.com/client/v4"
)
Variables ¶
This section is empty.
Functions ¶
func ListZones ¶
func ListZones(token, email string) []cloudflare.Zone
get all our zones uses cloudflare-go library
Types ¶
type ListWAFevents ¶
type ListWAFevents struct {
Pages []WAFevents
}
list of WAFevents
func GetAllZoneWAFevents ¶
func (*ListWAFevents) GetActionCount ¶
func (list *ListWAFevents) GetActionCount(filter string) int
count with filter by Action for list
func (*ListWAFevents) GetResultCount ¶
func (list *ListWAFevents) GetResultCount() int
get count of result events for list
func (*ListWAFevents) GetSourceCount ¶
func (list *ListWAFevents) GetSourceCount(filter string) int
count with filter by Source for list
type WAFevents ¶
type WAFevents struct {
Result []struct {
RayID string `json:"ray_id"`
Kind string `json:"kind"`
Source string `json:"source"`
Action string `json:"action"`
RuleID string `json:"rule_id"`
IP string `json:"ip"`
IPClass string `json:"ip_class"`
Country string `json:"country"`
Colo string `json:"colo"`
Host string `json:"host"`
Method string `json:"method"`
Proto string `json:"proto"`
Scheme string `json:"scheme"`
Ua string `json:"ua"`
URI string `json:"uri"`
Match []struct {
RuleID string `json:"rule_id"`
Source string `json:"source"`
Action string `json:"action"`
Metadata struct {
IPClass string `json:"ip_class"`
} `json:"metadata"`
} `json:"matches"`
OccurredAt string `json:"occurred_at"`
} `json:"result"`
ResultInfo struct {
Cursors struct {
After string `json:"after"`
Before string `json:"before"`
} `json:"cursors"`
ScannedRange struct {
Since string `json:"since"`
Until string `json:"until"`
} `json:"scanned_range"`
} `json:"result_info"`
Success bool `json:"success"`
Errors []struct {
Code int `json:"code"`
Message string `json:"message"`
} `json:"errors"`
Messages []string `json:"messages"`
}
WAFevents main structure of response data of WAF events page
func GetPageZoneWAFevents ¶
func GetPageZoneWAFevents(token, email, zoneID, cursor string, moment time.Time, duration time.Duration) (WAFevents, error)
get part events for WAF and Firewall for one separate zone uses resty library and WAFevents structure
func (*WAFevents) GetActionCount ¶
count with filter by Action
func (*WAFevents) GetResultCount ¶
get count of result events
func (*WAFevents) GetSourceCount ¶
count with filter by Source
Click to show internal directories.
Click to hide internal directories.