zombies

package module
v0.0.0-...-553e00e Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2015 License: MIT Imports: 5 Imported by: 2 modules, 1 package

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

zombies

The IRC zombie portion of Big Room

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrZombieDoesntExist is an error which says a Zombie does not exist
	ErrZombieDoesntExist = errors.New("Zombie does not exist")
)

Functions

func ParseChannelKey

func ParseChannelKey(s string) (string, error)

ParseChannelKey transforms a channel key in form x.x.x.x:6667/#channel into a channel and error TODO Fix when not parsing channel keys with the host is not an IP

Types

type Add

type Add struct {
	ID     int64  `json:"id"`
	Nick   string `json:"nick"`
	Server string `json:"server"`
}

Add is the protocol definition used to add a new IRC zombie

type Channels

type Channels struct {
	Channels []string `json:"channels"`
}

Channels is the protocol definition of a response containing a list of channels

type Join

type Join struct {
	ID      int64  `json:"id"`
	Channel string `json:"channel"`
}

Join is the protocol definition used to make an IRC zombie join a channel

type Send

type Send struct {
	ID      int64  `json:"id"`
	Channel string `json:"channel"`
	Message string `json:"message"`
}

Send is the protocol definition used to make an IRC zombie send a message to the IRC server

type Zombie

type Zombie struct {
	Messages chan Send

	Channels []string
	// contains filtered or unexported fields
}

Zombie is a struct which represents a Big Room user inside of an IRC server.

func NewZombie

func NewZombie(server, nick string) (*Zombie, error)

NewZombie either creates or retrieves a zombie. Zombies will be created if they do not already exist for that user on a server. Zombies will be retrieved if a zombie for the user on a server already exists

func (*Zombie) Invite

func (z *Zombie) Invite(nick, channel string)

func (*Zombie) Join

func (z *Zombie) Join(channels ...string)

Join makes the zombie join a bunch of channels. Channels are parsed in the form: x.x.x.x:6667/#channel

func (*Zombie) SetNick

func (z *Zombie) SetNick(name string)

SetNick will change the username of an IRC zombie

type Zombies

type Zombies struct {
	// contains filtered or unexported fields
}

Zombies represent a pool of zombies

func New

func New() *Zombies

New creates a new pool of Zombies

func (*Zombies) Exists

func (zs *Zombies) Exists(id int64) bool

Exists checks whether a zombie has been created

func (*Zombies) New

func (zs *Zombies) New(id int64, server, nick string) (*Zombie, error)

New creates a new zombie and adds it to the pool

func (*Zombies) Revive

func (zs *Zombies) Revive(id int64) (*Zombie, error)

Revive retrieves a zombie from the pool and associates it with a new WebSocket

Directories

Path Synopsis
cmd
pool command
Command pool is a kite which represents cluster of zombies
Command pool is a kite which represents cluster of zombies

Jump to

Keyboard shortcuts

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