irc

package module
v0.0.0-...-42eabf7 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2020 License: MIT Imports: 8 Imported by: 1

Documentation

Overview

Package irc implements a simple irc client.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Handler *Events
	Options *ClientOptions
	// contains filtered or unexported fields
}

func (*Client) Close

func (c *Client) Close() error

func (*Client) Connect

func (c *Client) Connect() error

func (*Client) Run

func (c *Client) Run() error

func (*Client) Write

func (c *Client) Write(s string)

func (*Client) Writef

func (c *Client) Writef(format string, a ...interface{})

type ClientOptions

type ClientOptions struct {
	Host     string `required:"true"`
	Ident    string `required:"true"`
	Nickname string `required:"true"`
	Password string
	Port     string `required:"true"`
	Realname string `required:"true"`

	EnableProfiler bool `split_words:"true"`
	EnableTLS      bool `split_words:"true"`
}

ClientOptions supports optionally populating the struct using env vars. See https://github.com/kelseyhightower/envconfig#struct-tag-support

type Events

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

func NewEventHandler

func NewEventHandler() *Events

func (*Events) On

func (e *Events) On(command string, callback func(client *Client, message *Message))

type Message

type Message struct {
	Prefix, Command, Content string
	Params                   []string
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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