Documentation
¶
Index ¶
- Constants
- func DecodeResponse(text string) (res map[string]interface{})
- func ReplaceAnsiEscapeCode(text string) string
- type Client
- type Error
- type IClientType
- type IReasonId
- type Message
- type Notify
- type NotifyClientEnterView
- type NotifyClientLeftView
- type NotifyEventType
- type Protocol
- type Query
- type Type
Constants ¶
View Source
const ( ReasonIdIndependentlySwitchChannelsOrEnterServer IReasonId = iota ReasonIdUserOrChannelMoved = 1 ReasonIdTimeout = 3 ReasonIdChannelKick = 4 ReasonIdServerKick = 5 ReasonIdBan = 6 ReasonIdVoluntarilyLeaveServer = 8 ReasonIdServerOrChannelEdited = 10 ReasonIdServerShutdown = 11 )
View Source
const ( DefaultConnectTimeout = time.Second * 10 DefaultMsgPipeLength = 10 MaxBufferSize = 10 << 20 DefaultBufferSize = 4096 )
View Source
const (
MinKeepAliveDuration = time.Second * 5
)
View Source
const TitleCheck = "TS3"
Variables ¶
This section is empty.
Functions ¶
func DecodeResponse ¶
func ReplaceAnsiEscapeCode ¶
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Notification ¶
type IClientType ¶
type IClientType int
const ( ClientTypeVoice IClientType = iota ClientTypeQuery = 1 )
type Notify ¶
type Notify interface {
Type() NotifyEventType
Decode(content map[string]interface{}) error
}
type NotifyClientEnterView ¶
type NotifyClientEnterView struct {
// Cfid source channel; "0" when entering the server
Cfid int `mapstructure:"cfid"`
// Ctid target channel
Ctid int `mapstructure:"ctid"`
ReasonId IReasonId `mapstructure:"reasonid"`
Clid int `mapstructure:"clid"`
ClientUniqueIdentifier string `mapstructure:"client_unique_identifier"`
ClientNickname string `mapstructure:"client_nickname"`
ClientInputMuted int `mapstructure:"client_input_muted"`
ClientOutputMuted int `mapstructure:"client_output_muted"`
ClientOutputOnlyMuted int `mapstructure:"client_outputonly_muted"`
ClientInputHardware int `mapstructure:"client_input_hardware"`
ClientOutputHardWare int `mapstructure:"client_output_hardware"`
ClientMetaData string `mapstructure:"client_meta_data"`
ClientIsRecording int `mapstructure:"client_is_recording"`
ClientDatabaseId int `mapstructure:"client_database_id"`
ClientServerGroups int `mapstructure:"client_server_groups"`
ClientAway int `mapstructure:"client_away"`
ClientAwayMessage string `mapstructure:"client_away_message"`
ClientType IClientType `mapstructure:"client_type"`
ClientFlagAvatar string `mapstructure:"client_flag_avatar"`
ClientTalkPower int `mapstructure:"client_talk_power"`
ClientTalkRequest int `mapstructure:"client_talk_request"`
ClientTalkRequestMsg string `mapstructure:"client_talk_request_msg"`
ClientDescription string `mapstructure:"client_description"`
ClientIsTalker int `mapstructure:"client_is_talker"`
ClientIsPrioritySpeaker int `mapstructure:"client_is_priority_speaker"`
ClientUnreadMessages int `mapstructure:"client_unread_messages"`
ClientNicknamePhonetic string `mapstructure:"client_nickname_phonetic"`
ClientNeededServerQueryViewPower int `mapstructure:"client_needed_serverquery_view_power"`
ClientIconId int `mapstructure:"client_icon_id"`
ClientIsChannelCommander int `mapstructure:"client_is_channel_commander"`
ClientCountry string `mapstructure:"client_country"`
ClientChannelGroupInheritedChannelId int `mapstructure:"client_channel_group_inherited_channel_id"`
ClientBadges string `mapstructure:"client_badges"`
ClientMyteamspeakId string `mapstructure:"client_myteamspeak_id"`
ClientIntegrations string `mapstructure:"client_integrations"`
ClientMyteamspeakAvatar string `mapstructure:"client_myteamspeak_avatar"`
ClientSignedBadges string `mapstructure:"client_signed_badges"`
// contains filtered or unexported fields
}
func (*NotifyClientEnterView) Decode ¶
func (n *NotifyClientEnterView) Decode(content map[string]interface{}) (err error)
func (*NotifyClientEnterView) Type ¶
func (n *NotifyClientEnterView) Type() NotifyEventType
type NotifyClientLeftView ¶
type NotifyClientLeftView struct {
Cfid int `mapstructure:"cfid"`
Ctid int `mapstructure:"ctid"`
ReasonId IReasonId `mapstructure:"reasonid"`
ReasonMsg string `mapstructure:"reasonmsg"`
Clid int `mapstructure:"clid"`
InvokerId string `mapstructure:"invokerid"`
InvokerName string `mapstructure:"invokername"`
InvokerUid int `mapstructure:"invokeruid"`
Bantime int `mapstructure:"bantime"`
}
func (*NotifyClientLeftView) Decode ¶
func (n *NotifyClientLeftView) Decode(content map[string]interface{}) (err error)
func (*NotifyClientLeftView) Type ¶
func (n *NotifyClientLeftView) Type() NotifyEventType
type NotifyEventType ¶
type NotifyEventType string
const ( ClientEnterView NotifyEventType = "notifycliententerview" ClientLeftView = "notifyclientleftview" )
type Protocol ¶
type Protocol interface {
Connect(host string, port int, username string, password string) error
Disconnect() error
SetInput(content string) error
GetOutputPipe() (<-chan string, error)
}
Protocol provide an interface to implement transport protocol
func NewProtocol ¶
type Query ¶
type Query interface {
Init(protocol Protocol, keepAliveDuration time.Duration, keepAliveData string, keepAliveResponseLines int) error
Request(content string) error
GetResponsePipe() (<-chan string, error)
Close() error
}
Query provide an interface to implement standard io with protocol io
Click to show internal directories.
Click to hide internal directories.