client

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2020 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultPort = 8883
)

Variables

This section is empty.

Functions

func AttachToCmdr

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

func DefaultLooper

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

func New

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

Types

type CmdrOpt

type CmdrOpt func(*builder)

func WithCmdrClientOptions

func WithCmdrClientOptions(opts ...Opt) CmdrOpt

func WithCmdrClientProtocolInterceptor

func WithCmdrClientProtocolInterceptor(fn 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 WithClientMainLoop

func WithClientMainLoop(mainLoop MainLoop) Opt

func WithClientPrefixPrefix

func WithClientPrefixPrefix(prefixPrefix string) Opt

func WithClientProtocolInterceptor

func WithClientProtocolInterceptor(fn 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