clarkio

package
v0.0.0-...-bf74b40 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2019 License: GPL-2.0 Imports: 10 Imported by: 0

Documentation

Overview

clarkio implements the bottom layer for both sending and receiving messages to i3bar.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ReadClicks

func ReadClicks(reader io.Reader, clickChannels map[string]chan<- *protocol.Click)

ReadClicks implements an event loop and will never return. We expect our reader to produce an infinite JSON stream as specified by the i3bar protocol. Each time we manage to unmarshal a Click into a protocol.Click struct we attempt to send said Click to the relevant channel. The relevant channel is found by examining Click.Name and Click.Instance. i.e

key := click.Name + "_" + click.Instance

If this key is found in our map then we write the click event to this channel.

func RunBlock

func RunBlock(run blocks.RunFunc, c <-chan *protocol.Click, b chan<- *protocol.Block)

func WriteBlocks

func WriteBlocks(writer io.Writer, blockChannels []<-chan *protocol.Block)

WriteBlocks implements an event loop and will never return. We listen on all the channels in the blockChannels variable and write to the writer when updates are required.

Types

This section is empty.

Jump to

Keyboard shortcuts

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