irc

package
v0.0.0-...-a3056fc Latest Latest
Warning

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

Go to latest
Published: Oct 1, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ISupport

type ISupport struct {
	Received bool
	Injected bool
	Tags     map[string]string
	// contains filtered or unexported fields
}

func (*ISupport) AddToken

func (m *ISupport) AddToken(tokenPair string)

func (*ISupport) AddTokens

func (m *ISupport) AddTokens(tokenPairs []string)

func (*ISupport) ClearTokens

func (m *ISupport) ClearTokens()

func (*ISupport) GetToken

func (m *ISupport) GetToken(key string) (val string)

func (*ISupport) HasToken

func (m *ISupport) HasToken(key string) (ok bool)

type Mask

type Mask struct {
	Nick     string
	Username string
	Hostname string
	Mask     string
}

type Message

type Message struct {
	Raw     string
	Tags    map[string]string
	Prefix  *Mask
	Command string
	Params  []string
}

func NewMessage

func NewMessage() *Message

func ParseLine

func ParseLine(input string) (*Message, error)

ParseLine - Turn a raw IRC line into a message

func (*Message) GetParam

func (m *Message) GetParam(idx int, def string) string

GetParam - Get a param value, returning a default value if it doesn't exist

func (*Message) GetParamU

func (m *Message) GetParamU(idx int, def string) string

GetParamU - Get a param value in uppercase, returning a default value if it doesn't exist

func (*Message) ToLine

func (m *Message) ToLine() string

ToLine - Convert the Message struct to its raw IRC line

type State

type State struct {
	LocalPort  int
	RemotePort int
	Username   string
	Nick       string
	RealName   string
	Password   string
	Account    string
	Modes      map[string]string

	Channels map[string]*StateChannel
	ISupport *ISupport
	// contains filtered or unexported fields
}

func NewState

func NewState() *State

func (*State) ClearChannels

func (m *State) ClearChannels()

func (*State) GetChannel

func (m *State) GetChannel(name string) (channel *StateChannel)

func (*State) HasChannel

func (m *State) HasChannel(name string) (ok bool)

func (*State) RemoveChannel

func (m *State) RemoveChannel(name string)

func (*State) SetChannel

func (m *State) SetChannel(channel *StateChannel)

type StateChannel

type StateChannel struct {
	Name   string
	Modes  map[string]string
	Joined time.Time
}

func NewStateChannel

func NewStateChannel(name string) *StateChannel

Jump to

Keyboard shortcuts

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