waf

package
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

* GoStack API Client * * Copyright 2022 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* GoStack API Client * * Copyright 2021 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

* GoStack API Client * * Copyright 2022 Christopher O'Connell * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CountableStatistic

type CountableStatistic interface {
	GetCount() (int64, error)
	MustGetCount() int
}

type DDoS added in v0.0.4

type DDoS struct {
	Global    string `json:"globalThreshold"`
	Burst     string `json:"burstThreshold"`
	SubSecond string `json:"subSecondBurstThreshold"`
}

func (DDoS) GetBurst added in v0.0.4

func (d DDoS) GetBurst() (int64, error)

func (DDoS) GetGlobal added in v0.0.4

func (d DDoS) GetGlobal() (int64, error)

func (DDoS) GetSubSecond added in v0.0.4

func (d DDoS) GetSubSecond() (int64, error)

func (DDoS) MustGetBurst added in v0.0.4

func (d DDoS) MustGetBurst() int

func (DDoS) MustGetGlobal added in v0.0.4

func (d DDoS) MustGetGlobal() int

func (DDoS) MustGetSubSecond added in v0.0.4

func (d DDoS) MustGetSubSecond() int

type Interval added in v0.0.3

type Interval time.Duration
const (
	IntervalMinutely Interval = Interval(time.Minute)
	IntervalHourly   Interval = Interval(time.Hour)
	IntervalDaily    Interval = Interval(time.Hour * 24)
)

func (Interval) String added in v0.0.3

func (i Interval) String() string

type NumericTrafficEntry added in v0.0.3

type NumericTrafficEntry struct {
	Timestamp         time.Time
	Api               uint64
	Ajax              uint64
	Static            uint64
	CustomBlocked     uint64
	PolicyBlocked     uint64
	DdosBlocked       uint64
	Monitored         uint64
	CustomWhitelisted uint64
	PolicyWhitelisted uint64
	OriginError4xx    uint64
	OriginError5xx    uint64
	OriginTimeout     uint64
	Uncategorized     uint64
	PassedToOrigin    uint64
	ResponseTime      float64
	Total             uint64
}

func (NumericTrafficEntry) IsEmpty added in v0.0.3

func (n NumericTrafficEntry) IsEmpty() bool

type RequestDetails

type RequestDetails struct {
	Id              string `json:"id"`
	Path            string `json:"path"`
	ClientIPString  string `json:"clientIp"`
	Method          string `json:"method"`
	StatusCode      string `json:"statusCode"`
	RuleName        string `json:"ruleName"`
	CountryCode     string `json:"country"`
	Action          string `json:"action"`
	Result          string `json:"result"`
	RuleID          string `json:"ruleId"`
	UserAgent       string `json:"userAgent"`
	UserAgentClient string `json:"userAgentClient"`
	Organization    string `json:"organization"`
	RequestTime     string `json:"requestTime"`
	ReferenceID     string `json:"referenceId"`
}

type RequestStatistics

type RequestStatistics struct {
	Total   RequestStatisticsData `json:"count"`
	Blocked RequestStatisticsData `json:"blocked"`
}

type RequestStatisticsAction

type RequestStatisticsAction struct {
	Action string `json:"action"`
	Count  string `json:"count"`
}

func (RequestStatisticsAction) GetCount

func (r RequestStatisticsAction) GetCount() (int64, error)

func (RequestStatisticsAction) MustGetCount

func (r RequestStatisticsAction) MustGetCount() int

type RequestStatisticsCountry

type RequestStatisticsCountry struct {
	Country     string `json:"country"`
	CountryCode string `json:"countryCode"`
	Count       string `json:"count"`
}

func (RequestStatisticsCountry) GetCount

func (r RequestStatisticsCountry) GetCount() (int64, error)

func (RequestStatisticsCountry) MustGetCount

func (r RequestStatisticsCountry) MustGetCount() int

type RequestStatisticsData

type RequestStatisticsData struct {
	Rules         []RequestStatisticsRule         `json:"rules"`
	Countries     []RequestStatisticsCountry      `json:"countries"`
	Organizations []RequestStatisticsOrganization `json:"organizations"`
	Actions       []RequestStatisticsAction       `json:"actions"`
}

type RequestStatisticsOrganization

type RequestStatisticsOrganization struct {
	Organization string `json:"organization"`
	Count        string `json:"count"`
}

func (RequestStatisticsOrganization) GetCount

func (r RequestStatisticsOrganization) GetCount() (int64, error)

func (RequestStatisticsOrganization) MustGetCount

func (r RequestStatisticsOrganization) MustGetCount() int

type RequestStatisticsRule

type RequestStatisticsRule struct {
	RuleName string `json:"ruleName"`
	Count    string `json:"count"`
}

func (RequestStatisticsRule) GetCount

func (r RequestStatisticsRule) GetCount() (int64, error)

func (RequestStatisticsRule) MustGetCount

func (r RequestStatisticsRule) MustGetCount() int

type TrafficEntry added in v0.0.3

type TrafficEntry struct {
	Timestamp         string `json:"timestamp"`
	Api               string `json:"api"`
	Ajax              string `json:"ajax"`
	Static            string `json:"static"`
	CustomBlocked     string `json:"customBlocked"`
	PolicyBlocked     string `json:"policyBlocked"`
	DdosBlocked       string `json:"ddosBlocked"`
	Monitored         string `json:"monitored"`
	CustomWhitelisted string `json:"customWhitelisted"`
	PolicyWhitelisted string `json:"policyWhitelisted"`
	OriginError4xx    string `json:"originError4xx"`
	OriginError5xx    string `json:"originError5xx"`
	OriginTimeout     string `json:"originTimeout"`
	Uncategorized     string `json:"uncategorized"`
	PassedToOrigin    string `json:"passedToOrigin"`
	ResponseTime      string `json:"responseTime"`
	Total             string `json:"total"`
}

func (TrafficEntry) Numeric added in v0.0.3

func (t TrafficEntry) Numeric() (ret NumericTrafficEntry, err error)

type TrafficItem added in v0.0.3

type TrafficItem struct {
	Traffic   TrafficEntry
	StartTime time.Time
	Interval  Interval
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL