2023-08-07 03:32:46 +08:00
|
|
|
package types
|
|
|
|
|
2023-08-12 19:21:42 +08:00
|
|
|
import (
|
|
|
|
"github.com/go-jose/go-jose/v3/jwt"
|
2023-12-03 05:46:53 +08:00
|
|
|
"github.com/gotd/td/session"
|
2023-08-12 19:21:42 +08:00
|
|
|
)
|
2023-08-07 03:32:46 +08:00
|
|
|
|
|
|
|
type AppError struct {
|
|
|
|
Error error
|
|
|
|
Code int
|
|
|
|
}
|
|
|
|
|
|
|
|
type Part struct {
|
2024-03-20 01:01:56 +08:00
|
|
|
DecryptedSize int64
|
|
|
|
Size int64
|
|
|
|
Salt string
|
2024-06-22 20:29:59 +08:00
|
|
|
ID int64
|
2023-08-07 03:32:46 +08:00
|
|
|
}
|
2023-08-12 19:21:42 +08:00
|
|
|
|
|
|
|
type JWTClaims struct {
|
|
|
|
jwt.Claims
|
|
|
|
TgSession string `json:"tgSession"`
|
|
|
|
Name string `json:"name"`
|
|
|
|
UserName string `json:"userName"`
|
|
|
|
Bot bool `json:"bot"`
|
|
|
|
IsPremium bool `json:"isPremium"`
|
2023-09-20 03:20:44 +08:00
|
|
|
Hash string `json:"hash"`
|
2023-08-12 19:21:42 +08:00
|
|
|
}
|
2023-12-03 05:46:53 +08:00
|
|
|
|
|
|
|
type SessionData struct {
|
|
|
|
Version int
|
|
|
|
Data session.Data
|
|
|
|
}
|
|
|
|
type SocketMessage struct {
|
|
|
|
AuthType string `json:"authType"`
|
|
|
|
Message string `json:"message"`
|
|
|
|
PhoneNo string `json:"phoneNo,omitempty"`
|
|
|
|
PhoneCodeHash string `json:"phoneCodeHash,omitempty"`
|
|
|
|
PhoneCode string `json:"phoneCode,omitempty"`
|
|
|
|
Password string `json:"password,omitempty"`
|
|
|
|
}
|
|
|
|
|
|
|
|
type BotInfo struct {
|
|
|
|
Id int64
|
|
|
|
UserName string
|
|
|
|
AccessHash int64
|
|
|
|
Token string
|
|
|
|
}
|
2024-03-20 01:01:56 +08:00
|
|
|
|
|
|
|
type Range struct {
|
|
|
|
Start int64
|
|
|
|
End int64
|
|
|
|
PartNo int64
|
|
|
|
}
|