Documentation ¶
Index ¶
- Constants
- Variables
- type Connection
- func (c *Connection) Close() error
- func (c *Connection) FlushData() error
- func (c *Connection) GetData(begin, end uint32) ([][]float64, error)
- func (c *Connection) GetHeader() (*Header, error)
- func (c *Connection) PutEvent(key, value string) error
- func (c *Connection) WaitData(nSamples, nEvents, timeout uint32) (uint32, uint32, error)
- type Header
- type HeaderChunk
Constants ¶
View Source
const ( CommandPutHdr uint16 = 0x101 CommandPutDat uint16 = 0x102 CommandPutEvt uint16 = 0x103 CommandPutOk uint16 = 0x104 CommandPutErr uint16 = 0x105 CommandGetHdr uint16 = 0x201 CommandGetDat uint16 = 0x202 CommandGetOk uint16 = 0x204 CommandGetErr uint16 = 0x205 CommandFlushDat uint16 = 0x302 CommandFlushOk uint16 = 0x304 CommandFlushErr uint16 = 0x305 CommandWaitDat uint16 = 0x402 CommandWaitOk uint16 = 0x404 CommandWaitErr uint16 = 0x405 )
View Source
const ( DataTypeChar uint32 = iota DataTypeUint8 DataTypeUint16 DataTypeuint32 DataTypeUint64 DataTypeInt8 DataTypeInt16 DataTypeInt32 DataTypeInt64 DataTypeFloat32 DataTypeFloat64 )
View Source
const (
DefaultHost = "localhost:1972"
)
Variables ¶
View Source
var ( ConnType = "tcp" ByteOrder = binary.BigEndian )
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
func Connect ¶
func Connect(host string) (*Connection, error)
Connect attempts a connection to the Buffer Server at given host Host can be in the format of "localhost:1972", and may be empty to use the default hostname.
func (*Connection) Close ¶
func (c *Connection) Close() error
Close closes the TCP connection with the host
func (*Connection) FlushData ¶
func (c *Connection) FlushData() error
func (*Connection) GetData ¶
func (c *Connection) GetData(begin, end uint32) ([][]float64, error)
GetData retrieves a 2d-array with sample data; one []float64 per sample
func (*Connection) GetHeader ¶
func (c *Connection) GetHeader() (*Header, error)
GetHeader retrieves some useful meta-information from the current connection
func (*Connection) PutEvent ¶
func (c *Connection) PutEvent(key, value string) error
type HeaderChunk ¶
type HeaderChunk struct { }
Click to show internal directories.
Click to hide internal directories.