endpoint

package
v0.0.0-...-b35749e Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2023 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Endpoint

type Endpoint struct {
	// IpAddrSource - describe where from to take client IP address
	IpAddrSource IpAddrSource `yaml:"ip-source"`
	// Middlewares additionally do some checks for incoming requests
	// Like password protection or DDoS prevention
	Middlewares           map[string]middleware.InterfaceWrapper `yaml:"middlewares"`
	DurationSeconds       common.DurationSeconds                 `yaml:"duration"`
	Port                  uint16                                 `yaml:"port"`
	Protocol              firewallField.Protocol                 `yaml:"protocol"`
	ResponseCodeOnSuccess uint16                                 `yaml:"response-code-on-success"`
}

func EndpointNewFromConfig

func EndpointNewFromConfig(value *yaml.Node) (Endpoint, error)

func (Endpoint) GetHash

func (ctx Endpoint) GetHash(url string) string

func (*Endpoint) RegisterMiddlewares

func (ctx *Endpoint) RegisterMiddlewares(input http.HandlerFunc) http.HandlerFunc

func (*Endpoint) SetDefaults

func (ctx *Endpoint) SetDefaults()

type IpAddrSource

type IpAddrSource struct {
	Type      IpSourceType `yaml:"type"`
	FieldName string       `yaml:"field-name"`
}

func (*IpAddrSource) GetFromRequest

func (ctx *IpAddrSource) GetFromRequest(r *http.Request) (firewallField.Address, error)

func (*IpAddrSource) SetDefaults

func (ctx *IpAddrSource) SetDefaults()

type IpSourceType

type IpSourceType string
const (
	IP_SOURCE_TYPE_WEB_SERVER         IpSourceType = "web-server"
	IP_SOURCE_TYPE_HTTP_HEADERS       IpSourceType = "http-headers"
	IP_SOURCE_TYPE_HTTP_REQUEST_PARAM IpSourceType = "http-request-param"
)

func (*IpSourceType) UnmarshalYAML

func (ctx *IpSourceType) UnmarshalYAML(unmarshal func(interface{}) error) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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