server

package
v0.0.0-...-5f0d520 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2024 License: MIT Imports: 24 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Connecting = iota
	Connected
	Disconnected
)

Variables

This section is empty.

Functions

func RegPlugin

func RegPlugin(name string, new NewPlugin)

func ReloadCmd

func ReloadCmd() *cobra.Command

ReloadCmd create reload command

func StartCmd

func StartCmd() *cobra.Command

StartCmd create start command

func StopCmd

func StopCmd() *cobra.Command

StopCmd create stop command

Types

type Client

type Client struct {
	ID      string
	ConnAt  int64
	Version byte
	Status  byte
	// contains filtered or unexported fields
}

type ClientProp

type ClientProp struct {
	KeepAlive             uint16
	SessionExpiryInterval uint32
	MaxInflight           uint16
	MaximumPacketSize     uint32
	TopicAliasMaximum     uint16
	Username              string
	Protocol              string
	CleanStart            bool
	IP                    string
}

Client

type NewPlugin

type NewPlugin func() (Plugin, error)

type Plugin

type Plugin interface {
	Name() string
	Load() error
	Unload() error
}

type Server

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

Server struct

func New

func New() *Server

func (*Server) Init

func (s *Server) Init() error

Init Server

func (*Server) NewClient

func (s *Server) NewClient(ctx context.Context, conn net.Conn) *Client

func (*Server) Pprof

func (s *Server) Pprof()

Pprof Listen

func (*Server) Reload

func (s *Server) Reload()

Reload server

func (*Server) Start

func (s *Server) Start()

Start server

func (*Server) Stop

func (s *Server) Stop()

Stop server

Jump to

Keyboard shortcuts

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