Documentation ¶
Index ¶
- type AesCrypto
- type Cache
- type Cmd
- type ColorLogger
- type ConnMapCache
- type Crypto
- type DnsResolver
- type FileLogger
- func (fileLogger *FileLogger) Debug(f string, args ...interface{})
- func (fileLogger *FileLogger) Error(f string, args ...interface{})
- func (fileLogger *FileLogger) Info(f string, args ...interface{})
- func (fileLogger *FileLogger) Trace(f string, args ...interface{})
- func (fileLogger *FileLogger) Warn(f string, args ...interface{})
- type Logger
- type NullLogger
- type Plain
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AesCrypto ¶
type AesCrypto struct {
// contains filtered or unexported fields
}
func NewAesCrypto ¶
func (*AesCrypto) GetAlgorithm ¶
type ColorLogger ¶
type ColorLogger struct { }
ColorLogger - A Logger that logs to stdout in color
func (ColorLogger) Debug ¶
func (l ColorLogger) Debug(f string, args ...interface{})
Debug - Log a debug message
func (ColorLogger) Error ¶
func (l ColorLogger) Error(f string, args ...interface{})
func (ColorLogger) Info ¶
func (l ColorLogger) Info(f string, args ...interface{})
Info - Log a general message
func (ColorLogger) Trace ¶
func (l ColorLogger) Trace(f string, args ...interface{})
Trace - Log a very verbose trace message
func (ColorLogger) Warn ¶
func (l ColorLogger) Warn(f string, args ...interface{})
Warn - Log a warning
type ConnMapCache ¶
type ConnMapCache struct {
// contains filtered or unexported fields
}
func NewMapCache ¶
func NewMapCache() *ConnMapCache
func (*ConnMapCache) Delete ¶
func (mc *ConnMapCache) Delete(key uint64)
type DnsResolver ¶
type DnsResolver struct { Servers []string RetryTimes int // OnCacheMiss is executed if the host or address is not included in // the cache and the default lookup is executed. OnCacheMiss func() // contains filtered or unexported fields }
DnsResolver represents a dns resolver
func NewDnsResolver ¶
func NewDnsResolver(servers []string) *DnsResolver
New initializes DnsResolver.
func NewDnsResolverFromConf ¶
func NewDnsResolverFromConf(path string) (*DnsResolver, error)
NewDnsResolverFromConf initializes DnsResolver from resolv.conf like file.
func (*DnsResolver) LookupHost ¶
func (r *DnsResolver) LookupHost(host string) ([]net.IP, error)
LookupHost returns IP addresses of provide host. In case of timeout retries query RetryTimes times.
func (*DnsResolver) Refresh ¶
func (r *DnsResolver) Refresh(clearUnused bool)
Refresh refreshes cached entries which has been used at least once since the last Refresh. If clearUnused is true, entries which hasn't be used since the last Refresh are removed from the cache.
type FileLogger ¶
type FileLogger struct {
// contains filtered or unexported fields
}
func NewFileLogger ¶
func NewFileLogger(logFileName, errorLogFileName string) *FileLogger
func (*FileLogger) Debug ¶
func (fileLogger *FileLogger) Debug(f string, args ...interface{})
Debug - no-op
func (*FileLogger) Error ¶
func (fileLogger *FileLogger) Error(f string, args ...interface{})
func (*FileLogger) Info ¶
func (fileLogger *FileLogger) Info(f string, args ...interface{})
Info - no-op
func (*FileLogger) Trace ¶
func (fileLogger *FileLogger) Trace(f string, args ...interface{})
Trace - no-op
func (*FileLogger) Warn ¶
func (fileLogger *FileLogger) Warn(f string, args ...interface{})
Warn - no-op
type NullLogger ¶
type NullLogger struct{}
NullLogger - An empty logger that ignores everything
func (NullLogger) Error ¶
func (l NullLogger) Error(f string, args ...interface{})