control

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 4, 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 Msg

type Msg struct {
	*StateMsg
	*WordMsg
}

type Packet

type Packet struct {
	EncryptedData []byte
	EncryptedSize int
}

type Socket

type Socket struct {
	Conn net.Conn

	Listener *net.UnixListener
	Data     chan interface{}
	Done     chan bool
	// contains filtered or unexported fields
}

func CreateClient added in v0.4.3

func CreateClient() *Socket

ConnectSocket is used by the client to connect to the socket the server created for two-way communication

func CreateServer added in v0.4.3

func CreateServer(username string) *Socket

CreateServer is used by the server command to create a new socket for communication between server and client

func (*Socket) PauseServer added in v0.4.2

func (s *Socket) PauseServer()

PauseServer sends a state message to indicate the server should pause tracking key presses

func (*Socket) ResumeServer added in v0.4.2

func (s *Socket) ResumeServer()

ResumeServer sends a state message to indicate the server should resume tracking key presses

func (*Socket) SendWord

func (s *Socket) SendWord(w *WordMsg)

SendState sends a message to the socket of type Word

type State

type State byte
const (
	SocketPath       = "/tmp/autocorrector.sock"
	Resume     State = 0x01
	Pause      State = 0x00
)

type StateMsg

type StateMsg struct {
	State
}

type WordMsg

type WordMsg struct {
	Word, Correction string
}

Jump to

Keyboard shortcuts

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