mirror of
https://github.com/nshttpd/mikrotik-exporter.git
synced 2024-12-12 14:26:51 +01:00
23 lines
408 B
Go
23 lines
408 B
Go
package routeros
|
|
|
|
import "gopkg.in/routeros.v2/proto"
|
|
|
|
// chanReply is shared between ListenReply and AsyncReply.
|
|
type chanReply struct {
|
|
tag string
|
|
err error
|
|
reC chan *proto.Sentence
|
|
}
|
|
|
|
// Err returns the first error that happened processing sentences with tag.
|
|
func (a *chanReply) Err() error {
|
|
return a.err
|
|
}
|
|
|
|
func (a *chanReply) close(err error) {
|
|
if a.err == nil {
|
|
a.err = err
|
|
}
|
|
close(a.reC)
|
|
}
|