client

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2023 License: MIT Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 8883
)

Variables

This section is empty.

Functions

func AttachToCmdrCommand added in v0.3.0

func AttachToCmdrCommand(tcp cmdr.OptCmd, opts ...CmdrOpt)

func DefaultCmdrCommandAction added in v0.2.5

func DefaultCmdrCommandAction(cmd *cmdr.Command, args []string, mainLoop MainLoop, prefixPrefix string, opts ...Opt) (err error)

func DefaultCommandAction added in v0.2.5

func DefaultCommandAction(config *base.Config, mainLoop MainLoop, opts ...Opt) (err error)

func New

func New(udpMode bool, config *base.Config, opts ...Opt) error

Types

type BuildPackageFunc added in v0.3.0

type BuildPackageFunc func(i, threadId int, destAddr string) []byte

type CmdrOpt

type CmdrOpt func(*builder)

func WithCmdrClientBuildPackageFunc added in v0.3.0

func WithCmdrClientBuildPackageFunc(fn BuildPackageFunc) CmdrOpt

func WithCmdrClientOptions

func WithCmdrClientOptions(opts ...Opt) CmdrOpt

func WithCmdrClientProtocolInterceptor

func WithCmdrClientProtocolInterceptor(pic protocol.ClientInterceptor) CmdrOpt

func WithCmdrCommandAction

func WithCmdrCommandAction(action CommandAction) CmdrOpt

func WithCmdrInteractiveCommand

func WithCmdrInteractiveCommand(enabled bool) CmdrOpt

func WithCmdrMainLoop

func WithCmdrMainLoop(mainLoop MainLoop) CmdrOpt

func WithCmdrNil

func WithCmdrNil() CmdrOpt

func WithCmdrPort

func WithCmdrPort(port int) CmdrOpt

func WithCmdrPrefixPrefix

func WithCmdrPrefixPrefix(prefixPrefix string) CmdrOpt

func WithCmdrUDPMode

func WithCmdrUDPMode(mode bool) CmdrOpt

type CommandAction

type CommandAction func(cmd *cmdr.Command, args []string, mainLoop MainLoop, prefixPrefix string, opts ...Opt) (err error)

type MainLoop

type MainLoop func(ctx context.Context, conn base.Conn, done chan bool, config *base.Config)

type MainLoopHolder

type MainLoopHolder interface {
	MainLoop(ctx context.Context, conn base.Conn, done chan bool, config *base.Config)
}

type Opt

type Opt func(obj *clientObj)

func WithClientBuildPackageFunc added in v0.3.0

func WithClientBuildPackageFunc(fn BuildPackageFunc) Opt

func WithClientMainLoop

func WithClientMainLoop(mainLoop MainLoop) Opt

func WithClientPrefixPrefix

func WithClientPrefixPrefix(prefixPrefix string) Opt

func WithClientProtocolInterceptor

func WithClientProtocolInterceptor(pic protocol.ClientInterceptor) Opt

func WithClientUDPMode

func WithClientUDPMode(udpMode bool) Opt

Jump to

Keyboard shortcuts

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