Documentation
¶
Overview ¶
* GoStack API Client * * Copyright 2023 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 2020 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.
* GoStack API Client * * Copyright 2020 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
- type Action
- type Condition
- type ContentTypeCondition
- type CountryCondition
- type DeliveryDomain
- type Feature
- type FileExtensionCondition
- type HTTPMethodCondition
- type HeaderLiteralCondition
- type HeaderValueCondition
- type IPCondition
- type IPRangeCondition
- type MaybeEmpty
- type OrganizationCondition
- type OwnerTypeCondition
- type RequestRateCondition
- type Rule
- type SessionRequestCondition
- type Site
- type TagCondition
- type URLCondition
- type UserAgentCondition
Constants ¶
const ( ActionBlock Action = "BLOCK" ActionAllow = "ALLOW" ActionCaptcha = "CAPTCHA" ActionHandshake = "HANDSHAKE" ActionMonitor = "MONITOR" ActionGateway = "GATEWAY" ActionUnknown = "UNKNOWN" )
const ( FeatureCDN Feature = "CDN" FeatureWAF = "WAF" FeatureDNS = "DNS" FeatureScripting = "Scripting" FeatureUnknown = "UNKNOWN" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Condition ¶ added in v0.0.3
type Condition struct { IP IPCondition `json:"ip"` IPRange IPRangeCondition `json:"ipRange"` URL URLCondition `json:"url"` UserAgent UserAgentCondition `json:"userAgent"` Header HeaderValueCondition `json:"header"` HeaderExists HeaderLiteralCondition `json:"headerExists"` ResponseHeader HeaderValueCondition `json:"responseHeader"` ResponseHeaderExists HeaderLiteralCondition `json:"responseHeaderExists"` HTTPMethod HTTPMethodCondition `json:"httpMethod"` FileExtension FileExtensionCondition `json:"fileExtension"` ContentType ContentTypeCondition `json:"contentType"` Country CountryCondition `json:"country"` Organization OrganizationCondition `json:"organization"` RequestRate RequestRateCondition `json:"requestRate"` OwnerTypes OwnerTypeCondition `json:"ownerTypes"` Tags TagCondition `json:"tags"` RequestCount SessionRequestCondition `json:"sessionRequestCount"` Negation bool `json:"negation"` }
type ContentTypeCondition ¶ added in v0.0.3
type ContentTypeCondition struct {
Type string `json:"contentType"`
}
func (ContentTypeCondition) IsEmpty ¶ added in v0.0.3
func (c ContentTypeCondition) IsEmpty() bool
func (ContentTypeCondition) String ¶ added in v0.0.5
func (c ContentTypeCondition) String() string
type CountryCondition ¶ added in v0.0.3
type CountryCondition struct {
Code string `json:"countryCode"`
}
func (CountryCondition) IsEmpty ¶ added in v0.0.3
func (c CountryCondition) IsEmpty() bool
func (CountryCondition) String ¶ added in v0.0.5
func (c CountryCondition) String() string
type DeliveryDomain ¶
type FileExtensionCondition ¶ added in v0.0.3
type FileExtensionCondition struct {
Extension string `json:"fileExtension"`
}
func (FileExtensionCondition) IsEmpty ¶ added in v0.0.3
func (f FileExtensionCondition) IsEmpty() bool
func (FileExtensionCondition) String ¶ added in v0.0.5
func (f FileExtensionCondition) String() string
type HTTPMethodCondition ¶ added in v0.0.3
type HTTPMethodCondition struct {
Method string `json:"httpMethod"`
}
func (HTTPMethodCondition) IsEmpty ¶ added in v0.0.3
func (h HTTPMethodCondition) IsEmpty() bool
func (HTTPMethodCondition) String ¶ added in v0.0.5
func (h HTTPMethodCondition) String() string
type HeaderLiteralCondition ¶ added in v0.0.3
type HeaderLiteralCondition struct {
Header string `json:"header"`
}
func (HeaderLiteralCondition) IsEmpty ¶ added in v0.0.3
func (h HeaderLiteralCondition) IsEmpty() bool
func (HeaderLiteralCondition) String ¶ added in v0.0.5
func (h HeaderLiteralCondition) String() string
type HeaderValueCondition ¶ added in v0.0.3
type HeaderValueCondition struct { Header string `json:"header"` Value string `json:"value"` ExactMatch bool `json:"exactMatch"` }
func (HeaderValueCondition) IsEmpty ¶ added in v0.0.3
func (h HeaderValueCondition) IsEmpty() bool
func (HeaderValueCondition) String ¶ added in v0.0.5
func (h HeaderValueCondition) String() string
type IPCondition ¶ added in v0.0.3
type IPCondition struct {
IP string `json:"ipAddress"`
}
func (IPCondition) IsEmpty ¶ added in v0.0.3
func (i IPCondition) IsEmpty() bool
func (IPCondition) String ¶ added in v0.0.5
func (i IPCondition) String() string
type IPRangeCondition ¶ added in v0.0.3
func (IPRangeCondition) IsEmpty ¶ added in v0.0.3
func (i IPRangeCondition) IsEmpty() bool
func (IPRangeCondition) String ¶ added in v0.0.5
func (i IPRangeCondition) String() string
type MaybeEmpty ¶ added in v0.0.3
type MaybeEmpty interface {
IsEmpty() bool
}
type OrganizationCondition ¶ added in v0.0.3
type OrganizationCondition struct {
Organization string `json:"organization"`
}
func (OrganizationCondition) IsEmpty ¶ added in v0.0.3
func (o OrganizationCondition) IsEmpty() bool
func (OrganizationCondition) String ¶ added in v0.0.5
func (o OrganizationCondition) String() string
type OwnerTypeCondition ¶ added in v0.0.3
type OwnerTypeCondition struct {
Types []string `json:"ownerTypes"`
}
func (OwnerTypeCondition) IsEmpty ¶ added in v0.0.3
func (o OwnerTypeCondition) IsEmpty() bool
func (OwnerTypeCondition) String ¶ added in v0.0.5
func (o OwnerTypeCondition) String() string
type RequestRateCondition ¶ added in v0.0.3
type RequestRateCondition struct { Ips []string `json:"ips"` HTTPMethods []string `json:"httpMethods"` PathPattern string `json:"pathPattern"` Requests string `json:"requests"` Time string `json:"time"` }
func (RequestRateCondition) IsEmpty ¶ added in v0.0.3
func (r RequestRateCondition) IsEmpty() bool
func (RequestRateCondition) String ¶ added in v0.0.5
func (r RequestRateCondition) String() string
type Rule ¶ added in v0.0.3
type Rule struct { Id string `json:"id"` Name string `json:"name"` Description string `json:"description"` Conditions []Condition `json:"conditions"` Action string `json:"action"` Enabled bool `json:"enabled"` ActionDuration string `json:"actionDuration"` StatusCode string `json:"statusCode"` }
func (Rule) IsIPOnlyRule ¶ added in v0.0.3
type SessionRequestCondition ¶ added in v0.0.3
type SessionRequestCondition struct {
Count string `json:"requestCount"`
}
func (SessionRequestCondition) IsEmpty ¶ added in v0.0.3
func (s SessionRequestCondition) IsEmpty() bool
func (SessionRequestCondition) String ¶ added in v0.0.5
func (s SessionRequestCondition) String() string
type Site ¶
type Site struct { Id string `json:"id"` Label string `json:"label"` Features []string `json:"features"` ApiUrls []string `json:"apiUrls"` Monitoring bool `json:"monitoring"` Created string `json:"createdAt"` Updated string `json:"updatedAt"` Status string `json:"status"` }
func (Site) GetFeatures ¶ added in v0.0.3
func (Site) HasFeature ¶
type TagCondition ¶ added in v0.0.3
type TagCondition struct {
Tags []string `json:"tags"`
}
func (TagCondition) IsEmpty ¶ added in v0.0.3
func (t TagCondition) IsEmpty() bool
func (TagCondition) String ¶ added in v0.0.5
func (t TagCondition) String() string
type URLCondition ¶ added in v0.0.3
func (URLCondition) IsEmpty ¶ added in v0.0.3
func (u URLCondition) IsEmpty() bool
func (URLCondition) String ¶ added in v0.0.5
func (u URLCondition) String() string
type UserAgentCondition ¶ added in v0.0.3
type UserAgentCondition struct { UserAgent string `json:"userAgent"` ExactMatch bool `json:"exactMatch"` }
func (UserAgentCondition) IsEmpty ¶ added in v0.0.3
func (u UserAgentCondition) IsEmpty() bool
func (UserAgentCondition) String ¶ added in v0.0.5
func (u UserAgentCondition) String() string