Version: v0.1.4 Latest Latest

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

Go to latest
Published: Jun 27, 2020 License: MIT Imports: 5 Imported by: 0




View Source
const (
	// ControlCharacter defines the end of socket communication.
	ControlCharacter byte = '\a'
	// ControlCharacterString defines the end of socket communication.
	ControlCharacterString = "\a"


View Source
var SignalReload = Signal("reload")

SignalReload is the event for reloading all the Baito.


This section is empty.


type Signal

type Signal []byte

A Signal is an event sent through a socket.

type Socket added in v0.1.2

type Socket struct {
	// contains filtered or unexported fields

A Socket is used to send and receive signals through socket.

func New added in v0.1.2

func New(socket string) *Socket

New returns a new Socket.

func (*Socket) Close added in v0.1.2

func (s *Socket) Close() error

Close closes the listener if Listen as been called.

func (*Socket) Listen added in v0.1.2

func (s *Socket) Listen(handler func(event []byte) []byte) error

Listen opens the socket and wait for incoming events.

func (*Socket) Request added in v0.1.2

func (s *Socket) Request(event []byte) ([]byte, error)

Request dials the socket with the given event.

Jump to

Keyboard shortcuts

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