client

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2017 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// StatusChannel default name
	StatusChannel = "komanda-status"
)

Variables

View Source
var IrcCodes = []string{}/* 162 elements not displayed */

IrcCodes for message hanlders https://www.alien.net.au/irc/irc2numerics.html

Functions

func New

func New(server *Server) *ircClient.Conn

New irc connection

func StatusMessage

func StatusMessage(view *gocui.View, data string)

StatusMessage will formart a string and write to the status channel

Types

type Channel

type Channel struct {
	Status        bool
	Ready         bool
	Unread        bool
	Highlight     bool
	Name          string
	Server        *Server
	MaxX          int
	MaxY          int
	RenderHandler RenderHandlerFunc
	Topic         string
	TopicSetBy    string
	Users         []*User
	NickListReady bool
	Loading       *nbc.NonBlockingChan
	Private       bool
	// contains filtered or unexported fields
}

Channel struct

func (*Channel) AddNick

func (channel *Channel) AddNick(nick string)

AddNick to channel list

func (*Channel) Current added in v0.9.2

func (channel *Channel) Current() bool

Current returns true or false if the current channel is this channel

func (*Channel) FindUser

func (channel *Channel) FindUser(nick string) *User

FindUser returns a pointer for a given user or nil

func (*Channel) NickListString

func (channel *Channel) NickListString(v *gocui.View, c bool)

NickListString will output the channel users in a pretty format

func (*Channel) NickMetricsString

func (channel *Channel) NickMetricsString(view *gocui.View)

NickMetricsString will output channel metrics in a pretty format 09:41 * Irssi: #google-containers: Total of 213 nicks [0 ops, 0 halfops, 0 voices, 213 normal]

func (*Channel) RemoveNick

func (channel *Channel) RemoveNick(nick string)

RemoveNick from channel list

func (*Channel) Render

func (channel *Channel) Render(update bool) error

Render the current channel

func (*Channel) Update

func (channel *Channel) Update() (*gocui.View, error)

Update will render the current channel again

func (*Channel) View

func (channel *Channel) View() (*gocui.View, error)

View returns the channel view

type Handler

type Handler func(*Channel, *gocui.Gui, *gocui.View, *Server) error

Handler type for Exec function returns

type NickSorter

type NickSorter []*User

NickSorter cast to an array of user pointers

func (NickSorter) Len

func (a NickSorter) Len() int

Len returns the list length

func (NickSorter) Less

func (a NickSorter) Less(i, j int) bool

Less checks if i is less than j to change position

func (NickSorter) Swap

func (a NickSorter) Swap(i, j int)

Swap moves the position of two items in the list

type RenderHandlerFunc

type RenderHandlerFunc func(*Channel, *gocui.View) error

RenderHandlerFunc type for Exec callbacks

type Server

type Server struct {
	Gui      *gocui.Gui
	Client   *ircClient.Conn
	Channels []*Channel

	Address      string
	Port         string
	SSL          bool
	User         string
	Password     string
	NickPassword string

	Nick    string
	AltNick string

	Version            string
	CurrentChannel     string
	InsecureSkipVerify bool
	AutoConnect        bool
	// contains filtered or unexported fields
}

Server struct

func (*Server) AddChannel

func (server *Server) AddChannel(channel *Channel)

AddChannel to server channel list

func (*Server) ChannelView

func (server *Server) ChannelView(name string) (*gocui.View, error)

ChannelView returns a channel view by name or returns an error

func (*Server) Exec

func (server *Server) Exec(channel string, h Handler)

Exec callback for a given channel

func (*Server) FindChannel

func (server *Server) FindChannel(name string) *Channel

FindChannel in server channel list

func (*Server) GetCurrentChannel

func (server *Server) GetCurrentChannel() *Channel

GetCurrentChannel will return the current channel in view

func (*Server) HasChannel

func (server *Server) HasChannel(name string) (*Channel, int, bool)

HasChannel returns a channel if it exists in the server channel list

func (*Server) NewChannel

func (server *Server) NewChannel(name string, private bool) error

NewChannel will create a channel and add it to the server list

func (*Server) RemoveChannel

func (server *Server) RemoveChannel(name string) (int, error)

RemoveChannel will remove a channel from the server channel list

type User

type User struct {
	Nick  string
	Mode  string
	Color int
}

User struct

func (*User) String

func (u *User) String(c bool) string

String converts the user struct to a string

Jump to

Keyboard shortcuts

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