Documentation
¶
Index ¶
- Constants
- Variables
- type Config
- type MaxMindConfig
- type MaxMindDatabaseType
- type TCPListener
- type UDPListener
- func (s *UDPListener) Close() error
- func (s *UDPListener) LocalAddr() net.Addr
- func (s *UDPListener) ReadFrom(p []byte) (int, net.Addr, error)
- func (s *UDPListener) SetDeadline(t time.Time) error
- func (s *UDPListener) SetReadDeadline(t time.Time) error
- func (s *UDPListener) SetWriteDeadline(t time.Time) error
- func (s *UDPListener) WriteTo(p []byte, addr net.Addr) (int, error)
Constants ¶
View Source
const ( ACLAllow = "allow" ACLDeny = "deny" )
View Source
const ( MatcherTypeIP = "ip" MatcherTypeCIDR = "cidr" MatcherTypeTimeZone = "tz" MatcherTypeCountry = "country" )
Variables ¶
View Source
var ( ErrResponseNotOK = gperr.New("response not OK") ErrDownloadFailure = gperr.New("download failure") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Default string `json:"default" validate:"omitempty,oneof=allow deny"` // default: allow AllowLocal *bool `json:"allow_local"` // default: true Allow []string `json:"allow"` Deny []string `json:"deny"` Log *accesslog.ACLLoggerConfig `json:"log"` MaxMind *MaxMindConfig `json:"maxmind" validate:"omitempty"` // contains filtered or unexported fields }
func (*Config) WrapUDP ¶
func (cfg *Config) WrapUDP(lis net.PacketConn) net.PacketConn
type MaxMindConfig ¶
type MaxMindConfig struct { AccountID string `json:"account_id" validate:"required"` LicenseKey string `json:"license_key" validate:"required"` Database MaxMindDatabaseType `json:"database" validate:"required,oneof=geolite geoip2"` // contains filtered or unexported fields }
func (*MaxMindConfig) LoadMaxMindDB ¶
func (cfg *MaxMindConfig) LoadMaxMindDB(parent task.Parent) gperr.Error
type MaxMindDatabaseType ¶
type MaxMindDatabaseType string
const ( MaxMindGeoLite MaxMindDatabaseType = "geolite" MaxMindGeoIP2 MaxMindDatabaseType = "geoip2" )
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
func (*TCPListener) Addr ¶
func (s *TCPListener) Addr() net.Addr
func (*TCPListener) Close ¶
func (s *TCPListener) Close() error
type UDPListener ¶
type UDPListener struct {
// contains filtered or unexported fields
}
func (*UDPListener) Close ¶
func (s *UDPListener) Close() error
func (*UDPListener) LocalAddr ¶
func (s *UDPListener) LocalAddr() net.Addr
func (*UDPListener) SetDeadline ¶
func (s *UDPListener) SetDeadline(t time.Time) error
func (*UDPListener) SetReadDeadline ¶
func (s *UDPListener) SetReadDeadline(t time.Time) error
func (*UDPListener) SetWriteDeadline ¶
func (s *UDPListener) SetWriteDeadline(t time.Time) error
Source Files
¶
Click to show internal directories.
Click to hide internal directories.