Compare commits

...

8 Commits

Author SHA1 Message Date
Astra dc00c91b86 update tdlib 2024-10-06 18:09:53 +01:00
Astra 1e5d43121b Update to v1.8.10 2023-06-04 20:58:07 +00:00
Astra 6a7433c67c Update to v1.8.0 2023-06-04 20:53:18 +00:00
Astra ac75624c63 Update to v1.8.14 2023-06-04 20:50:28 +00:00
astravexton d4fb087379 Update tdlib code to 1.8.3 2022-04-18 20:46:11 +00:00
astravexton 1e67a2c70d Update tdlib code to 1.8.3 2022-04-18 20:45:01 +00:00
Astra 3bf4cb7f46 Update tag to 1.7.10 2021-12-11 17:37:28 +00:00
astravexton c49a8e3771 fix import 2021-12-08 13:17:55 +00:00
12 changed files with 88791 additions and 39688 deletions

View File

@ -1,4 +1,4 @@
TAG := master TAG := d7203eb719304866a7eb7033ef03d421459335b8
schema-update: schema-update:
curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl curl https://raw.githubusercontent.com/tdlib/td/${TAG}/td/generate/scheme/td_api.tl 2>/dev/null > ./data/td_api.tl

View File

@ -1,6 +1,6 @@
# go-tdlib # go-tdlib
Go wrapper for [TDLib (Telegram Database Library)](https://github.com/tdlib/td) with full support of TDLib v1.7.0 Go wrapper for [TDLib (Telegram Database Library)](https://github.com/tdlib/td) with full support of TDLib v1.8.0
## TDLib installation ## TDLib installation

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,6 @@
package puller package puller
import ( import (
"math"
"git.zio.sh/astra/go-tdlib/client" "git.zio.sh/astra/go-tdlib/client"
) )

View File

@ -1,3 +1,4 @@
//go:build darwin
// +build darwin // +build darwin
package client package client

View File

@ -1,3 +1,4 @@
//go:build libtdjson && (linux || darwin || windows)
// +build libtdjson // +build libtdjson
// +build linux darwin windows // +build linux darwin windows

View File

@ -1,3 +1,4 @@
//go:build !libtdjson && (linux || darwin)
// +build !libtdjson // +build !libtdjson
// +build linux darwin // +build linux darwin

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
package main package main
import ( import (
"bufio"
"encoding/json" "encoding/json"
"flag" "flag"
"log" "log"
@ -25,27 +24,23 @@ func main() {
resp, err := http.Get("https://raw.githubusercontent.com/tdlib/td/" + version + "/td/generate/scheme/td_api.tl") resp, err := http.Get("https://raw.githubusercontent.com/tdlib/td/" + version + "/td/generate/scheme/td_api.tl")
if err != nil { if err != nil {
log.Fatalf("http.Get error: %s", err) log.Fatalf("http.Get error: %s", err)
return
} }
defer resp.Body.Close() defer resp.Body.Close()
schema, err := tlparser.Parse(resp.Body) schema, err := tlparser.Parse(resp.Body)
if err != nil { if err != nil {
log.Fatalf("schema parse error: %s", err) log.Fatalf("schema parse error: %s", err)
return
} }
resp, err = http.Get("https://raw.githubusercontent.com/tdlib/td/" + version + "/td/telegram/Td.cpp") resp, err = http.Get("https://raw.githubusercontent.com/tdlib/td/" + version + "/td/telegram/Td.cpp")
if err != nil { if err != nil {
log.Fatalf("http.Get error: %s", err) log.Fatalf("http.Get error: %s", err)
return
} }
defer resp.Body.Close() defer resp.Body.Close()
err = tlparser.ParseCode(resp.Body, schema) err = tlparser.ParseCode(resp.Body, schema)
if err != nil { if err != nil {
log.Fatalf("parse code error: %s", err) log.Fatalf("parse code error: %s", err)
return
} }
err = os.MkdirAll(filepath.Dir(outputFilePath), os.ModePerm) err = os.MkdirAll(filepath.Dir(outputFilePath), os.ModePerm)
@ -53,16 +48,17 @@ func main() {
log.Fatalf("make dir error: %s", filepath.Dir(outputFilePath)) log.Fatalf("make dir error: %s", filepath.Dir(outputFilePath))
} }
file, err := os.OpenFile(outputFilePath, os.O_CREATE|os.O_RDWR|os.O_TRUNC, os.ModePerm) file, err := os.Create(outputFilePath)
if err != nil { if err != nil {
log.Fatalf("open file error: %s", err) log.Fatalf("open file error: %s", err)
return
} }
defer file.Close()
data, err := json.MarshalIndent(schema, "", strings.Repeat(" ", 4)) enc := json.NewEncoder(file)
enc.SetIndent("", strings.Repeat(" ", 4))
err = enc.Encode(schema)
if err != nil { if err != nil {
log.Fatalf("json marshal error: %s", err) log.Fatalf("enc.Encode error: %s", err)
return
} }
bufio.NewWriter(file).Write(data)
} }

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff