backend

package
v0.1.0-alpha Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2018 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package backend defines the types that UI components can use to get updates on chat state.

There are a few different planned implementations: "demo", which generates exemplary events / state internally; "local", which starts IRC clients within the process; and "daemon", which connects to another process that terminates the IRC connections, performs logging, etc.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	DataPublisher
	EventsArchive
	Sender
}

type DataPublisher

type DataPublisher interface {
	Subscribe(StateReceiver)
	SubscribeFiltered(FilteredStateReceiver)
}

A DataPublisher allows components to subscribe to updates. Only one subscriber of any sort may be active at a time, from a single DataPublisher.

type EventsArchive

type EventsArchive interface {
	EventsBefore(network, channel string, n int, last data.EventID) []data.Event
}

EventsArchive allows lookup of previous event entries.

type FilteredStateReceiver

type FilteredStateReceiver interface {
	StateReceiver

	Filter() (network, channel string)
}

FilteredStateReceiver only receives updates for a particular channel and its network.

type Sender

type Sender interface {
	Send(network, target string, message string)
}

Sender sends a message on the given network to the given target (channel or user).

type StateReceiver

type StateReceiver interface {
	UpdateNetwork(data.NetworkState)
	UpdateChannel(data.ChannelState)
}

StateReceiver receives updates about one or more networks and channels.

Directories

Path Synopsis
Package demo implements the discoirc non-UI portions with demo data.
Package demo implements the discoirc non-UI portions with demo data.

Jump to

Keyboard shortcuts

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