File: client_handler.go

package info (click to toggle)
golang-gopkg-irc.v4 4.0.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 244 kB
  • sloc: python: 63; makefile: 2
file content (16 lines) | stat: -rw-r--r-- 390 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
package irc

// Handler is a simple interface meant for dispatching a message from
// a Client connection.
type Handler interface {
	Handle(*Client, *Message)
}

// HandlerFunc is a simple wrapper around a function which allows it
// to be used as a Handler.
type HandlerFunc func(*Client, *Message)

// Handle calls f(c, m).
func (f HandlerFunc) Handle(c *Client, m *Message) {
	f(c, m)
}