Files
mautrix-telegram/pkg/gotd/tgtest/session.go
T
2025-06-27 20:03:37 -07:00

25 lines
519 B
Go

package tgtest
import (
"encoding/hex"
"go.uber.org/zap/zapcore"
"go.mau.fi/mautrix-telegram/pkg/gotd/crypto"
)
// Session represents connection session.
type Session struct {
// ID is a Session ID.
ID int64
// AuthKey is an attached key.
AuthKey crypto.AuthKey
}
// MarshalLogObject implements zap.ObjectMarshaler.
func (s Session) MarshalLogObject(encoder zapcore.ObjectEncoder) error {
encoder.AddInt64("session_id", s.ID)
encoder.AddString("key_id", hex.EncodeToString(s.AuthKey.ID[:]))
return nil
}