Categorygithub.com/mrwitold/go-ts3
modulepackage
1.1.0
Repository: https://github.com/mrwitold/go-ts3.git
Documentation: pkg.go.dev

# README

TeamSpeak 3 Go Report Card License GoDoc Build Status

go-ts3 is a Go client for the TeamSpeak 3 ServerQuery Protocol.

Features

Installation

go get -u github.com/multiplay/go-ts3

Examples

Using go-ts3 is simple just create a client, login and then send commands e.g.

package main

import (
	"log"

        "github.com/multiplay/go-ts3"
)

func main() {
        c, err := ts3.NewClient("192.168.1.102:10011")
	if err != nil {
		log.Fatal(err)
	}
	defer c.Close()

	if err := c.Login(user, pass); err != nil {
		log.Fatal(err)
	}

	if v, err := c.Version(); err != nil {
		log.Fatal(err)
	} else {
		log.Println("server is running:", v)
	}
}

Documentation

License

go-ts3 is available under the BSD 2-Clause License.

# Functions

Buffer sets the initial buffer used to parse responses from the server and the maximum size of buffer that may be allocated.
ConnectHeader sets the header expected on connect.
Decode returns a decoded version of str.
DecodeResponse decodes a response into a struct.
KeepAlive sets the keepAlive interval.
NewArg returns a new Arg with key val.
NewArgGroup returns a new ArgGroup.
NewArgSet returns a new ArgSet.
NewClient returns a new TeamSpeak 3 client connected to addr.
NewCmd creates a new Cmd.
NewError returns a new Error parsed from TeamSpeak 3 server response.
NewInvalidResponseError returns a new InvalidResponseError from lines.
NotificationBuffer sets the notification buffer size.
ScanLines is a split function for a bytes.Scanner that returns each line of text, stripped of any trailing end-of-line marker.
Timeout sets read / write / dial timeout for a TeamSpeak 3 Client.

# Constants

ChannelEvents registers the following events: `cliententerview`, `clientleftview`, `channeldescriptionchanged`, `channelpasswordchanged` `channelmoved`, `channeledited`, `channelcreated`, `channeldeleted`, `clientmoved`.
Properties that can be changed with ClientUpdate.
Properties that can be changed with ClientUpdate.
Properties that can be changed with ClientUpdate.
Properties that can be changed with ClientUpdate.
Properties that can be changed with ClientUpdate.
DefaultConnectHeader send by server on connect.
DefaultPort is the default TeamSpeak 3 ServerQuery port.
ExtendedServerList can be passed to List to get extended server information.
MaxParseTokenSize is the maximum buffer size used to parse the server responses.
ServerEvents registers the following events: `cliententerview`, `clientleftview`, `serveredited`.
TextChannelEvents registers the `textmessage` event with `targetmode = 2`.
TextPrivateEvents registers the `textmessage` event with `targetmode = 1`.
TextServerEvents registers the `textmessage` event with `targetmode = 3`.
TokenUsedEvents registers the `tokenused` event.

# Variables

DefaultKeepAlive is the default interval in which keepalive data is sent.
DefaultNotifyBufSize is the default notification buffer size.
DefaultTimeout is the default read / write / dial timeout for Clients.
ErrInvalidConnectHeader is returned by NewClient if the server doesn't respond with the required connection header.
ErrNilOption is returned by NewClient if an option is nil.
ErrNotConnected is returned by Exec and ExecCmd if the client is not connected.
ErrTimeout is returned by Exec and ExecCmd if no response is received within the specified timeout duration.

# Structs

Arg represents a TeamSpeak 3 ServerQuery command argument.
ArgGroup represents a group of TeamSpeak 3 ServerQuery command arguments.
ArgSet represents a set of TeamSpeak 3 ServerQuery command arguments.
Channel represents a TeamSpeak 3 channel in a virtual server.
Client is a TeamSpeak 3 ServerQuery client.
Cmd represents a TeamSpeak 3 ServerQuery command.
ConnectionInfo represents an answer of the whoami command.
CreatedServer is the details returned by a server create.
DBClient represents a client identity on a virtual server.
Error represents a error returned from the TeamSpeak 3 server.
Group represents a virtual server group.
Instance represents basic information for a TeamSpeak 3 instance.
InvalidResponseError is the error returned when the response data was invalid.
Notification contains the information of a notify event.
OnlineClient represents a client online on a virtual server.
PrivilegeKey represents a server privilege key.
Server represents a TeamSpeak 3 virtual server.
ServerConnectionInfo represents the connection info for a TeamSpeak 3 instance.
ServerMethods groups server methods.
Version represents version information.

# Interfaces

CmdArg is implemented by types which can be used as a command argument.

# Type aliases

NotifyCategory is an event category.