Kaynağa Gözat

bump irc-go

tags/v2.6.0-rc1
Shivaram Lingamneni 3 yıl önce
ebeveyn
işleme
896ed91d45

+ 1
- 1
go.mod Dosyayı Görüntüle

10
 	github.com/go-sql-driver/mysql v1.5.0
10
 	github.com/go-sql-driver/mysql v1.5.0
11
 	github.com/go-test/deep v1.0.6 // indirect
11
 	github.com/go-test/deep v1.0.6 // indirect
12
 	github.com/gorilla/websocket v1.4.2
12
 	github.com/gorilla/websocket v1.4.2
13
-	github.com/goshuirc/irc-go v0.0.0-20210304031553-cf78e9176f96
13
+	github.com/goshuirc/irc-go v0.0.0-20210311004346-ea7a188a73fe
14
 	github.com/onsi/ginkgo v1.12.0 // indirect
14
 	github.com/onsi/ginkgo v1.12.0 // indirect
15
 	github.com/onsi/gomega v1.9.0 // indirect
15
 	github.com/onsi/gomega v1.9.0 // indirect
16
 	github.com/oragono/confusables v0.0.0-20201108231250-4ab98ab61fb1
16
 	github.com/oragono/confusables v0.0.0-20201108231250-4ab98ab61fb1

+ 2
- 0
go.sum Dosyayı Görüntüle

42
 github.com/goshuirc/irc-go v0.0.0-20210301225436-2c4b83d64847/go.mod h1:q/JhvvKLmif3y9q8MDQM+gRCnjEKnu5ClF298TTXJug=
42
 github.com/goshuirc/irc-go v0.0.0-20210301225436-2c4b83d64847/go.mod h1:q/JhvvKLmif3y9q8MDQM+gRCnjEKnu5ClF298TTXJug=
43
 github.com/goshuirc/irc-go v0.0.0-20210304031553-cf78e9176f96 h1:sihI3HsrJWyS4MtBmxh5W4gDZD34SWodkWyUvJltswY=
43
 github.com/goshuirc/irc-go v0.0.0-20210304031553-cf78e9176f96 h1:sihI3HsrJWyS4MtBmxh5W4gDZD34SWodkWyUvJltswY=
44
 github.com/goshuirc/irc-go v0.0.0-20210304031553-cf78e9176f96/go.mod h1:q/JhvvKLmif3y9q8MDQM+gRCnjEKnu5ClF298TTXJug=
44
 github.com/goshuirc/irc-go v0.0.0-20210304031553-cf78e9176f96/go.mod h1:q/JhvvKLmif3y9q8MDQM+gRCnjEKnu5ClF298TTXJug=
45
+github.com/goshuirc/irc-go v0.0.0-20210311004346-ea7a188a73fe h1:5UsPgeXJBkFgJK3Ml0nj6ljasjd26xiUxALnDJHmipE=
46
+github.com/goshuirc/irc-go v0.0.0-20210311004346-ea7a188a73fe/go.mod h1:q/JhvvKLmif3y9q8MDQM+gRCnjEKnu5ClF298TTXJug=
45
 github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
47
 github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
46
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
48
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
47
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
49
 github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=

+ 26
- 26
vendor/github.com/goshuirc/irc-go/ircmsg/message.go Dosyayı Görüntüle

61
 	ErrorBadParam = errors.New("Cannot have an empty param, a param with spaces, or a param that starts with ':' before the last parameter")
61
 	ErrorBadParam = errors.New("Cannot have an empty param, a param with spaces, or a param that starts with ':' before the last parameter")
62
 )
62
 )
63
 
63
 
64
-// IRCMessage represents an IRC message, as defined by the RFCs and as
64
+// Message represents an IRC message, as defined by the RFCs and as
65
 // extended by the IRCv3 Message Tags specification with the introduction
65
 // extended by the IRCv3 Message Tags specification with the introduction
66
 // of message tags.
66
 // of message tags.
