tsremote

package module
v0.0.0-...-4fa38d6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 23, 2022 License: MIT Imports: 9 Imported by: 0

README

ts5 Remote Application Library

This library is wrapping the teamspeak remote application API.

The library is in a really early state and not even close completed ... contributions are welcome!

Most information about the interface is from this and this official blog post. The other information comes from trial and error and reading events that are executed. Contact me if you encounter events that are not handled by my lib.

Installation

simply run go get github.com/jkoenig134/ts-remote-app

Usage

example/main.go provides a good example on how to listen to events and communicate to the client.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApiKeyProvider

type ApiKeyProvider interface {
	GetApiKey() string
	SetApiKey(string)
}

type AuthRequestPayload

type AuthRequestPayload struct {
	Identifier  string `json:"identifier"`
	Version     string `json:"version"`
	Name        string `json:"name"`
	Description string `json:"description"`
	Content     struct {
		ApiKey string `json:"apiKey"`
	} `json:"content"`
}

type ButtonPressPayload

type ButtonPressPayload struct {
	Button string `json:"button"`
	State  bool   `json:"state"`
}

type NewTsAppParams

type NewTsAppParams struct {
	Host string
	Port int
}

type RemoteApp

type RemoteApp struct {
	// contains filtered or unexported fields
}

func NewTsApp

func NewTsApp(provider ApiKeyProvider, p NewTsAppParams) RemoteApp

func (*RemoteApp) Connect

func (app *RemoteApp) Connect() error

func (*RemoteApp) Disconnect

func (app *RemoteApp) Disconnect()

func (*RemoteApp) SendAuthRequest

func (app *RemoteApp) SendAuthRequest(identifier, version, name, description string) error

func (*RemoteApp) SendButtonPress

func (app *RemoteApp) SendButtonPress(button string, state bool) error

func (*RemoteApp) SubscribeEvent

func (app *RemoteApp) SubscribeEvent(event event.AppEvent, fn interface{}) error

func (*RemoteApp) UnsubscribeEvent

func (app *RemoteApp) UnsubscribeEvent(event event.AppEvent, handler interface{}) error

type Request

type Request struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

type TypeScan

type TypeScan struct {
	Type string `json:"type"`
}

Directories

Path Synopsis
apiKey

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL