data

package
v0.1.1-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 25, 2017 License: MIT Imports: 2 Imported by: 5

Documentation

Overview

Package data holds the Store object that is used by our boutique instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Message

type Message struct {
	// ID is the ID of the message in the order it was sent.
	ID int
	// Timestamp is the time in which the message was written.
	Timestamp time.Time
	// User is the user who sent the message.
	User string
	// Text is the text of the message.
	Text string
}

Message represents a message sent.

type OpenFile

type OpenFile struct {
	*os.File

	// LastAccess is the last time the file was accessed.
	LastAccess time.Time
}

OpenFile contains access to a file and the last time we accessed it.

func (OpenFile) IsZero

func (o OpenFile) IsZero() bool

IsZero indicates that OpenFile has not been initialized.

type State

type State struct {
	// ServerID is a UUID that uniquely represents this server instance.
	ServerID string

	// Channel is the channel this represents.
	Channel string
	// Users are the users in the Channel.
	Users []string
	// Messages in the current messages.
	Messages []Message
	// NextMsgID is the ID of the next message to be sent.
	NextMsgID int

	// LogDebug indicates to start logging debug information.
	// LogChan indicates to log chat messages.
	LogDebug, LogChan bool
	// DebugFile holds access to the a debug file we opened for this channel.
	DebugFile OpenFile
	// ChanFile holds access to the chat log for the channel.
	ChanFile OpenFile
}

State holds our state data for each communication channel that is open.

Jump to

Keyboard shortcuts

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