67
-type IRCMessage struct {
67
+type Message struct {
68
 	Prefix         string
68
 	Prefix         string
69
 	Command        string
69
 	Command        string
70
 	Params         []string
70
 	Params         []string
77
 // will be encoded as a "trailing parameter" (preceded by a colon). This is
77
 // will be encoded as a "trailing parameter" (preceded by a colon). This is
78
 // almost never necessary and should not be used except when having to interact
78
 // almost never necessary and should not be used except when having to interact
79
 // with broken implementations that don't correctly interpret IRC messages.
79
 // with broken implementations that don't correctly interpret IRC messages.
80
-func (msg *IRCMessage) ForceTrailing() {
80
+func (msg *Message) ForceTrailing() {
81
 	msg.forceTrailing = true
81
 	msg.forceTrailing = true
82
 }
82
 }
83
 
83
 
84
 // GetTag returns whether a tag is present, and if so, what its value is.
84
 // GetTag returns whether a tag is present, and if so, what its value is.
85
-func (msg *IRCMessage) GetTag(tagName string) (present bool, value string) {
85
+func (msg *Message) GetTag(tagName string) (present bool, value string) {
86
 	if len(tagName) == 0 {
86
 	if len(tagName) == 0 {
87
 		return
87
 		return
88
 	} else if tagName[0] == '+' {
88
 	} else if tagName[0] == '+' {
95
 }
95
 }
96
 
96
 
97
 // HasTag returns whether a tag is present.
97
 // HasTag returns whether a tag is present.
98
-func (msg *IRCMessage) HasTag(tagName string) (present bool) {
98
+func (msg *Message) HasTag(tagName string) (present bool) {
99
 	present, _ = msg.GetTag(tagName)
99
 	present, _ = msg.GetTag(tagName)
100
 	return
100
 	return
101
 }
101
 }
102
 
102
 
103
 // SetTag sets a tag.
103
 // SetTag sets a tag.
104
-func (msg *IRCMessage) SetTag(tagName, tagValue string) {
104
+func (msg *Message) SetTag(tagName, tagValue string) {
105
 	if len(tagName) == 0 {
105
 	if len(tagName) == 0 {
106
 		return
106
 		return
107
 	} else if tagName[0] == '+' {
107
 	} else if tagName[0] == '+' {
118
 }
118
 }
119
 
119
 
120
 // DeleteTag deletes a tag.
120
 // DeleteTag deletes a tag.
121
-func (msg *IRCMessage) DeleteTag(tagName string) {
121
+func (msg *Message) DeleteTag(tagName string) {
122
 	if len(tagName) == 0 {
122
 	if len(tagName) == 0 {
123
 		return
123
 		return
124
 	} else if tagName[0] == '+' {
124
 	} else if tagName[0] == '+' {
129
 }
129
 }
130
 
130
 
131
 // UpdateTags is a convenience to set multiple tags at once.
131
 // UpdateTags is a convenience to set multiple tags at once.
132
-func (msg *IRCMessage) UpdateTags(tags map[string]string) {
132
+func (msg *Message) UpdateTags(tags map[string]string) {
133
 	for name, value := range tags {
133
 	for name, value := range tags {
134
 		msg.SetTag(name, value)
134
 		msg.SetTag(name, value)
135
 	}
135
 	}
136
 }
136
 }
137
 
137
 
138
 // AllTags returns all tags as a single map.
138
 // AllTags returns all tags as a single map.
139
-func (msg *IRCMessage) AllTags() (result map[string]string) {
139
+func (msg *Message) AllTags() (result map[string]string) {
140
 	result = make(map[string]string, len(msg.tags)+len(msg.clientOnlyTags))
140
 	result = make(map[string]string, len(msg.tags)+len(msg.clientOnlyTags))
141
 	for name, value := range msg.tags {
141
 	for name, value := range msg.tags {
142
 		result[name] = value
142
 		result[name] = value
148
 }
148
 }
149
 
149
 
150
 // ClientOnlyTags returns the client-only tags (the tags with the + prefix).
150
 // ClientOnlyTags returns the client-only tags (the tags with the + prefix).
151
-// The returned map may be internal storage of the IRCMessage object and
151
+// The returned map may be internal storage of the Message object and
152
 // should not be modified.
152
 // should not be modified.
153
-func (msg *IRCMessage) ClientOnlyTags() map[string]string {
153
+func (msg *Message) ClientOnlyTags() map[string]string {
154
 	return msg.clientOnlyTags
154
 	return msg.clientOnlyTags
155
 }
155
 }
156
 
156
 
157
 // ParseLine creates and returns a message from the given IRC line.
157
 // ParseLine creates and returns a message from the given IRC line.
158
-func ParseLine(line string) (ircmsg IRCMessage, err error) {
158
+func ParseLine(line string) (ircmsg Message, err error) {
159
 	return parseLine(line, 0, 0)
159
 	return parseLine(line, 0, 0)
160
 }
160
 }
161
 
161
 
162
-// ParseLineStrict creates and returns an IRCMessage from the given IRC line,
162
+// ParseLineStrict creates and returns an Message from the given IRC line,
163
 // taking the maximum length into account and truncating the message as appropriate.
163
 // taking the maximum length into account and truncating the message as appropriate.
164
 // If fromClient is true, it enforces the client limit on tag data length (4094 bytes),
164
 // If fromClient is true, it enforces the client limit on tag data length (4094 bytes),
165
 // allowing the server to return ERR_INPUTTOOLONG as appropriate. If truncateLen is
165
 // allowing the server to return ERR_INPUTTOOLONG as appropriate. If truncateLen is
166
 // nonzero, it is the length at which the non-tag portion of the message is truncated.
166
 // nonzero, it is the length at which the non-tag portion of the message is truncated.
167
-func ParseLineStrict(line string, fromClient bool, truncateLen int) (ircmsg IRCMessage, err error) {
167
+func ParseLineStrict(line string, fromClient bool, truncateLen int) (ircmsg Message, err error) {
168
 	maxTagDataLength := MaxlenTagData
168
 	maxTagDataLength := MaxlenTagData
169
 	if fromClient {
169
 	if fromClient {
170
 		maxTagDataLength = MaxlenClientTagData
170
 		maxTagDataLength = MaxlenClientTagData
180
 	return str[i:]
180
 	return str[i:]
181
 }
181
 }
182
 
182
 
183
-func parseLine(line string, maxTagDataLength int, truncateLen int) (ircmsg IRCMessage, err error) {
183
+func parseLine(line string, maxTagDataLength int, truncateLen int) (ircmsg Message, err error) {
184
 	// remove either \n or \r\n from the end of the line:
184
 	// remove either \n or \r\n from the end of the line:
185
 	line = strings.TrimSuffix(line, "\n")
185
 	line = strings.TrimSuffix(line, "\n")
186
 	line = strings.TrimSuffix(line, "\r")
186
 	line = strings.TrimSuffix(line, "\r")
279
 }
279
 }
280
 
280
 
281
 // helper to parse tags
281
 // helper to parse tags
282
-func (ircmsg *IRCMessage) parseTags(tags string) (err error) {
282
+func (ircmsg *Message) parseTags(tags string) (err error) {
283
 	for 0 < len(tags) {
283
 	for 0 < len(tags) {
284
 		tagEnd := strings.IndexByte(tags, ';')
284
 		tagEnd := strings.IndexByte(tags, ';')
285
 		endPos := tagEnd
285
 		endPos := tagEnd
311
 	return nil
311
 	return nil
312
 }
312
 }
313
 
313
 
314
-// MakeMessage provides a simple way to create a new IRCMessage.
315
-func MakeMessage(tags map[string]string, prefix string, command string, params ...string) (ircmsg IRCMessage) {
314
+// MakeMessage provides a simple way to create a new Message.
315
+func MakeMessage(tags map[string]string, prefix string, command string, params ...string) (ircmsg Message) {
316
 	ircmsg.Prefix = prefix
316
 	ircmsg.Prefix = prefix
317
 	ircmsg.Command = command
317
 	ircmsg.Command = command
318
 	ircmsg.Params = params
318
 	ircmsg.Params = params
320
 	return ircmsg
320
 	return ircmsg
321
 }
321
 }
322
 
322
 
323
-// Line returns a sendable line created from an IRCMessage.
324
-func (ircmsg *IRCMessage) Line() (result string, err error) {
323
+// Line returns a sendable line created from an Message.
324
+func (ircmsg *Message) Line() (result string, err error) {
325
 	bytes, err := ircmsg.line(0, 0, 0, 0)
325
 	bytes, err := ircmsg.line(0, 0, 0, 0)
326
 	if err == nil {
326
 	if err == nil {
327
 		result = string(bytes)
327
 		result = string(bytes)
329
 	return
329
 	return
330
 }
330
 }
331
 
331
 
332
-// LineBytes returns a sendable line created from an IRCMessage.
333
-func (ircmsg *IRCMessage) LineBytes() (result []byte, err error) {
332
+// LineBytes returns a sendable line created from an Message.
333
+func (ircmsg *Message) LineBytes() (result []byte, err error) {
334
 	result, err = ircmsg.line(0, 0, 0, 0)
334
 	result, err = ircmsg.line(0, 0, 0, 0)
335
 	return
335
 	return
336
 }
336
 }
337
 
337
 
338
-// LineBytesStrict returns a sendable line, as a []byte, created from an IRCMessage.
338
+// LineBytesStrict returns a sendable line, as a []byte, created from an Message.
339
 // fromClient controls whether the server-side or client-side tag length limit
339
 // fromClient controls whether the server-side or client-side tag length limit
340
 // is enforced. If truncateLen is nonzero, it is the length at which the
340
 // is enforced. If truncateLen is nonzero, it is the length at which the
341
 // non-tag portion of the message is truncated.
341
 // non-tag portion of the message is truncated.
342
-func (ircmsg *IRCMessage) LineBytesStrict(fromClient bool, truncateLen int) ([]byte, error) {
342
+func (ircmsg *Message) LineBytesStrict(fromClient bool, truncateLen int) ([]byte, error) {
343
 	var tagLimit, clientOnlyTagDataLimit, serverAddedTagDataLimit int
343
 	var tagLimit, clientOnlyTagDataLimit, serverAddedTagDataLimit int
344
 	if fromClient {
344
 	if fromClient {
345
 		// enforce client max tags:
345
 		// enforce client max tags:
359
 	return len(param) == 0 || strings.IndexByte(param, ' ') != -1 || param[0] == ':'
359
 	return len(param) == 0 || strings.IndexByte(param, ' ') != -1 || param[0] == ':'
360
 }
360
 }
361
 
361
 
362
-// line returns a sendable line created from an IRCMessage.
363
-func (ircmsg *IRCMessage) line(tagLimit, clientOnlyTagDataLimit, serverAddedTagDataLimit, truncateLen int) (result []byte, err error) {
362
+// line returns a sendable line created from an Message.
363
+func (ircmsg *Message) line(tagLimit, clientOnlyTagDataLimit, serverAddedTagDataLimit, truncateLen int) (result []byte, err error) {
364
 	if len(ircmsg.Command) == 0 {
364
 	if len(ircmsg.Command) == 0 {
365
 		return nil, ErrorCommandMissing
365
 		return nil, ErrorCommandMissing
366
 	}
366
 	}

+ 1
- 1
vendor/github.com/goshuirc/irc-go/ircmsg/tags.go Dosyayı Görüntüle

30
 // EscapeTagValue takes a value, and returns an escaped message tag value.
30
 // EscapeTagValue takes a value, and returns an escaped message tag value.
31
 //
31
 //
32
 // This function is automatically used when lines are created from an
32
 // This function is automatically used when lines are created from an
33
-// IRCMessage, so you don't need to call it yourself before creating a line.
33
+// Message, so you don't need to call it yourself before creating a line.
34
 func EscapeTagValue(inString string) string {
34
 func EscapeTagValue(inString string) string {
35
 	return valtoescape.Replace(inString)
35
 	return valtoescape.Replace(inString)
36
 }
36
 }

+ 9
- 9
vendor/github.com/goshuirc/irc-go/ircreader/ircreader.go Dosyayı Görüntüle

10
 )
10
 )
11
 
11
 
12
 /*
12
 /*
13
-IRCReader is an optimized line reader for IRC lines containing tags;
13
+Reader is an optimized line reader for IRC lines containing tags;
14
 most IRC lines will not approach the maximum line length (8191 bytes
14
 most IRC lines will not approach the maximum line length (8191 bytes
15
 of tag data, plus 512 bytes of message data), so we want a buffered
15
 of tag data, plus 512 bytes of message data), so we want a buffered
16
 reader that can start with a smaller buffer and expand if necessary,
16
 reader that can start with a smaller buffer and expand if necessary,
21
 	ErrReadQ = errors.New("readQ exceeded (read too many bytes without terminating newline)")
21
 	ErrReadQ = errors.New("readQ exceeded (read too many bytes without terminating newline)")
22
 )
22
 )
23
 
23
 
24
-type IRCReader struct {
24
+type Reader struct {
25
 	conn io.Reader
25
 	conn io.Reader
26
 
26
 
27
 	initialSize int
27
 	initialSize int
34
 	eof        bool
34
 	eof        bool
35
 }
35
 }
36
 
36
 
37
-// Returns a new *IRCReader with sane buffer size limits.
38
-func NewIRCReader(conn io.Reader) *IRCReader {
39
-	var reader IRCReader
37
+// Returns a new *Reader with sane buffer size limits.
38
+func NewIRCReader(conn io.Reader) *Reader {
39
+	var reader Reader
40
 	reader.Initialize(conn, 512, 8192+1024)
40
 	reader.Initialize(conn, 512, 8192+1024)
41
 	return &reader
41
 	return &reader
42
 }
42
 }
43
 
43
 
44
-// "Placement new" for an IRCReader; initializes it with custom buffer size
44
+// "Placement new" for a Reader; initializes it with custom buffer size
45
 // limits.
45
 // limits.
46
-func (cc *IRCReader) Initialize(conn io.Reader, initialSize, maxSize int) {
47
-	*cc = IRCReader{}
46
+func (cc *Reader) Initialize(conn io.Reader, initialSize, maxSize int) {
47
+	*cc = Reader{}
48
 	cc.conn = conn
48
 	cc.conn = conn
49
 	cc.initialSize = initialSize
49
 	cc.initialSize = initialSize
50
 	cc.maxSize = maxSize
50
 	cc.maxSize = maxSize
54
 // or \r\n as the line terminator (but not \r in isolation). Passes through
54
 // or \r\n as the line terminator (but not \r in isolation). Passes through
55
 // errors from the underlying connection. Returns ErrReadQ if the buffer limit
55
 // errors from the underlying connection. Returns ErrReadQ if the buffer limit
56
 // was exceeded without a terminating \n.
56
 // was exceeded without a terminating \n.
57
-func (cc *IRCReader) ReadLine() ([]byte, error) {
57
+func (cc *Reader) ReadLine() ([]byte, error) {
58
 	for {
58
 	for {
59
 		// try to find a terminated line in the buffered data already read
59
 		// try to find a terminated line in the buffered data already read
60
 		nlidx := bytes.IndexByte(cc.buf[cc.searchFrom:cc.end], '\n')
60
 		nlidx := bytes.IndexByte(cc.buf[cc.searchFrom:cc.end], '\n')

+ 1
- 1
vendor/modules.txt Dosyayı Görüntüle

21
 # github.com/gorilla/websocket v1.4.2 => github.com/oragono/websocket v1.4.2-oragono1
21
 # github.com/gorilla/websocket v1.4.2 => github.com/oragono/websocket v1.4.2-oragono1
22
 ## explicit
22
 ## explicit
23
 github.com/gorilla/websocket
23
 github.com/gorilla/websocket
24
-# github.com/goshuirc/irc-go v0.0.0-20210304031553-cf78e9176f96
24
+# github.com/goshuirc/irc-go v0.0.0-20210311004346-ea7a188a73fe
25
 ## explicit
25
 ## explicit
26
 github.com/goshuirc/irc-go/ircfmt
26
 github.com/goshuirc/irc-go/ircfmt
27
 github.com/goshuirc/irc-go/ircmsg
27
 github.com/goshuirc/irc-go/ircmsg

Loading…
İptal
Kaydet