Documentation
¶
Index ¶
- Variables
- func AskForConfirmation() bool
- func AuthKeyHash(key []byte) []byte
- func CloseChannelWithoutPanic(c chan tl.Object)
- func FmtIp(ipv6WithPort string) string
- func FmtMethod(data tl.Object) string
- func FullStack()
- func GenerateSessionID() int64
- func GetDefaultHostIp(dc int, test bool, ipv6 bool) string
- func MinSafeDuration(d int) time.Duration
- func NewMsgIDGenerator() func(timeOffset int64) int64
- func RandomBytes(size int) []byte
- func Sha1(input string) []byte
- func Sha1Byte(input []byte) []byte
- func Xor(dst, src []byte)
- type AudioInfo
- type DC
- type DCOptions
- type Hook
- type JSONFormatter
- type LogEntry
- type LogFormatter
- type LogLevel
- type Logger
- func (l *Logger) AddHook(hook Hook) *Logger
- func (l *Logger) Clone() *Logger
- func (l *Logger) Close() error
- func (l *Logger) Color() bool
- func (l *Logger) Debug(msg string, args ...any)
- func (l *Logger) DebugErr(err error)
- func (l *Logger) Debugf(format string, args ...any)
- func (l *Logger) EnableRotation(maxFileSize int64, logFilePath string) *Logger
- func (l *Logger) Error(msg string, args ...any)
- func (l *Logger) ErrorErr(err error)
- func (l *Logger) Errorf(format string, args ...any)
- func (l *Logger) Fatal(msg string, args ...any)
- func (l *Logger) Fatalf(format string, args ...any)
- func (l *Logger) Flush() error
- func (l *Logger) GetLevel() LogLevel
- func (l *Logger) GetPrefix() string
- func (l *Logger) Info(msg string, args ...any)
- func (l *Logger) Infof(format string, args ...any)
- func (l *Logger) Lev() LogLevel
- func (l *Logger) Panic(msg string, args ...any)
- func (l *Logger) Panicf(format string, args ...any)
- func (l *Logger) SetColor(enabled bool) *Logger
- func (l *Logger) SetFormatter(formatter LogFormatter) *Logger
- func (l *Logger) SetLevel(level LogLevel) *Logger
- func (l *Logger) SetOutput(w io.Writer) *Logger
- func (l *Logger) SetPrefix(prefix string) *Logger
- func (l *Logger) SetTimestampFormat(format string) *Logger
- func (l *Logger) ShowCaller(enabled bool) *Logger
- func (l *Logger) ShowFunction(enabled bool) *Logger
- func (l *Logger) Trace(msg string, args ...any)
- func (l *Logger) TraceErr(err error)
- func (l *Logger) Tracef(format string, args ...any)
- func (l *Logger) Warn(msg string, args ...any)
- func (l *Logger) WarnErr(err error)
- func (l *Logger) Warnf(format string, args ...any)
- func (l *Logger) Warning(msg string, args ...any)
- func (l *Logger) Warningf(format string, args ...any)
- func (l *Logger) WithError(err error) *Logger
- func (l *Logger) WithField(key string, value any) *Logger
- func (l *Logger) WithFields(fields map[string]any) *Logger
- func (l *Logger) WithPrefix(prefix string) *Logger
- type LoggerConfig
- type MKVInfo
- type MP4Info
- type PingParams
- type Proxy
- func (p *Proxy) GetHost() string
- func (p *Proxy) GetPassword() string
- func (p *Proxy) GetPort() int
- func (p *Proxy) GetSecret() string
- func (p *Proxy) GetType() string
- func (p *Proxy) GetUsername() string
- func (p *Proxy) IsEmpty() bool
- func (p *Proxy) String() string
- func (p *Proxy) ToURL() *url.URL
- type SyncIntObjectChan
- func (s *SyncIntObjectChan) Add(key int, value chan tl.Object)
- func (s *SyncIntObjectChan) Close()
- func (s *SyncIntObjectChan) Delete(key int) bool
- func (s *SyncIntObjectChan) Get(key int) (chan tl.Object, bool)
- func (s *SyncIntObjectChan) Has(key int) bool
- func (s *SyncIntObjectChan) Keys() []int
- func (s *SyncIntObjectChan) Reset()
- type SyncIntReflectTypes
- func (s *SyncIntReflectTypes) Add(key int, value []reflect.Type)
- func (s *SyncIntReflectTypes) Delete(key int) bool
- func (s *SyncIntReflectTypes) Get(key int) ([]reflect.Type, bool)
- func (s *SyncIntReflectTypes) Has(key int) bool
- func (s *SyncIntReflectTypes) Keys() []int
- func (s *SyncIntReflectTypes) Reset()
- type SyncSet
- func (s *SyncSet[T]) Add(key T) bool
- func (s *SyncSet[T]) Clear()
- func (s *SyncSet[T]) Clone() *SyncSet[T]
- func (s *SyncSet[T]) Delete(key T)
- func (s *SyncSet[T]) ForEach(fn func(key T) bool)
- func (s *SyncSet[T]) Has(key T) bool
- func (s *SyncSet[T]) Keys() []T
- func (s *SyncSet[T]) Len() int
- func (s *SyncSet[T]) Pop(key T) bool
- type TextFormatter
- type UpdatesGetStateParams
Constants ¶
This section is empty.
Variables ¶
View Source
var DcList = DCOptions{ DCS: map[int][]DC{ 1: {{"149.154.175.58:443", false}}, 2: {{"149.154.167.50:443", false}}, 3: {{"149.154.175.100:443", false}}, 4: {{"149.154.167.91:443", false}, {"[2001:067c:04e8:f002::a]:443", true}}, 5: {{"91.108.56.151:443", false}}, }, TestDCs: map[int]string{ 1: "149.154.175.10:443", 2: "149.154.167.40:443", 3: "149.154.175.117:443", }, CdnDCs: map[int][]DC{ 201: {{"91.108.23.100:443", false}}, 203: {{"91.105.192.100:443", false}, {"[2a0a:f280:0203:000a:5000:0000:0000:0100]:443", true}}, }, }
Functions ¶
func AskForConfirmation ¶
func AskForConfirmation() bool
func AuthKeyHash ¶
func GenerateSessionID ¶
func GenerateSessionID() int64
func MinSafeDuration ¶ added in v1.6.7
func NewMsgIDGenerator ¶
func RandomBytes ¶
Types ¶
type DCOptions ¶
func NewDCOptions ¶ added in v1.6.1
func NewDCOptions() *DCOptions
func (*DCOptions) GetCdnAddr ¶ added in v1.6.1
func (*DCOptions) SearchAddr ¶ added in v1.6.1
type JSONFormatter ¶ added in v1.6.7
JSONFormatter formats logs as JSON
func (*JSONFormatter) Format ¶ added in v1.6.7
func (f *JSONFormatter) Format(entry *LogEntry) string
type LogEntry ¶ added in v1.6.7
type LogEntry struct {
Time time.Time `json:"time"`
Level LogLevel `json:"level"`
Message string `json:"message"`
Prefix string `json:"prefix,omitempty"`
File string `json:"file,omitempty"`
Line int `json:"line,omitempty"`
Function string `json:"function,omitempty"`
Fields map[string]any `json:"fields,omitempty"`
Error error `json:"error,omitempty"`
StackTrace string `json:"stack_trace,omitempty"`
}
type LogFormatter ¶ added in v1.6.7
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
func NewLoggerWithConfig ¶ added in v1.6.7
func NewLoggerWithConfig(config *LoggerConfig) *Logger
func (*Logger) EnableRotation ¶ added in v1.6.7
func (*Logger) SetFormatter ¶ added in v1.6.7
func (l *Logger) SetFormatter(formatter LogFormatter) *Logger
func (*Logger) SetTimestampFormat ¶ added in v1.6.7
func (*Logger) ShowCaller ¶ added in v1.6.7
func (*Logger) ShowFunction ¶ added in v1.6.7
func (*Logger) WithFields ¶ added in v1.6.7
func (*Logger) WithPrefix ¶ added in v1.6.7
type LoggerConfig ¶ added in v1.6.7
type LoggerConfig struct {
Level LogLevel
Prefix string
Output io.Writer
Formatter LogFormatter
Color bool
ShowCaller bool
ShowFunction bool
TimestampFormat string
BufferSize int
AsyncMode bool
AsyncQueueSize int
ErrorHandler func(error)
}
func DefaultConfig ¶ added in v1.6.7
func DefaultConfig() *LoggerConfig
type PingParams ¶
type PingParams struct {
PingID int64
}
func (*PingParams) CRC ¶
func (*PingParams) CRC() uint32
type Proxy ¶ added in v1.6.7
type Proxy struct {
Type string // socks4, socks5, http, https, mtproxy
Host string
Port int
Username string
Password string
Secret string // for MTProxy
}
func (*Proxy) GetPassword ¶ added in v1.6.7
func (*Proxy) GetUsername ¶ added in v1.6.7
type SyncIntObjectChan ¶
type SyncIntObjectChan struct {
// contains filtered or unexported fields
}
func NewSyncIntObjectChan ¶
func NewSyncIntObjectChan() *SyncIntObjectChan
func (*SyncIntObjectChan) Close ¶
func (s *SyncIntObjectChan) Close()
func (*SyncIntObjectChan) Delete ¶
func (s *SyncIntObjectChan) Delete(key int) bool
func (*SyncIntObjectChan) Has ¶
func (s *SyncIntObjectChan) Has(key int) bool
func (*SyncIntObjectChan) Keys ¶
func (s *SyncIntObjectChan) Keys() []int
func (*SyncIntObjectChan) Reset ¶
func (s *SyncIntObjectChan) Reset()
type SyncIntReflectTypes ¶
type SyncIntReflectTypes struct {
// contains filtered or unexported fields
}
func NewSyncIntReflectTypes ¶
func NewSyncIntReflectTypes() *SyncIntReflectTypes
func (*SyncIntReflectTypes) Delete ¶
func (s *SyncIntReflectTypes) Delete(key int) bool
func (*SyncIntReflectTypes) Has ¶
func (s *SyncIntReflectTypes) Has(key int) bool
func (*SyncIntReflectTypes) Keys ¶
func (s *SyncIntReflectTypes) Keys() []int
func (*SyncIntReflectTypes) Reset ¶
func (s *SyncIntReflectTypes) Reset()
type SyncSet ¶
type SyncSet[T comparable] struct { // contains filtered or unexported fields }
func NewSyncSet ¶
func NewSyncSet[T comparable]() *SyncSet[T]
type TextFormatter ¶ added in v1.6.7
type TextFormatter struct {
NoColor bool
ShowTimestamp bool
ShowLevel bool
ShowCaller bool
ShowFunction bool
TimestampFormat string
FullTimestamp bool
PadLevelText bool
}
TextFormatter formats logs as human-readable text
func (*TextFormatter) Format ¶ added in v1.6.7
func (f *TextFormatter) Format(entry *LogEntry) string
type UpdatesGetStateParams ¶
type UpdatesGetStateParams struct{}
Click to show internal directories.
Click to hide internal directories.