tcp

package
v1.0.14 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Balancer

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

func NewBalancer

func NewBalancer(nodes []*Node) *Balancer

type Mode

type Mode int
const (
	Follower Mode = iota
	Leader
)

type Node

type Node struct {
	Address string
	Alive   atomic.Bool
	Conns   atomic.Int64
}

type Server

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

func New

func New(port int) *Server

func (*Server) AddNode

func (s *Server) AddNode(address string)

* * AddNode * @param address string *

func (*Server) Listen

func (s *Server) Listen() error

* * Listen * @return error *

func (*Server) SetMode

func (s *Server) SetMode(m Mode)

* * SetMode * @param m Mode *

Jump to

Keyboard shortcuts

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