adnl

package
v0.11.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2023 License: MIT Imports: 19 Imported by: 0

README

ADNL pure-golang implementation.

This library implements ADNL protocol to communicate with TON nodes at low level.

Protocol description you can find here:

Usage

Example

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	// contains filtered or unexported fields
}

func NewAddress

func NewAddress(key []byte) (Address, error)

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(c *Connection) *Client

func (*Client) Request

func (c *Client) Request(ctx context.Context, q Query) (Message, error)

type Connection

type Connection struct {
	Status ConnectionStatus
	// contains filtered or unexported fields
}

func NewConnection

func NewConnection(ctx context.Context, peerPublicKey []byte, host string) (*Connection, error)

func (*Connection) Responses

func (c *Connection) Responses() chan Packet

func (*Connection) Send

func (c *Connection) Send(p Packet) error

type ConnectionStatus

type ConnectionStatus int
const (
	NotInit ConnectionStatus = iota
	Connecting
	Connected
	Closed
)

type Message

type Message []byte

type Packet

type Packet struct {
	Payload []byte
	// contains filtered or unexported fields
}

func NewPacket

func NewPacket(payload []byte) (Packet, error)

func ParsePacket

func ParsePacket(r io.Reader, decryptor cipher.Stream) (Packet, error)

func (Packet) MagicType

func (p Packet) MagicType() uint32

type Query

type Query []byte

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL