import "git.apache.org/thrift.git/lib/go/thrift" // Create a new transport object using a socket connection socket, err := thrift.NewSocket("127.0.0.1:9090") if err != nil { // handle error } transport := thrift.NewBufferedTransport(socket, 1024) // Open the connection if err := transport.Open(); err != nil { // handle error } defer transport.Close() // Use the transport object to send and receive messages
import "git.apache.org/thrift.git/lib/go/thrift" // Create a new transport object using an HTTP connection url := "https://example.com/rpc" transport, err := thrift.NewHTTPClient(url) if err != nil { // handle error } // Use the transport object to send and receive messagesThis example shows how to create a new transport object using an HTTP connection, and then use the transport to send and receive messages. Package library: git.apache.org.thrift.git.lib.go.thrift