Remove go example in favor of third-party wrappers linked in example/README.md.
GitOrigin-RevId: e5df46f9c85c150afadb07b256ff4b2d3dd8f783
This commit is contained in:
parent
1b16d54c48
commit
7081198275
@ -72,8 +72,7 @@ TDLib can be used from the Go programming language through the [JSON](https://gi
|
|||||||
Convenient Go wrappers already exist for our JSON interface.
|
Convenient Go wrappers already exist for our JSON interface.
|
||||||
For example, take a look at [go-tdlib](https://github.com/zelenin/go-tdlib) or [go-tdlib](https://github.com/Arman92/go-tdlib), which provide a convenient TDLib client, a generator for TDLib API classes and contain many examples.
|
For example, take a look at [go-tdlib](https://github.com/zelenin/go-tdlib) or [go-tdlib](https://github.com/Arman92/go-tdlib), which provide a convenient TDLib client, a generator for TDLib API classes and contain many examples.
|
||||||
|
|
||||||
You can also see [go-tdjson](https://github.com/L11R/go-tdjson) for another example of TDLib JSON interface integration with Go and
|
You can also see [go-tdjson](https://github.com/L11R/go-tdjson) for another example of TDLib JSON interface integration with Go.
|
||||||
[example/go](https://github.com/tdlib/td/tree/master/example/go/main.go) for a proof of concept example of using the TDLib JSON interface from Go.
|
|
||||||
|
|
||||||
<a name="java"></a>
|
<a name="java"></a>
|
||||||
## Using TDLib in Java projects
|
## Using TDLib in Java projects
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
package main
|
|
||||||
|
|
||||||
// #cgo LDFLAGS: -ltdjson
|
|
||||||
// #include <td/telegram/td_json_client.h>
|
|
||||||
import "C"
|
|
||||||
import (
|
|
||||||
"log"
|
|
||||||
"unsafe"
|
|
||||||
)
|
|
||||||
|
|
||||||
func td_send(client unsafe.Pointer, query *C.char) {
|
|
||||||
C.td_json_client_send(client, query)
|
|
||||||
}
|
|
||||||
|
|
||||||
func td_receive(client unsafe.Pointer) string {
|
|
||||||
return C.GoString(C.td_json_client_receive(client, 1.0))
|
|
||||||
}
|
|
||||||
|
|
||||||
func main() {
|
|
||||||
var client unsafe.Pointer
|
|
||||||
client = C.td_json_client_create()
|
|
||||||
|
|
||||||
query := C.CString(`{"@type": "getAuthorizationState"}`)
|
|
||||||
td_send(client, query)
|
|
||||||
log.Println(td_receive(client))
|
|
||||||
}
|
|
Reference in New Issue
Block a user