control

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2025 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client is a client for the control server

func NewClient

func NewClient(endpoint string, log *zap.Logger) (*Client, error)

NewClient creates a new control server client

func (*Client) MessageChannel

func (c *Client) MessageChannel() chan<- Control

MessageChannel returns the channel for sending message ranges

func (*Client) Start

func (c *Client) Start()

Start begins processing message ranges and sending them to the control server

func (*Client) Stop

func (c *Client) Stop()

Stop gracefully stops the client

type Control

type Control struct {
	Type  ControlType
	Range MessageRange
}

Control represents a new or updated range

type ControlMessage

type ControlMessage struct {
	// GeneratorID is the unique identifier of the generator
	GeneratorID string `json:"generator_id"`

	// Timestamp is when the messages were published
	Timestamp time.Time `json:"timestamp"`

	// StartID is the first message ID in the range
	StartID uint64 `json:"start_id"`

	// RangeLen is the length of the ID range
	RangeLen uint `json:"range_len"`
}

ControlMessage represents a notification from a generator about messages it has published

type ControlType

type ControlType int
const (
	ControlTypeNew ControlType = iota
	ControlTypeUpdate
)

type MessageRange

type MessageRange struct {
	GeneratorID string
	StartID     uint64
	RangeLen    uint
	Timestamp   time.Time
}

MessageRange tracks a range of message IDs from a generator

type Server

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

func New

func New(addr string, mt *msg_tracker.Tracker, reportInterval time.Duration, log *zap.Logger) *Server

func (*Server) Addr

func (s *Server) Addr() string

func (*Server) Start

func (s *Server) Start() error

func (*Server) Stop

func (s *Server) Stop() error

Jump to

Keyboard shortcuts

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