Versions in this module Expand all Collapse all v0 v0.1.1 Oct 29, 2026 v0.1.0 Oct 24, 2026 Changes in this version + const DefaultMaxConcurrentDials + const DefaultMaxReconnectDelay + const DefaultMinReconnectDelay + const DefaultStableSessionDuration + var ErrClosed = errors.New("RCon client is closed") + var ErrCommandOutcomeUnknown = errors.New("RCon command outcome is unknown") + var ErrCommandTooLong = errors.New("RCon command exceeds datagram limit") + var ErrFleetRunning = errors.New("RCon fleet is already running") + var ErrLoginFailed = errors.New("RCon login failed") + var ErrLoginTimeout = errors.New("RCon login timed out") + var ErrProtocol = errors.New("invalid RCon protocol response") + var ErrResponseTimeout = fmt.Errorf("RCon response timed out: %w", ErrCommandOutcomeUnknown) + var ErrResponseTooLarge = errors.New("RCon response exceeds configured limit") + var ErrTargetUnavailable = errors.New("RCon fleet target is unavailable") + type Client struct + func Dial(ctx context.Context, address, password string, opts *Options) (*Client, error) + func (c *Client) Close() error + func (c *Client) Command(ctx context.Context, command string) ([]byte, error) + func (c *Client) Done() <-chan struct{} + func (c *Client) DroppedMessages() uint64 + func (c *Client) Err() error + func (c *Client) Messages() <-chan Message + type Fleet struct + func NewFleet(targets []Target, options FleetOptions) (*Fleet, error) + func (f *Fleet) Command(ctx context.Context, targetID, command string) ([]byte, error) + func (f *Fleet) DroppedMessages() uint64 + func (f *Fleet) Messages() <-chan FleetMessage + func (f *Fleet) Run(ctx context.Context, handler SessionHandler) error + func (f *Fleet) Status(targetID string) (TargetStatus, bool) + func (f *Fleet) Statuses() []TargetStatus + type FleetMessage struct + Message Message + TargetID string + type FleetOptions struct + DropOldestMessages bool + ExpireAfter time.Duration + MaxConcurrentDials int + MaxReconnectDelay time.Duration + MessageBuffer int + MinReconnectDelay time.Duration + StableSessionDuration time.Duration + type Message struct + Data []byte + Sequence byte + type Options struct + DropOldestMessages bool + KeepAliveInterval time.Duration + LoginAttempts int + LoginTimeout time.Duration + MaxKeepAliveFailures int + MaxResponseBytes int + MessageBuffer int + ResponseTimeout time.Duration + SequenceReuseDelay time.Duration + func DefaultOptions() Options + type SessionHandler func(ctx context.Context, target TargetInfo, client *Client) error + type Target struct + Address string + ID string + Options *Options + Password string + type TargetInfo struct + Address string + ID string + type TargetState string + const TargetStateConnecting + const TargetStateExpired + const TargetStateOnline + const TargetStateRetrying + const TargetStateStopped + type TargetStatus struct + Address string + ConsecutiveFailures uint64 + ID string + LastAttempt *time.Time + LastConnected *time.Time + LastError string + NextAttempt *time.Time + OfflineSince *time.Time + ReconnectDelay time.Duration + State TargetState