abreuvoir

package module
v0.0.0-...-42d352b Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2021 License: MIT Imports: 7 Imported by: 0

README

Abreuvoir

Abreuvoir is a Golang implementation of the FRC Network Tables protocol.

Unmaintaned

See the alternative Network Tables golang implementation, ntgo.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// VERSION is the current NetworkTables protocol revision
	VERSION = [2]byte{0x03, 0x00}
	// IDENTITY is the identity of the client or server
	IDENTITY = "ABREUVOIR"
)

Functions

func InitClient

func InitClient() error

InitClient initializes the client and the connection to the remote server.

func SetAddress

func SetAddress(newAddress string)

SetAddress sets the address of the remote server It's advised to use a local host name instead of an IP for better

func SetPort

func SetPort(newPort string)

SetPort sets the port of the remote server

Types

type Client

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

Client is the NetworkTables Client

func (*Client) Close

func (client *Client) Close() error

Close disconnects and closes the client from the server.

func (*Client) GetBoolean

func (client *Client) GetBoolean(key string) bool

GetBoolean fetches a boolean at the specified key

func (*Client) QueueMessage

func (client *Client) QueueMessage(message message.Adapter) error

QueueMessage prepares the message that has been provided for sending.

type ClientMessageHandler

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

ClientMessageHandler handles incoming messages for the client.

type ClientStatus

type ClientStatus int

ClientStatus is the enum type to represent the different states/statuses the client could have

const (
	// ClientDisconnected indicates that the client cannot reach
	// the server
	ClientDisconnected ClientStatus = iota
	// ClientConnected indicates that the client has connected to
	// the server but has not began actual communication
	ClientConnected
	// ClientSentHello indicates that the client has sent the hello
	// packets and is waiting for a response from the server
	ClientSentHello
	// ClientStartingSync indicates that the client has received the
	// server hello and is beginning to synchronize values with the
	// server.
	ClientStartingSync
	// ClientInSync indicates that the client is completely in sync
	// with the server and has all the correct values.
	ClientInSync
)

type Server

type Server struct{}

Server is the NetworkTables Server

type Table

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

Table represents a collection of data at a specified depth in the network table

func (*Table) GetBoolean

func (table *Table) GetBoolean(key string) bool

GetBoolean calls GetBoolean on the client object

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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