Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RecvTransactionHandshake ¶
func RecvTransactionHandshake(stream *qpStream.Stream) (*pb.Transaction, error)
RecvTransactionHandshake receives a transaction request from the client when a transaction is opened. This method is used internally when opening a transaction. So, you may don't need to use it directly.
func TransactionHandshake ¶
func TransactionHandshake(stream *qpStream.Stream, transactionName string, transactionID []byte) error
TransactionHandshake sends a transaction request to the server when a transaction is opened. This method is used internally when opening a transaction. So, you may don't need to use it directly.
Types ¶
type Connection ¶
type Connection struct { Conn quic.Connection // contains filtered or unexported fields }
Connection is a connection instance that is created when a client connects to a server.
func New ¶
func New(logLevel int, conn quic.Connection) (*Connection, error)
New creates a new connection instance. This method is used internally by quics-protocol. So, you may don't need to use it directly.
func (*Connection) CloseWithError ¶
func (c *Connection) CloseWithError(message string) error
CloseWithError closes the connection with an error message.
func (*Connection) OpenTransaction ¶
func (c *Connection) OpenTransaction(transactionName string, transactionFunc func(stream *qpStream.Stream, transactionName string, transactionID []byte) error) error
OpenTransaction opens a transaction to the server. The transaction name and transaction function are needed as parameters. The transaction name is used to determine which handler to use on the receiving side. `transactionFunc“ is called when the transaction is opened. The stream, transaction name, and transaction id are passed as parameters. The stream is used to send and receive messages and files.