Versions in this module Expand all Collapse all v1 v1.1.0 Apr 15, 2020 Changes in this version + const ClientDescription + const ClientIconID + const ClientIsChannelCommander + const ClientIsTalker + const ClientNickname + const DefaultConnectHeader + var DefaultKeepAlive = 200 * time.Second + var DefaultNotifyBufSize = 5 + var ErrNotConnected = errors.New("not connected") + var ErrTimeout = errors.New("timeout") + func ConnectHeader(connectHeader string) func(*Client) error + func KeepAlive(keepAlive time.Duration) func(*Client) error + func NotificationBuffer(size int) func(*Client) error type Channel + ChannelMaxClients int type Client + func (c *Client) ClientUpdate(properties ...CmdArg) error + func (c *Client) IsConnected() bool + func (c *Client) Notifications() <-chan Notification + func (c *Client) Register(event NotifyCategory) error + func (c *Client) RegisterChannel(id uint) error + func (c *Client) SetChannelCommander(val bool) error + func (c *Client) SetDescription(description string) error + func (c *Client) SetIcon(id int) error + func (c *Client) SetNick(nick string) error + func (c *Client) SetTalker(val bool) error + func (c *Client) Unregister() error + type Notification struct + Data map[string]string + Type string + type NotifyCategory string + const ChannelEvents + const ServerEvents + const TextChannelEvents + const TextPrivateEvents + const TextServerEvents + const TokenUsedEvents type OnlineClient + CID int + CLID int + ClientServerGroups string + ConnectionClientIP string type ServerMethods + func (s *ServerMethods) ClientKick(c OnlineClient, reasonid, reasonmsg string) error v1.0.0 Apr 3, 2018 Changes in this version + const DefaultPort + const ExtendedServerList + const MaxParseTokenSize + var DefaultTimeout = time.Second * 10 + var ErrInvalidConnectHeader = errors.New("invalid connect header") + var ErrNilOption = errors.New("nil option") + func Buffer(buf []byte, max int) func(*Client) error + func Decode(str string) string + func DecodeResponse(lines []string, v interface{}) error + func ScanLines(data []byte, atEOF bool) (advance int, token []byte, err error) + func Timeout(timeout time.Duration) func(*Client) error + type Arg struct + func NewArg(key string, val interface{}) *Arg + func (a *Arg) ArgString() string + type ArgGroup struct + func NewArgGroup(args ...CmdArg) *ArgGroup + func (ag *ArgGroup) ArgString() string + type ArgSet struct + func NewArgSet(args ...CmdArg) *ArgSet + func (ag *ArgSet) ArgString() string + type Channel struct + ChannelName string + ChannelOrder int + ID int + NeededSubscribePower int + ParentID int + TotalClients int + type Client struct + Server *ServerMethods + func NewClient(addr string, options ...func(c *Client) error) (*Client, error) + func (c *Client) Close() error + func (c *Client) Exec(cmd string) ([]string, error) + func (c *Client) ExecCmd(cmd *Cmd) ([]string, error) + func (c *Client) Login(user, passwd string) error + func (c *Client) Logout() error + func (c *Client) Use(id int) error + func (c *Client) UsePort(port int) error + func (c *Client) Version() (*Version, error) + func (c *Client) Whoami() (*ConnectionInfo, error) + type Cmd struct + func NewCmd(cmd string) *Cmd + func (c *Cmd) String() string + func (c *Cmd) WithArgs(args ...CmdArg) *Cmd + func (c *Cmd) WithOptions(options ...string) *Cmd + func (c *Cmd) WithResponse(r interface{}) *Cmd + type CmdArg interface + ArgString func() string + type ConnectionInfo struct + ClientChannelID int + ClientDatabaseID int + ClientID int + ClientLoginName string + ClientName string + ClientOriginServerID int + ClientUniqueIdentifier string + ServerID int + ServerPort int + ServerStatus string + ServerUniqueIdentifier string + type CreatedServer struct + ID int + Port uint16 + Token string + type DBClient struct + Connections int + Created time.Time + ID int + LastConnected time.Time + Nickname string + UniqueIdentifier string + type Error struct + Details map[string]interface{} + ID int + Msg string + func NewError(matches []string) *Error + func (e *Error) Error() string + type Group struct + ID int + IconID int + MemberAddPower int + MemberRemovePower int + ModifyPower int + Name string + NameMode int + Saved bool + SortID int + Type int + type Instance struct + DatabaseVersion int + FileTransferPort int + GuestServerQueryGroup int + MaxTotalDownloadBandwidth uint64 + MaxTotalUploadBandwidth uint64 + PendingConnectionsPerIP int + PermissionsVersion int + ServerQueryBanTime int + ServerQueryFloodCommands int + ServerQueryFloodTime int + TemplateChannelAdminGroup int + TemplateChannelDefaultGroup int + TemplateServerAdminGroup int + TemplateServerDefaultGroup int + type InvalidResponseError struct + Data []string + Reason string + func NewInvalidResponseError(reason string, lines []string) *InvalidResponseError + func (e *InvalidResponseError) Error() string + type OnlineClient struct + Away bool + AwayMessage string + DatabaseID int + ID int + Nickname string + Type int + type PrivilegeKey struct + Created int + Description string + ID1 int + ID2 int + Token string + Type int + type Server struct + AntiFloodPointsNeededCommandBlock int + AntiFloodPointsNeededIPBlock int + AntiFloodPointsTickReduce int + AskForPrivilegeKey bool + AutoStart bool + BandwidthReceivedLastMinuteTotal int + BandwidthReceivedLastSecondTotal int + BandwidthSentLastMinuteTotal int + BandwidthSentLastSecondTotal int + ChannelTempDeleteDelayDefault int + ChannelsOnline int + ClientsOnline int + CodecEncryptionMode int + ComplainAutoBanCount int + ComplainAutoBanTime int + ComplainRemoveTime int + Created int + DefaultChannelAdminGroup int + DefaultChannelGroup int + DefaultServerGroup int + FileBase string + FlagPassword bool + HostBannerGFXInterval int + HostBannerGFXURL string + HostBannerMode int + HostBannerURL string + HostButtonGFXURL string + HostButtonToolTip string + HostButtonURL string + HostMessage string + HostMessageMode int + ID int + IconID int + LogChannel bool + LogClient bool + LogFileTransfer bool + LogPermissions bool + LogQuery bool + LogServer bool + MachineID string + MaxClients int + MaxDownloadTotalBandwidth uint64 + MaxUploadTotalBandwidth uint64 + MinAndroidVersion int + MinClientVersion int + MinClientsInChannelBeforeForcedSilence int + MiniOSVersion int + MonthBytesDownloaded int64 + MonthBytesUploaded int64 + Name string + NamePhonetic string + NeededIdentitySecurityLevel int + Password string + Platform string + Port int + PrioritySpeakerDimmModificator float32 + QueryClientsOnline int + ReservedSlots int + Status string + TotalBytesDownloaded int64 + TotalBytesUploaded int64 + TotalPacketLossControl float64 + TotalPacketLossKeepalive float64 + TotalPacketLossSpeech float64 + TotalPacketLossTotal float64 + TotalPing float32 + UniqueIdentifier string + Uptime int + Version string + VirtualServerDownloadQuota uint64 + VirtualServerUploadQuota uint64 + WebListEnabled bool + WelcomeMessage string + type ServerConnectionInfo struct + BandwidthReceivedLastMinute uint64 + BandwidthReceivedLastSecond uint64 + BandwidthSentLastMinute uint64 + BandwidthSentLastSecond uint64 + BytesReceivedTotal uint64 + BytesSentTotal uint64 + ConnectedTime uint32 + FileTransferBandwidthReceived uint64 + FileTransferBandwidthSent uint64 + FileTransferTotalReceived uint64 + FileTransferTotalSent uint64 + PacketLossTotalAvg float32 + PacketsReceivedTotal uint64 + PacketsSentTotal uint64 + PingTotalAvg float32 + type ServerMethods struct + func (s *ServerMethods) ChannelList() ([]*Channel, error) + func (s *ServerMethods) ClientDBList() ([]*DBClient, error) + func (s *ServerMethods) ClientList() ([]*OnlineClient, error) + func (s *ServerMethods) Create(name string, args ...CmdArg) (*CreatedServer, error) + func (s *ServerMethods) Delete(id int) error + func (s *ServerMethods) Edit(args ...CmdArg) error + func (s *ServerMethods) GroupList() ([]*Group, error) + func (s *ServerMethods) IDGetByPort(port uint16) (int, error) + func (s *ServerMethods) Info() (*Server, error) + func (s *ServerMethods) InstanceInfo() (*Instance, error) + func (s *ServerMethods) List(options ...string) (servers []*Server, err error) + func (s *ServerMethods) PrivilegeKeyAdd(ttype, id1, id2 int, options ...CmdArg) (string, error) + func (s *ServerMethods) PrivilegeKeyList() ([]*PrivilegeKey, error) + func (s *ServerMethods) ServerConnectionInfo() (*ServerConnectionInfo, error) + func (s *ServerMethods) Start(id int) error + func (s *ServerMethods) Stop(id int) error + type Version struct + Build int + Platform string + Version string