dnspath

package
v0.7.5 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultDuration = 10 * time.Second
	DefaultSchema   = "http"
)

Functions

This section is empty.

Types

type DNSPath

type DNSPath struct {
	Paths []*Path `cfg:"paths"`
}

DNSPath is a middleware that replaces the path of the request with hostname to IP address.

func (*DNSPath) ForwardRequest

func (m *DNSPath) ForwardRequest(w http.ResponseWriter, r *http.Request, target *url.URL, transport http.RoundTripper)

func (*DNSPath) Middleware

func (m *DNSPath) Middleware() (func(http.Handler) http.Handler, error)

func (*DNSPath) ReplaceRequest

func (m *DNSPath) ReplaceRequest(r *http.Request) (*url.URL, http.RoundTripper)

type IPHolder

type IPHolder struct {
	// contains filtered or unexported fields
}

func NewIPHolder

func NewIPHolder() *IPHolder

func (*IPHolder) Dump added in v0.7.4

func (h *IPHolder) Dump() string

func (*IPHolder) Get

func (h *IPHolder) Get(i int) string

func (*IPHolder) GetStr

func (h *IPHolder) GetStr(i string) string

func (*IPHolder) Set

func (h *IPHolder) Set(ips []net.IP)

type Number

type Number struct {
	Map   map[int]struct{}
	Slice []int
}

func NewNumber

func NewNumber(length int) *Number

func (*Number) Delete

func (n *Number) Delete(number int)

func (*Number) Order

func (n *Number) Order()

func (*Number) Pop

func (n *Number) Pop() int

func (*Number) Set

func (n *Number) Set(number int)

type Path

type Path struct {
	DNS string `cfg:"dns"`
	// Regex to match the path
	// Example: /metrics/kafka/(\d+)/(.*)
	Regex string `cfg:"regex"`
	// Number to extract in regex
	// Example: $1
	Number      string `cfg:"number"`
	Replacement string `cfg:"replacement"`

	Schema             string        `cfg:"schema"`
	Port               string        `cfg:"port"`
	InsecureSkipVerify bool          `cfg:"insecure_skip_verify"`
	Duration           time.Duration `cfg:"duration"`
	// contains filtered or unexported fields
}

func (*Path) DNSFetch

func (p *Path) DNSFetch()

func (*Path) IsFetched added in v0.7.4

func (p *Path) IsFetched() bool

Jump to

Keyboard shortcuts

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