| 1 | package slackscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ |
| 2 | |
| 3 | import ( |
| 4 | "fmtscip-go gomod github.com/golang/go/src go1.16 fmt/" |
| 5 | "timescip-go gomod github.com/golang/go/src go1.16 time/" |
| 6 | ) |
| 7 | |
| 8 | /** |
| 9 | * Internal events, created by this lib and not mapped to Slack APIs. |
| 10 | */ |
| 11 | |
| 12 | // ConnectedEvent is used for when we connect to Slack |
| 13 | type ConnectedEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectedEvent# struct { |
| 14 | ConnectionCountscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectedEvent#ConnectionCount. int // 1 = first time, 2 = second time |
| 15 | Infoscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectedEvent#Info. *Infoscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/Info# |
| 16 | } |
| 17 | |
| 18 | // ConnectionErrorEvent contains information about a connection error |
| 19 | type ConnectionErrorEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectionErrorEvent# struct { |
| 20 | Attemptscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectionErrorEvent#Attempt. int |
| 21 | Backoffscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectionErrorEvent#Backoff. timescip-go gomod github.com/golang/go/src go1.16 time/.Durationscip-go gomod github.com/golang/go/src go1.16 time/Duration# // how long we'll wait before the next attempt |
| 22 | ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectionErrorEvent#ErrorObj. error |
| 23 | } |
| 24 | |
| 25 | func (c *ConnectionErrorEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectionErrorEvent#) Errorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectionErrorEvent#Error().() string { |
| 26 | return c.ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectionErrorEvent#ErrorObj..Error() |
| 27 | } |
| 28 | |
| 29 | // ConnectingEvent contains information about our connection attempt |
| 30 | type ConnectingEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectingEvent# struct { |
| 31 | Attemptscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectingEvent#Attempt. int // 1 = first attempt, 2 = second attempt |
| 32 | ConnectionCountscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/ConnectingEvent#ConnectionCount. int |
| 33 | } |
| 34 | |
| 35 | // DisconnectedEvent contains information about how we disconnected |
| 36 | type DisconnectedEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/DisconnectedEvent# struct { |
| 37 | Intentionalscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/DisconnectedEvent#Intentional. bool |
| 38 | Causescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/DisconnectedEvent#Cause. error |
| 39 | } |
| 40 | |
| 41 | // LatencyReport contains information about connection latency |
| 42 | type LatencyReportscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/LatencyReport# struct { |
| 43 | Valuescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/LatencyReport#Value. timescip-go gomod github.com/golang/go/src go1.16 time/.Durationscip-go gomod github.com/golang/go/src go1.16 time/Duration# |
| 44 | } |
| 45 | |
| 46 | // InvalidAuthEvent is used in case we can't even authenticate with the API |
| 47 | type InvalidAuthEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/InvalidAuthEvent# struct{} |
| 48 | |
| 49 | // UnmarshallingErrorEvent is used when there are issues deconstructing a response |
| 50 | type UnmarshallingErrorEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/UnmarshallingErrorEvent# struct { |
| 51 | ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/UnmarshallingErrorEvent#ErrorObj. error |
| 52 | } |
| 53 | |
| 54 | func (u UnmarshallingErrorEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/UnmarshallingErrorEvent#) Errorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/UnmarshallingErrorEvent#Error().() string { |
| 55 | return u.ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/UnmarshallingErrorEvent#ErrorObj..Error() |
| 56 | } |
| 57 | |
| 58 | // MessageTooLongEvent is used when sending a message that is too long |
| 59 | type MessageTooLongEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/MessageTooLongEvent# struct { |
| 60 | Messagescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/MessageTooLongEvent#Message. OutgoingMessagescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/OutgoingMessage# |
| 61 | MaxLengthscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/MessageTooLongEvent#MaxLength. int |
| 62 | } |
| 63 | |
| 64 | func (m *MessageTooLongEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/MessageTooLongEvent#) Errorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/MessageTooLongEvent#Error().() string { |
| 65 | return fmtscip-go gomod github.com/golang/go/src go1.16 fmt/.Sprintfscip-go gomod github.com/golang/go/src go1.16 fmt/Sprintf().("Message too long (max %d characters)", m.MaxLengthscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/MessageTooLongEvent#MaxLength.) |
| 66 | } |
| 67 | |
| 68 | // RateLimitEvent is used when Slack warns that rate-limits are being hit. |
| 69 | type RateLimitEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/RateLimitEvent# struct{} |
| 70 | |
| 71 | func (e *RateLimitEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/RateLimitEvent#) Errorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/RateLimitEvent#Error().() string { |
| 72 | return "Messages are being sent too fast." |
| 73 | } |
| 74 | |
| 75 | // OutgoingErrorEvent contains information in case there were errors sending messages |
| 76 | type OutgoingErrorEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/OutgoingErrorEvent# struct { |
| 77 | Messagescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/OutgoingErrorEvent#Message. OutgoingMessagescip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/OutgoingMessage# |
| 78 | ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/OutgoingErrorEvent#ErrorObj. error |
| 79 | } |
| 80 | |
| 81 | func (o OutgoingErrorEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/OutgoingErrorEvent#) Errorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/OutgoingErrorEvent#Error().() string { |
| 82 | return o.ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/OutgoingErrorEvent#ErrorObj..Error() |
| 83 | } |
| 84 | |
| 85 | // IncomingEventError contains information about an unexpected error receiving a websocket event |
| 86 | type IncomingEventErrorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/IncomingEventError# struct { |
| 87 | ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/IncomingEventError#ErrorObj. error |
| 88 | } |
| 89 | |
| 90 | func (i *IncomingEventErrorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/IncomingEventError#) Errorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/IncomingEventError#Error().() string { |
| 91 | return i.ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/IncomingEventError#ErrorObj..Error() |
| 92 | } |
| 93 | |
| 94 | // AckErrorEvent i |
| 95 | type AckErrorEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/AckErrorEvent# struct { |
| 96 | ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/AckErrorEvent#ErrorObj. error |
| 97 | ReplyToscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/AckErrorEvent#ReplyTo. int |
| 98 | } |
| 99 | |
| 100 | func (a *AckErrorEventscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/AckErrorEvent#) Errorscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/AckErrorEvent#Error().() string { |
| 101 | return a.ErrorObjscip-go gomod github.com/slack-go/slack . `github.com/slack-go/slack`/AckErrorEvent#ErrorObj..Error() |
| 102 | } |