streamserver

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: May 14, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Server) *Server

func WithBindAddr

func WithBindAddr(addr string) Option

func WithBindPort

func WithBindPort(port int) Option

func WithCustomHandler

func WithCustomHandler(handler func(net.Conn)) Option

func WithRespContent

func WithRespContent(content []byte) Option

type Server

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

func New

func New(netType Type, options ...Option) *Server

func (*Server) BindAddr

func (s *Server) BindAddr() string

func (*Server) BindPort

func (s *Server) BindPort() int

func (*Server) Close

func (s *Server) Close() error

func (*Server) Run

func (s *Server) Run() error

type Type

type Type string
const (
	TCP  Type = "tcp"
	UDP  Type = "udp"
	Unix Type = "unix"
)

Jump to

Keyboard shortcuts

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