Documentation
¶
Index ¶
- type HeartbeatStreams
- func (s *HeartbeatStreams) BindStream(containerID uint64, stream opt.HeartbeatStream)
- func (s *HeartbeatStreams) Close()
- func (s *HeartbeatStreams) Drain(count int) error
- func (s *HeartbeatStreams) MsgLength() int
- func (s *HeartbeatStreams) SendMsg(res *core.CachedResource, msg *rpcpb.ResourceHeartbeatRsp)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HeartbeatStreams ¶
type HeartbeatStreams struct {
// contains filtered or unexported fields
}
HeartbeatStreams is the bridge of communication with your storage application instance.
func NewHeartbeatStreams ¶
func NewHeartbeatStreams(ctx context.Context, clusterID uint64, containerInformer core.ContainerSetInformer, logger *zap.Logger) *HeartbeatStreams
NewHeartbeatStreams creates a new HeartbeatStreams which enable background running by default.
func NewTestHeartbeatStreams ¶
func NewTestHeartbeatStreams(ctx context.Context, clusterID uint64, containerInformer core.ContainerSetInformer, needRun bool, logger *zap.Logger) *HeartbeatStreams
NewTestHeartbeatStreams creates a new HeartbeatStreams for test purpose only. Please use NewHeartbeatStreams for other usage.
func (*HeartbeatStreams) BindStream ¶
func (s *HeartbeatStreams) BindStream(containerID uint64, stream opt.HeartbeatStream)
BindStream binds a stream with a specified container.
func (*HeartbeatStreams) Close ¶
func (s *HeartbeatStreams) Close()
Close closes background running.
func (*HeartbeatStreams) Drain ¶
func (s *HeartbeatStreams) Drain(count int) error
Drain consumes message from msgCh when disable background running. For test only.
func (*HeartbeatStreams) MsgLength ¶
func (s *HeartbeatStreams) MsgLength() int
MsgLength gets the length of msgCh. For test only.
func (*HeartbeatStreams) SendMsg ¶
func (s *HeartbeatStreams) SendMsg(res *core.CachedResource, msg *rpcpb.ResourceHeartbeatRsp)
SendMsg sends a message to related container.
Click to show internal directories.
Click to hide internal directories.