Documentation ¶
Index ¶
- Constants
- Variables
- type Backend
- func (b *Backend) QueryLiteserver(ctx context.Context, payload tl.Serializable, result tl.Serializable) (err error)
- func (b *Backend) StickyContext(ctx context.Context) context.Context
- func (b *Backend) StickyContextNextNode(ctx context.Context) (context.Context, error)
- func (b *Backend) StickyContextNextNodeBalanced(ctx context.Context) (context.Context, error)
- func (b *Backend) StickyNodeID(ctx context.Context) uint32
- type BackendBalancer
- type BalancerType
- type Block
- type BlockCache
- func (c *BlockCache) CacheBlockIfNeeded(ctx context.Context, id *ton.BlockIDExt) (*Block, bool, error)
- func (c *BlockCache) GetAccountState(ctx context.Context, id *ton.BlockIDExt, addr *address.Address) (*ton.AccountState, bool, error)
- func (c *BlockCache) GetAccountStateInBlock(ctx context.Context, block *Block, addr *address.Address) (*ton.AccountState, bool, error)
- func (c *BlockCache) GetLastMasterBlock(ctx context.Context) (*MasterBlock, bool, error)
- func (c *BlockCache) GetLibraries(ctx context.Context, hashes [][]byte) (*cell.Dictionary, bool, error)
- func (c *BlockCache) GetMasterBlock(ctx context.Context, id *ton.BlockIDExt, skipChecks bool) (*MasterBlock, bool, error)
- func (c *BlockCache) GetTransaction(ctx context.Context, block *Block, account *ton.AccountID, lt int64) (*ton.TransactionInfo, error)
- func (c *BlockCache) GetZeroState() (*ton.ZeroStateIDExt, error)
- func (c *BlockCache) LookupBlockInCache(id *ton.BlockInfoShort) (*ton.BlockHeader, error)
- func (c *BlockCache) MethodEmulationEnabled() bool
- func (c *BlockCache) WaitMasterBlock(ctx context.Context, seqno uint32, timeout time.Duration) error
- type Cache
- type CacheWaiter
- type Client
- type ClientConnInfo
- type ClientIPInfo
- type KeyBlock
- type KeyConfig
- type MasterBlock
- type ProxyBalancer
- type ShardBlock
- type ShardInfo
Constants ¶
View Source
const ( BalancerTypeRoundRobin = "round_robin" BalancerTypeFailOver = "fail_over" )
View Source
const HitTypeBackend = "backend"
View Source
const HitTypeCache = "cache"
View Source
const HitTypeEmulated = "emulated"
View Source
const HitTypeFailedInternal = "failed_internal"
View Source
const HitTypeFailedValidate = "failed_validate"
View Source
const HitTypeGPCache = "gp_cache"
View Source
const HitTypeInflightCache = "inflight_cache"
Variables ¶
View Source
var ErrTimeout = ton.LSError{
Code: 652,
Text: "timeout",
}
Functions ¶
This section is empty.
Types ¶
type Backend ¶
type Backend struct { Name string Client *liteclient.ConnectionPool Weight uint64 // contains filtered or unexported fields }
func (*Backend) QueryLiteserver ¶
func (b *Backend) QueryLiteserver(ctx context.Context, payload tl.Serializable, result tl.Serializable) (err error)
func (*Backend) StickyContext ¶
func (*Backend) StickyContextNextNode ¶
func (*Backend) StickyContextNextNodeBalanced ¶
type BackendBalancer ¶
type BackendBalancer struct {
// contains filtered or unexported fields
}
func NewBackendBalancer ¶
func NewBackendBalancer(backends []config.BackendLiteserver, typ BalancerType) (*BackendBalancer, error)
func (*BackendBalancer) GetClient ¶
func (b *BackendBalancer) GetClient() ton.LiteClient
type BalancerType ¶
type BalancerType string
type Block ¶
type Block struct { ID *ton.BlockIDExt Data *cell.Cell DataRaw []byte // TODO: align boc serialization to be same with c++, because of file hash ShardAccounts *tlb.ShardAccountBlocks MasterID *ton.BlockIDExt // contains filtered or unexported fields }
type BlockCache ¶
type BlockCache struct {
// contains filtered or unexported fields
}
func NewBlockCache ¶
func NewBlockCache(config config.CacheConfig, balancer *BackendBalancer) *BlockCache
func (*BlockCache) CacheBlockIfNeeded ¶
func (c *BlockCache) CacheBlockIfNeeded(ctx context.Context, id *ton.BlockIDExt) (*Block, bool, error)
func (*BlockCache) GetAccountState ¶
func (c *BlockCache) GetAccountState(ctx context.Context, id *ton.BlockIDExt, addr *address.Address) (*ton.AccountState, bool, error)
func (*BlockCache) GetAccountStateInBlock ¶
func (c *BlockCache) GetAccountStateInBlock(ctx context.Context, block *Block, addr *address.Address) (*ton.AccountState, bool, error)
func (*BlockCache) GetLastMasterBlock ¶
func (c *BlockCache) GetLastMasterBlock(ctx context.Context) (*MasterBlock, bool, error)
func (*BlockCache) GetLibraries ¶
func (c *BlockCache) GetLibraries(ctx context.Context, hashes [][]byte) (*cell.Dictionary, bool, error)
func (*BlockCache) GetMasterBlock ¶
func (c *BlockCache) GetMasterBlock(ctx context.Context, id *ton.BlockIDExt, skipChecks bool) (*MasterBlock, bool, error)
func (*BlockCache) GetTransaction ¶
func (c *BlockCache) GetTransaction(ctx context.Context, block *Block, account *ton.AccountID, lt int64) (*ton.TransactionInfo, error)
func (*BlockCache) GetZeroState ¶
func (c *BlockCache) GetZeroState() (*ton.ZeroStateIDExt, error)
func (*BlockCache) LookupBlockInCache ¶
func (c *BlockCache) LookupBlockInCache(id *ton.BlockInfoShort) (*ton.BlockHeader, error)
func (*BlockCache) MethodEmulationEnabled ¶
func (c *BlockCache) MethodEmulationEnabled() bool
func (*BlockCache) WaitMasterBlock ¶
type Cache ¶
type Cache interface { MethodEmulationEnabled() bool LookupBlockInCache(id *ton.BlockInfoShort) (*ton.BlockHeader, error) GetTransaction(ctx context.Context, block *Block, account *ton.AccountID, lt int64) (*ton.TransactionInfo, error) GetLibraries(ctx context.Context, hashes [][]byte) (*cell.Dictionary, bool, error) WaitMasterBlock(ctx context.Context, seqno uint32, timeout time.Duration) error GetZeroState() (*ton.ZeroStateIDExt, error) GetMasterBlock(ctx context.Context, id *ton.BlockIDExt, skipChecks bool) (*MasterBlock, bool, error) GetLastMasterBlock(ctx context.Context) (*MasterBlock, bool, error) GetAccountStateInBlock(ctx context.Context, block *Block, addr *address.Address) (*ton.AccountState, bool, error) CacheBlockIfNeeded(ctx context.Context, id *ton.BlockIDExt) (*Block, bool, error) }
type CacheWaiter ¶
type CacheWaiter struct { W chan bool Result tl.Serializable }
type ClientConnInfo ¶
type ClientConnInfo struct { Client *liteclient.ServerClient LastRequest int64 }
type ClientIPInfo ¶
type ClientIPInfo struct {
ActiveConnections map[uint16]*ClientConnInfo
}
type MasterBlock ¶
type MasterBlock struct { Block StateHash []byte GenTime uint32 Config *cell.Dictionary // contains filtered or unexported fields }
type ProxyBalancer ¶
type ProxyBalancer struct {
// contains filtered or unexported fields
}
func NewProxyBalancer ¶
func NewProxyBalancer(configs []config.ClientConfig, backendBalancer *BackendBalancer, cache Cache, onlyProxy bool, maxConnectionsPerIP int, maxKeepAlive time.Duration, gpCacheSize int) *ProxyBalancer
func (*ProxyBalancer) Listen ¶
func (s *ProxyBalancer) Listen(addr string) error
type ShardBlock ¶
type ShardBlock struct { Block // contains filtered or unexported fields }
Click to show internal directories.
Click to hide internal directories.