irc

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DISCONNECTED = "DISCONNECTED"
	JOIN         = "JOIN"
	PART         = "PART"
	PRIVMSG      = "PRIVMSG"
	QUIT         = "QUIT"
)

These constant values must be used for the Command member of the Message struct.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gateway

type Gateway interface {
	api.Peripheral
	api.Receptor
	// Quit must disconnect the Gateway from the IRC server. This must be a blocking method. When the method returns,
	// the instance must not be connected to the IRC server anymore.
	Quit() error
	// Join method must send a JOIN command to the IRC server. The argument specifies the channel to be joined. If the
	// instance is not connected to any IRC server, then an error is returned.
	Join(channel string) error
	// Privmsg must send a PRIVMSG command to the IRC server. The first argument specifies the destination (i.e.  either
	// a user or a channel) and the second argument is the actual message. If the instance is not connected to any IRC
	// server, then an error is returned.
	Privmsg(destination string, message string) error
}

Gateway is the interface which for an IRC peripheral and receptor. The reference implementation at https://github.com/emersyx/emersyx_irc follows this interface.

type Message

type Message struct {
	Source     string
	Raw        string
	Command    string
	Origin     string
	Parameters []string
}

Message is the basic structure for an IRC message received by the client when an event occurs. Names of the struct members have been taken from RFC-1459 and RFC-2812. This is the structure which implements the Event interface for IRC events.

func (Message) GetSourceIdentifier

func (m Message) GetSourceIdentifier() string

GetSourceIdentifier returns the identifier of the Gateway instance which generated the emersyx event.

Source Files

  • gateway.go
  • message.go

Jump to

Keyboard shortcuts

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