morse

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BaseReceive added in v1.1.0

func BaseReceive(m *Morse, ch chan string, ret *string)

Types

type Morse

type Morse struct {
	// default is j
	SinglePing string
	// default is k
	TriplePing string
	// default is l
	QuitPing string

	// default is .
	SingleLetter string
	// default is -
	TripleLetter string
	// default is " "
	IntervalLetter string
	// default is "QUIT"
	QuitLetter string

	// Milli second
	Interval int

	// send to chan
	Send
	// receive chan
	Recieve
}

func NewMorse

func NewMorse(opts ...Option) *Morse

func (*Morse) ConvertCode

func (m *Morse) ConvertCode(in string) []byte

func (*Morse) ConvertInputCode

func (m *Morse) ConvertInputCode(in string, ret *string, stdout bool)

func (*Morse) InitMessage

func (m *Morse) InitMessage() string

func (*Morse) SetRecieve

func (m *Morse) SetRecieve(f func(m *Morse, ch chan string, ret *string))

func (*Morse) SetSend

func (m *Morse) SetSend(f func(m *Morse, ch chan string))

type Option

type Option func(*Morse)

func Interval

func Interval(in int) Option

func IntervalLetter

func IntervalLetter(s string) Option

func QuitPing

func QuitPing(s string) Option

QuitPing is function to inform finish of input.

func QuitlLetter

func QuitlLetter(s string) Option

func SingleLetter

func SingleLetter(s string) Option

func SinglePing

func SinglePing(s string) Option

SinglePing is function to combine `.` and input key.

func TripleLetter

func TripleLetter(s string) Option

func TriplePing

func TriplePing(s string) Option

TriplePing is function to combine `-` and input key.

type Recieve

type Recieve func(chan string, *string)

type Send

type Send func(chan string)

Jump to

Keyboard shortcuts

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