Versions in this module Expand all Collapse all v1 v1.0.1 Dec 12, 2024 Changes in this version + const IsRaceDetectorEnabled + const RFC3339Milli + const UDP_PACKET_WRITE_TIMEOUT + func Compress(data []byte) []byte + func Contains(list []string, target string) bool + func ContainsAny(list, targets []string) bool + func ContainsInt(list []int, target int) bool + func ContainsWildcard(patterns []string, target string) bool + func CopyBuffer(dst io.Writer, src io.Reader, buf []byte) (written int64, err error) + func CopyNBuffer(dst io.Writer, src io.Reader, n int64, buf []byte) (written int64, err error) + func Decompress(data []byte) ([]byte, error) + func EscapeRedactIPAddressString(address string) string + func FileExists(filePath string) bool + func FormatByteCount(bytes uint64) string + func GenerateAuthenticatedDataPackageKeys() (string, string, error) + func GenerateWebServerCertificate(hostname string) (string, string, string, error) + func GetCurrentTimestamp() string + func GetInterfaceIPAddresses(interfaceName string) (net.IP, net.IP, error) + func GetRoutableInterfaceIPAddresses() (net.IP, net.IP, error) + func GetStringSlice(value interface{}) ([]string, bool) + func IPAddressFromAddr(addr net.Addr) string + func IsBogon(IP net.IP) bool + func MakeSecureRandomBytes(length int) ([]byte, error) + func MaxDuration(durations ...time.Duration) time.Duration + func MergeContextCancel(ctx, cancelCtx context.Context) (context.Context, context.CancelFunc) + func NewAuthenticatedDataPackageReader(dataPackage io.ReadSeeker, signingPublicKey string) (io.Reader, error) + func ParseDNSQuestion(request []byte) (string, error) + func PortFromAddr(addr net.Addr) int + func ReadAuthenticatedDataPackage(dataPackage []byte, isCompressed bool, signingPublicKey string) (string, error) + func RedactFilePaths(s string, filePaths ...string) string + func RedactFilePathsError(err error, filePaths ...string) error + func RedactIPAddresses(b []byte) []byte + func RedactIPAddressesString(s string) string + func RedactNetError(err error) error + func RedactURLError(err error) error + func RunNetworkConfigCommand(logger Logger, useSudo bool, commandName string, commandArgs ...string) error + func SafeParseRequestURI(rawurl string) (*url.URL, error) + func SafeParseURL(rawurl string) (*url.URL, error) + func SleepWithContext(ctx context.Context, duration time.Duration) + func SleepWithJitter(ctx context.Context, duration time.Duration, jitter float64) + func TerminateHTTPConnection(responseWriter http.ResponseWriter, request *http.Request) + func TruncateTimestampToHour(timestamp string) string + func ValueOrDefault[T comparable](value, defaultValue T) T + func WriteAuthenticatedDataPackage(data string, signingPublicKey, signingPrivateKey string) ([]byte, error) + func WriteRuntimeProfiles(logger Logger, outputDirectory string, filenameSuffix string, ...) + type APIParameterLogFieldFormatter func(string, GeoIPData, APIParameters) LogFields + type APIParameterValidator func(APIParameters) error + type APIParameters map[string]interface + func (a APIParameters) Add(b APIParameters) + type ActivityMonitoredConn struct + func NewActivityMonitoredConn(conn net.Conn, inactivityTimeout time.Duration, activeOnWrite bool, ...) (*ActivityMonitoredConn, error) + func (conn *ActivityMonitoredConn) GetActiveDuration() time.Duration + func (conn *ActivityMonitoredConn) GetStartTime() time.Time + func (conn *ActivityMonitoredConn) IsClosed() bool + func (conn *ActivityMonitoredConn) Read(buffer []byte) (int, error) + func (conn *ActivityMonitoredConn) Write(buffer []byte) (int, error) + type ActivityUpdater interface + UpdateProgress func(bytesRead, bytesWritten, durationNanoseconds int64) + type AuthenticatedDataPackage struct + Data string + Signature []byte + SigningPublicKeyDigest []byte + type BurstMonitoredConn struct + func NewBurstMonitoredConn(conn net.Conn, isServer bool, upstreamTargetBytes int64, ...) *BurstMonitoredConn + func (conn *BurstMonitoredConn) GetMetrics(baseTime time.Time) LogFields + func (conn *BurstMonitoredConn) IsClosed() bool + func (conn *BurstMonitoredConn) Read(buffer []byte) (int, error) + func (conn *BurstMonitoredConn) Write(buffer []byte) (int, error) + type CloseWriter interface + CloseWrite func() error + type Closer interface + IsClosed func() bool + type Conns struct + func NewConns[T interface{ ... }]() *Conns[T] + func (conns *Conns[T]) Add(conn T) bool + func (conns *Conns[T]) CloseAll() + func (conns *Conns[T]) IsClosed() bool + func (conns *Conns[T]) Remove(conn T) + func (conns *Conns[T]) Reset() + type Dialer func(context.Context, string, string) (net.Conn, error) + type FragmentorAccessor interface + GetReplay func() (*prng.Seed, bool) + SetReplay func(*prng.PRNG) + StopFragmenting func() + type GeoIPData struct + ASN string + ASO string + City string + Country string + ISP string + type HTTPRoundTripper struct + func NewHTTPRoundTripper(roundTrip func(*http.Request) (*http.Response, error)) *HTTPRoundTripper + func (h HTTPRoundTripper) RoundTrip(request *http.Request) (*http.Response, error) + type IrregularIndicator interface + IrregularTunnelError func() error + type LRUConns struct + func NewLRUConns() *LRUConns + func (conns *LRUConns) Add(conn net.Conn) *LRUConnsEntry + func (conns *LRUConns) CloseOldest() + type LRUConnsEntry struct + func (entry *LRUConnsEntry) Remove() + func (entry *LRUConnsEntry) Touch() + type LogFields map[string]interface + func (a LogFields) Add(b LogFields) + type LogTrace interface + Debug func(args ...interface{}) + Error func(args ...interface{}) + Info func(args ...interface{}) + Warning func(args ...interface{}) + type Logger interface + IsLogLevelDebug func() bool + LogMetric func(metric string, fields LogFields) + WithTrace func() LogTrace + WithTraceFields func(fields LogFields) LogTrace + type MetricsSource interface + GetMetrics func() LogFields + type NetDialer interface + Dial func(network, address string) (net.Conn, error) + DialContext func(ctx context.Context, network, address string) (net.Conn, error) + type NoticeMetricsSource interface + GetNoticeMetrics func() LogFields + type PortList struct + func (p *PortList) IsEmpty() bool + func (p *PortList) Lookup(port int) bool + func (p *PortList) MarshalJSON() ([]byte, error) + func (p *PortList) OptimizeLookups() + func (p *PortList) UnmarshalJSON(b []byte) error + type RateLimits struct + CloseAfterExhausted bool + ReadBytesPerSecond int64 + ReadUnthrottledBytes int64 + WriteBytesPerSecond int64 + WriteUnthrottledBytes int64 + type ReloadableFile struct + func NewReloadableFile(filename string, loadFileContent bool, ...) ReloadableFile + func (reloadable *ReloadableFile) LogDescription() string + func (reloadable *ReloadableFile) Reload() (bool, error) + func (reloadable *ReloadableFile) WillReload() bool + type Reloader interface + LogDescription func() string + Reload func() (bool, error) + WillReload func() bool + type SubnetLookup []net.IPNet + func NewSubnetLookup(CIDRs []string) (SubnetLookup, error) + func NewSubnetLookupFromRoutes(routesData []byte) (SubnetLookup, error) + func (lookup SubnetLookup) ContainsIPAddress(addr net.IP) bool + func (lookup SubnetLookup) Len() int + func (lookup SubnetLookup) Less(i, j int) bool + func (lookup SubnetLookup) Swap(i, j int) + type TLSClientSessionCacheWrapper struct + func WrapClientSessionCache(cache tls.ClientSessionCache, hardCodedSessionKey string) *TLSClientSessionCacheWrapper + func (c *TLSClientSessionCacheWrapper) Get(_ string) (session *tls.ClientSessionState, ok bool) + func (c *TLSClientSessionCacheWrapper) Put(_ string, cs *tls.ClientSessionState) + func (c *TLSClientSessionCacheWrapper) RemoveCacheEntry() + type ThrottledConn struct + func NewThrottledConn(conn net.Conn, isStream bool, limits RateLimits) *ThrottledConn + func (conn *ThrottledConn) Close() error + func (conn *ThrottledConn) Read(buffer []byte) (int, error) + func (conn *ThrottledConn) SetLimits(limits RateLimits) + func (conn *ThrottledConn) Write(buffer []byte) (int, error) + type UnderlyingTCPAddrSource interface + GetUnderlyingTCPAddrs func() (*net.TCPAddr, *net.TCPAddr, bool) + type UtlsClientSessionCacheWrapper struct + func WrapUtlsClientSessionCache(cache utls.ClientSessionCache, hardCodedSessionKey string) *UtlsClientSessionCacheWrapper + func (c *UtlsClientSessionCacheWrapper) Get(_ string) (session *utls.ClientSessionState, ok bool) + func (c *UtlsClientSessionCacheWrapper) Put(_ string, cs *utls.ClientSessionState) + func (c *UtlsClientSessionCacheWrapper) RemoveCacheEntry() + type WriteTimeoutPacketConn struct + func (conn *WriteTimeoutPacketConn) GetMetrics() LogFields + func (conn *WriteTimeoutPacketConn) WriteTo(b []byte, addr net.Addr) (int, error) + type WriteTimeoutUDPConn struct + func (conn *WriteTimeoutUDPConn) Write(b []byte) (int, error) + func (conn *WriteTimeoutUDPConn) WriteMsgUDP(b, oob []byte, addr *net.UDPAddr) (int, int, error) + func (conn *WriteTimeoutUDPConn) WriteMsgUDPAddrPort(b, oob []byte, addr netip.AddrPort) (int, int, error) + func (conn *WriteTimeoutUDPConn) WriteTo(b []byte, addr net.Addr) (int, error) + func (conn *WriteTimeoutUDPConn) WriteToUDP(b []byte, addr *net.UDPAddr) (int, error) + func (conn *WriteTimeoutUDPConn) WriteToUDPAddrPort(b []byte, addr netip.AddrPort) (int, error)