Documentation ¶
Index ¶
- Constants
- Variables
- type ConnPool
- func (p *ConnPool) BestArchiveClient(ctx context.Context) (*liteclient.Client, ton.BlockIDExt, error)
- func (p *ConnPool) BestClientByAccountID(ctx context.Context, accountID ton.AccountID, archiveRequired bool) (*liteclient.Client, ton.BlockIDExt, error)
- func (p *ConnPool) BestClientByBlockID(ctx context.Context, blockID ton.BlockID) (*liteclient.Client, error)
- func (p *ConnPool) BestMasterchainClient(ctx context.Context) (*liteclient.Client, ton.BlockIDExt, error)
- func (p *ConnPool) BestMasterchainInfoClient() *MasterchainInfoClient
- func (p *ConnPool) ConnectionsNumber() int
- func (p *ConnPool) InitializeConnections(ctx context.Context, timeout time.Duration, maxConnections int, ...) chan error
- func (p *ConnPool) Run(ctx context.Context)
- func (p *ConnPool) WaitMasterchainSeqno(ctx context.Context, seqno uint32, timeout time.Duration) error
- type MasterchainInfoClient
- func (s *MasterchainInfoClient) LiteServerGetMasterchainInfo(ctx context.Context) (liteclient.LiteServerMasterchainInfoC, error)
- func (s *MasterchainInfoClient) LiteServerGetMasterchainInfoExt(ctx context.Context, request liteclient.LiteServerGetMasterchainInfoExtRequest) (res liteclient.LiteServerMasterchainInfoExtC, err error)
- type Strategy
Constants ¶
View Source
const ( BestPingStrategy = "best-ping" FirstWorkingConnection = "first-working" )
Variables ¶
View Source
var (
ErrNoConnections = fmt.Errorf("no connections available")
)
Functions ¶
This section is empty.
Types ¶
type ConnPool ¶ added in v1.6.6
type ConnPool struct {
// contains filtered or unexported fields
}
ConnPool is a pool of connections to lite servers that implements two different strategy:
- BestPingStrategy - it'll switch to a connection with the best ping.
- FirstWorkingConnection - it'll switch to the first working connection.
For both strategies, a connection has to be not more than 1 block behind the head of masterchain to be considered as working.
func (*ConnPool) BestArchiveClient ¶ added in v1.6.6
func (p *ConnPool) BestArchiveClient(ctx context.Context) (*liteclient.Client, ton.BlockIDExt, error)
func (*ConnPool) BestClientByAccountID ¶ added in v1.6.6
func (p *ConnPool) BestClientByAccountID(ctx context.Context, accountID ton.AccountID, archiveRequired bool) (*liteclient.Client, ton.BlockIDExt, error)
BestClientByAccountID returns a liteclient and its known masterchain head.
func (*ConnPool) BestClientByBlockID ¶ added in v1.6.6
func (p *ConnPool) BestClientByBlockID(ctx context.Context, blockID ton.BlockID) (*liteclient.Client, error)
BestClientByBlockID returns a liteclient and its known masterchain head.
func (*ConnPool) BestMasterchainClient ¶ added in v1.6.6
func (p *ConnPool) BestMasterchainClient(ctx context.Context) (*liteclient.Client, ton.BlockIDExt, error)
BestMasterchainClient returns a liteclient and its known masterchain head.
func (*ConnPool) BestMasterchainInfoClient ¶ added in v1.6.6
func (p *ConnPool) BestMasterchainInfoClient() *MasterchainInfoClient
func (*ConnPool) ConnectionsNumber ¶ added in v1.6.6
ConnectionsNumber returns a number of connections in this pool.
func (*ConnPool) InitializeConnections ¶ added in v1.6.6
type MasterchainInfoClient ¶ added in v1.2.1
type MasterchainInfoClient struct {
// contains filtered or unexported fields
}
func (*MasterchainInfoClient) LiteServerGetMasterchainInfo ¶ added in v1.2.1
func (s *MasterchainInfoClient) LiteServerGetMasterchainInfo(ctx context.Context) (liteclient.LiteServerMasterchainInfoC, error)
func (*MasterchainInfoClient) LiteServerGetMasterchainInfoExt ¶ added in v1.2.1
func (s *MasterchainInfoClient) LiteServerGetMasterchainInfoExt(ctx context.Context, request liteclient.LiteServerGetMasterchainInfoExtRequest) (res liteclient.LiteServerMasterchainInfoExtC, err error)
Click to show internal directories.
Click to hide internal directories.