Documentation ¶
Overview ¶
Package data contains data types used by discoirc.
Index ¶
- func Less(a EventID, b EventID) bool
- type Channel
- type ChannelState
- type Connection
- type ConnectionState
- type Event
- type EventID
- type EventList
- func (e EventList) Len() int
- func (e EventList) Less(i, j int) bool
- func (e EventList) SelectMinMax(min, max EventID) []Event
- func (e EventList) SelectMinSize(min EventID, n uint) []Event
- func (e EventList) SelectSize(n uint) []Event
- func (e EventList) SelectSizeMax(n uint, max EventID) []Event
- func (e EventList) Swap(i, j int)
- type Events
- type NetworkState
- type Presence
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Channel ¶
type Channel struct { Name string Connection Connection Topic string Presence Presence Mode string }
Channel represents the state of a user's presence in a channel.
type ChannelState ¶
type ChannelState struct {
Network, Channel string
Presence Presence
// TODO: This representation is incorrect.
// A user's mode is for the network, not to the channel.
ChannelMode, UserMode string
Topic string
Members int
Unread int
LastMessage Event
}
ChannelState summarizes the state of a channel.
type Connection ¶
type Connection struct { Network string Nick string State ConnectionState }
Connection represents a user's relation with an IRC network.
type ConnectionState ¶
type ConnectionState int
ConnectionState represents the status of a user's connection to an IRC network.
const ( Disconnected ConnectionState = iota Connecting Connected )
type EventID ¶
An EventID is a unique, sequenceable identifier for an event. Within a scope, e.g. a channel, events are lexicographically ordered- by epoch, then by sequence. An Epoch may be ticked over when a log file rolls over, when a server disconnects, or in other circumstances. Usually, it represents when there was a potential discontinuity in events. Epochs may be negative because they may extend indefinitely into the past, e.g. via logfiles or an external log server.
type EventList ¶
type EventList []Event
func (EventList) SelectMinMax ¶
Select returns a slice from its receiver with those within the EventRange.
func (EventList) SelectMinSize ¶
SelectMinSize selects at most n Events starting from min.
func (EventList) SelectSize ¶
SelectSize selects the most recent n events.
func (EventList) SelectSizeMax ¶
SelectMaxSize selects at most n Events ending at max.
type NetworkState ¶
type NetworkState struct {
Network, Nick string
State ConnectionState
// TODO: make UserMode and ChannelMode their own types
UserMode string
}