app

package
v0.0.0-...-8223df7 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2024 License: GPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DiscordReporter

type DiscordReporter struct {
	Channel string
	Geo     *Geo
	// contains filtered or unexported fields
}

func NewDiscordReporter

func NewDiscordReporter(botToken string, channel string, geo *Geo) (*DiscordReporter, error)

func (*DiscordReporter) CannotDial

func (r *DiscordReporter) CannotDial(service string, ipaddress string, err error)

func (*DiscordReporter) ReportAccepted

func (r *DiscordReporter) ReportAccepted(service string, ipaddress string)

func (*DiscordReporter) ReportBlocked

func (r *DiscordReporter) ReportBlocked(service string, ipaddress string, rule string)

type Geo

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

func NewGeo

func NewGeo(filename string) (*Geo, error)

func (*Geo) City

func (g *Geo) City(address string) string

func (*Geo) Country

func (g *Geo) Country(address string) string

type Middleware

type Middleware struct {
	Rule string
	// contains filtered or unexported fields
}

func NewMiddleware

func NewMiddleware(rule string, geo *Geo) (*Middleware, error)

func (*Middleware) Passes

func (m *Middleware) Passes(address string) bool

type Proxy

type Proxy struct {
	Middleware []Middleware
	Listen     string
	Upstream   string
	Name       string

	Reporter *DiscordReporter
}

func NewProxy

func NewProxy(middleware []Middleware, listen string, upstream string, name string, reporter *DiscordReporter) *Proxy

func (*Proxy) ListenAndServe

func (p *Proxy) ListenAndServe() error

type ProxyBooter

type ProxyBooter struct {
	Proxies []Proxy
}

func NewProxyBooter

func NewProxyBooter(proxies []Proxy) *ProxyBooter

func (*ProxyBooter) BootAll

func (p *ProxyBooter) BootAll()

Jump to

Keyboard shortcuts

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