Documentation ¶
Overview ¶
Package cluster contains Telegram multi-DC setup utilities.
Index ¶
- type Cluster
- func (c *Cluster) Common() *tgtest.Dispatcher
- func (c *Cluster) DC(id int, name string) (*tgtest.Server, *tgtest.Dispatcher)
- func (c *Cluster) Dispatch(id int, name string) *tgtest.Dispatcher
- func (c *Cluster) Keys() []*rsa.PublicKey
- func (c *Cluster) List() dcs.List
- func (c *Cluster) Ready() <-chan struct{}
- func (c *Cluster) Resolver() dcs.Resolver
- func (c *Cluster) Up(ctx context.Context) error
- type Options
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Cluster ¶
type Cluster struct {
// contains filtered or unexported fields
}
Cluster is a cluster of multiple servers, representing multiple Telegram datacenters.
func (*Cluster) Common ¶
func (c *Cluster) Common() *tgtest.Dispatcher
Common returns common dispatcher.
func (*Cluster) Dispatch ¶
func (c *Cluster) Dispatch(id int, name string) *tgtest.Dispatcher
Dispatch registers new server and returns its dispatcher.
func (*Cluster) Ready ¶
func (c *Cluster) Ready() <-chan struct{}
Ready returns signal channel to await readiness.
type Options ¶
type Options struct { // Web denotes to use websocket listener. Web bool // Random is random source. Used to generate RSA keys. // Defaults to rand.Reader. Random io.Reader // Logger is instance of zap.Logger. No logs by default. Logger *zap.Logger // Codec constructor. // Defaults to nil (underlying transport server detects protocol automatically). Protocol dcs.Protocol // Config is an initial cluster config. Config tg.Config // CDNConfig is an initial cluster CDN config. CDNConfig tg.CDNConfig }
Options of Cluster.
Click to show internal directories.
Click to hide internal directories.