stream

package
v0.0.0-...-f62b0bc Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2025 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrConnNotExist = errors.New("connection does not exist")

Functions

func Copy

func Copy(local, remote io.ReadWriteCloser)

func NewReadWriter

func NewReadWriter(conn net.Conn) io.ReadWriteCloser

Types

type Conn

type Conn interface {
	TaskID() uint64
	Rewrite(data *msg.Data) (n int, err error)
	Interrupt() error
	io.Closer
}

type Dialer

type Dialer interface {
	NewConn(data *msg.Data, req *msg.WspRequest) error
}

type Handler

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

func NewHandler

func NewHandler(dialer Dialer) *Handler

func (*Handler) Serve

func (w *Handler) Serve(wan *Wan)

type PollTaskPool

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

func NewPollTaskPool

func NewPollTaskPool(parallel, capacity int) *PollTaskPool

func (*PollTaskPool) Add

func (p *PollTaskPool) Add(id uint64, task func())

func (*PollTaskPool) Close

func (p *PollTaskPool) Close()

func (*PollTaskPool) Wait

func (p *PollTaskPool) Wait()

type Signal

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

func NewSignal

func NewSignal() *Signal

func (*Signal) Notify

func (s *Signal) Notify(err error)

func (*Signal) Wait

func (s *Signal) Wait(timeout time.Duration) error

type TaskPool

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

func NewTaskPool

func NewTaskPool(parallel, capacity int) *TaskPool

func (*TaskPool) Add

func (p *TaskPool) Add(task func())

func (*TaskPool) Close

func (p *TaskPool) Close()

func (*TaskPool) Wait

func (p *TaskPool) Wait()

type Wan

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

func NewWan

func NewWan(conn net.Conn, state ws.State) *Wan

func (*Wan) Accept

func (w *Wan) Accept(id string, local net.Addr, config *msg.WspConfig) (io.ReadWriteCloser, error)

func (*Wan) Bridge

func (w *Wan) Bridge(req *msg.Data, config *msg.WspConfig, rwan *Wan) error

func (*Wan) DialHTTP

func (w *Wan) DialHTTP(remote *msg.WspConfig) (net.Conn, error)

func (*Wan) DialTCP

func (w *Wan) DialTCP(local net.Addr, remote *msg.WspConfig) (io.ReadWriteCloser, error)

func (*Wan) HeartBeat

func (w *Wan) HeartBeat(d time.Duration)

func (*Wan) Reply

func (w *Wan) Reply(id string, message error) (err error)

Jump to

Keyboard shortcuts

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