socket

package
Version: v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

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

Variables

View Source
var SignalReload = Signal("reload")

SignalReload is the event for reloading all the Baito.

Functions

func Listen

func Listen(socket string, handler func(event []byte) []byte) error

Listen opens the socket and wait for incoming events.

func Request

func Request(socket string, event []byte) ([]byte, error)

Request dials the socket with the given event.

Types

type Signal

type Signal []byte

A Signal is an event sent through a socket.

Jump to

Keyboard shortcuts

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