irc

package
v0.0.0-...-bcd4d23 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package irc provides a specialised IRC client designed for gathering statistics only.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Flags

func Flags(prefix string, options *Options)

Flags adds the relevant flags from this package, with their names prefixed with the given prefix.

Types

type Client

type Client struct {
	Server string
	// contains filtered or unexported fields
}

func NewClient

func NewClient(options Options) *Client

func (*Client) Start

func (c *Client) Start()

Start manages a connection to the server. It does not return (run it in a goroutine).

func (*Client) Stats

func (c *Client) Stats(s StatsRequest) StatsResponse

type CommandStats

type CommandStats struct {
	Count, Bytes, RemoteCount int
}

type Options

type Options struct {
	Server                 string
	Password               string
	Nick                   string
	OperUser, OperPassword string
}

Options specifies the parameters for a client, can be created by Flags which parses a set of flags, or by other means.

type ServerStats

type ServerStats struct {
	Up                        bool
	RequestTime, ResponseTime time.Time
	Distance, Users           int
	Command                   map[string]CommandStats
	// contains filtered or unexported fields
}

type StatsRequest

type StatsRequest struct {
	Local         bool
	StatsM        bool
	Timeout       time.Duration
	IgnoreServers []string
	Nicks         []string
	// contains filtered or unexported fields
}

type StatsResponse

type StatsResponse struct {
	Timeout  bool
	Servers  map[string]*ServerStats
	Channels int
	Nicks    map[string]bool
}

Jump to

Keyboard shortcuts

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