utils

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2025 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResponseGood    = DNSBLResponse(0)
	ResponseUnknown = DNSBLResponse(255)
)

Variables

View Source
var CookiePrefix = ".go-away-"

Functions

func ClearCookie

func ClearCookie(name string, w http.ResponseWriter)

func EnsureNoOpenRedirect

func EnsureNoOpenRedirect(redirect string) (string, error)

func MakeReverseProxy

func MakeReverseProxy(target string) (*httputil.ReverseProxy, error)

func SetCookie

func SetCookie(name, value string, expiry time.Time, w http.ResponseWriter)

Types

type DNSBL added in v0.3.0

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

func NewDNSBL added in v0.3.0

func NewDNSBL(target string, resolver *net.Resolver) *DNSBL

func (DNSBL) Lookup added in v0.3.0

func (bl DNSBL) Lookup(ctx context.Context, ip net.IP) (DNSBLResponse, error)

type DNSBLResponse added in v0.3.0

type DNSBLResponse uint8

func (DNSBLResponse) Bad added in v0.3.0

func (r DNSBLResponse) Bad() bool

type DecayMap added in v0.3.0

type DecayMap[K, V comparable] struct {
	// contains filtered or unexported fields
}

func NewDecayMap added in v0.3.0

func NewDecayMap[K, V comparable]() *DecayMap[K, V]

func (*DecayMap[K, V]) Decay added in v0.3.0

func (m *DecayMap[K, V]) Decay()

func (*DecayMap[K, V]) Get added in v0.3.0

func (m *DecayMap[K, V]) Get(key K) (V, bool)

func (*DecayMap[K, V]) Set added in v0.3.0

func (m *DecayMap[K, V]) Set(key K, value V, ttl time.Duration)

type DecayMapEntry added in v0.3.0

type DecayMapEntry[V comparable] struct {
	Value V
	// contains filtered or unexported fields
}

type UnixRoundTripper

type UnixRoundTripper struct {
	Transport *http.Transport
}

UnixRoundTripper https://github.com/oauth2-proxy/oauth2-proxy/blob/master/pkg/upstream/http.go#L124

func (UnixRoundTripper) RoundTrip

func (t UnixRoundTripper) RoundTrip(req *http.Request) (*http.Response, error)

RoundTrip set bare minimum stuff

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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