handler

package
v0.0.0-...-251c84f Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2023 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseStreamHandler

type BaseStreamHandler interface {
	GetProtocolID() string
	HandleReceivedStream(stream network.Stream)
	OpenStreamAndSendRequest(queryInfos []string) []error
	// contains filtered or unexported methods
}

type DownloadHandler

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

func NewDownloadHandler

func NewDownloadHandler() *DownloadHandler

func (*DownloadHandler) GetProtocolID

func (d *DownloadHandler) GetProtocolID() string

func (*DownloadHandler) HandleReceivedStream

func (d *DownloadHandler) HandleReceivedStream(stream network.Stream)

func (*DownloadHandler) OpenStreamAndSendRequest

func (d *DownloadHandler) OpenStreamAndSendRequest(queryInfos []string) []error

type EchoHandler

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

func NewEchoHandler

func NewEchoHandler() *EchoHandler

func (*EchoHandler) GetProtocolID

func (e *EchoHandler) GetProtocolID() string

func (*EchoHandler) HandleReceivedStream

func (e *EchoHandler) HandleReceivedStream(stream network.Stream)

func (*EchoHandler) OpenStreamAndSendRequest

func (e *EchoHandler) OpenStreamAndSendRequest(queryInfos []string) []error

type LeaveHandler

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

func NewLeaveHandler

func NewLeaveHandler() *LeaveHandler

func (*LeaveHandler) GetProtocolID

func (l *LeaveHandler) GetProtocolID() string

func (*LeaveHandler) HandleReceivedStream

func (l *LeaveHandler) HandleReceivedStream(stream network.Stream)

func (*LeaveHandler) OpenStreamAndSendRequest

func (l *LeaveHandler) OpenStreamAndSendRequest(queryInfos []string) []error

type Manager

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

func NewHandlerManager

func NewHandlerManager() *Manager

func (*Manager) GetHandlers

func (m *Manager) GetHandlers() map[string]BaseStreamHandler

func (*Manager) GetSenderHandler

func (m *Manager) GetSenderHandler(command string) BaseStreamHandler

GetSenderHandler Not graceful.

func (*Manager) InitHandlerManager

func (m *Manager) InitHandlerManager()

InitHandlerManager If you don't need a handler, just remove the corresponding handler here.

type SearchHandler

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

func NewSearchHandler

func NewSearchHandler() *SearchHandler

func (*SearchHandler) GetProtocolID

func (s *SearchHandler) GetProtocolID() string

func (*SearchHandler) HandleReceivedStream

func (s *SearchHandler) HandleReceivedStream(stream network.Stream)

func (*SearchHandler) OpenStreamAndSendRequest

func (s *SearchHandler) OpenStreamAndSendRequest(queryInfos []string) []error

Jump to

Keyboard shortcuts

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