site

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: May 11, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

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

View Source
const (
	ActionBlock     Action = "BLOCK"
	ActionAllow            = "ALLOW"
	ActionCaptcha          = "CAPTCHA"
	ActionHandshake        = "HANDSHAKE"
	ActionMonitor          = "MONITOR"
	ActionGateway          = "GATEWAY"
	ActionUnknown          = "UNKNOWN"
)
View Source
const (
	FeatureCDN       Feature = "CDN"
	FeatureWAF               = "WAF"
	FeatureDNS               = "DNS"
	FeatureScripting         = "Scripting"
	FeatureUnknown           = "UNKNOWN"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Action added in v0.0.3

type Action string

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"`
}

func (Condition) IsIPOnly added in v0.0.3

func (c Condition) IsIPOnly() bool

func (Condition) String added in v0.0.5

func (c Condition) String() string

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 DeliveryDomain struct {
	Domain    string `json:"domain"`
	Validated string `json:"validatedAt"`
}

type Feature

type Feature string

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

type IPRangeCondition struct {
	Begin string `json:"lowerBound"`
	End   string `json:"upperBound"`
}

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) GetAction added in v0.0.3

func (r Rule) GetAction() Action

func (Rule) IsIPOnlyRule added in v0.0.3

func (r Rule) IsIPOnlyRule() bool

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 (s Site) GetFeatures() []Feature

func (Site) HasFeature

func (s Site) HasFeature(feat Feature) bool

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

type URLCondition struct {
	URL        string `json:"url"`
	ExactMatch bool   `json:"exactMatch"`
}

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

Jump to

Keyboard shortcuts

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