Documentation
¶
Overview ¶
Package tdaq is a minimal toolkit to implement a tiny data acquisition system.
Index ¶
- func SendCmd(ctx context.Context, sck Sender, cmd Cmder) error
- func SendFrame(ctx context.Context, sck Sender, frame Frame) error
- func SendMsg(ctx context.Context, sck Sender, msg MsgFrame) error
- type Cmd
- type CmdHandler
- type CmdType
- type Cmder
- type ConfigCmd
- type Context
- type Decoder
- func (dec *Decoder) Decode(ptr interface{}) error
- func (dec *Decoder) Err() error
- func (dec *Decoder) ReadBool() bool
- func (dec *Decoder) ReadF32() float32
- func (dec *Decoder) ReadF64() float64
- func (dec *Decoder) ReadI16() int16
- func (dec *Decoder) ReadI32() int32
- func (dec *Decoder) ReadI64() int64
- func (dec *Decoder) ReadI8() int8
- func (dec *Decoder) ReadStr() string
- func (dec *Decoder) ReadU16() uint16
- func (dec *Decoder) ReadU32() uint32
- func (dec *Decoder) ReadU64() uint64
- func (dec *Decoder) ReadU8() uint8
- type Encoder
- func (enc *Encoder) Encode(v interface{}) error
- func (enc *Encoder) Err() error
- func (enc *Encoder) WriteBool(v bool)
- func (enc *Encoder) WriteF32(v float32)
- func (enc *Encoder) WriteF64(v float64)
- func (enc *Encoder) WriteI16(v int16)
- func (enc *Encoder) WriteI32(v int32)
- func (enc *Encoder) WriteI64(v int64)
- func (enc *Encoder) WriteI8(v int8)
- func (enc *Encoder) WriteStr(v string)
- func (enc *Encoder) WriteU16(v uint16)
- func (enc *Encoder) WriteU32(v uint32)
- func (enc *Encoder) WriteU64(v uint64)
- func (enc *Encoder) WriteU8(v uint8)
- type EndPoint
- type Event
- type Frame
- type FrameType
- type InputHandler
- type JoinCmd
- type Marshaler
- type MsgFrame
- type OutputHandler
- type Recver
- type RunControl
- type RunHandler
- type Sender
- type Server
- type StatusCmd
- type Unmarshaler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Cmder ¶
type Cmder interface { Marshaler Unmarshaler CmdType() CmdType }
type Decoder ¶
type Decoder struct {
// contains filtered or unexported fields
}
Decoder decodes values from the underlying io.Reader, according to the TDAQ wire protocol.
func NewDecoder ¶
NewDecoder creates a new decoder connected to the provided io.Reader.
type Encoder ¶
type Encoder struct {
// contains filtered or unexported fields
}
Encoder encodes values to the underlying io.Writer, according to the TDAQ wire protocol.
func NewEncoder ¶
NewEncoder creates a new encoder, connected to the provided io.Writer.
type Event ¶
type Event struct { Type uint32 // event type Version uint32 // event version Flags uint32 DeviceID uint32 // device or stream number RunNbr uint32 EvtNbr uint32 TrigNbr uint32 Timestamp struct { Beg uint64 End uint64 } Descr string // description Tags map[string]interface{} // tags associated with that event Blocks map[uint32][]byte // blocks of raw data Subs []Event // sub events // contains filtered or unexported fields }
type Frame ¶
type Frame struct { Type FrameType // type of frame (cmd,data,err,ok) Path string // end-point path Body []byte // frame payload }
Frame is the datum being exchanged between tdaq processes.
type InputHandler ¶
type JoinCmd ¶
type JoinCmd struct { Name string // name of the process placing the /join command Ctl string // address of ctl-REP socket of the process HBeat string // address of hbeat-REP socket of the process Log string // address of log-PUB socket of the process InEndPoints []EndPoint OutEndPoints []EndPoint }
func (JoinCmd) MarshalTDAQ ¶
func (*JoinCmd) UnmarshalTDAQ ¶
type OutputHandler ¶
type RunControl ¶
type RunControl struct {
// contains filtered or unexported fields
}
func NewRunControl ¶
func (*RunControl) Do ¶
func (rc *RunControl) Do(ctx context.Context, cmd CmdType) error
Do sends the provided command to all connected TDAQ processes.
func (*RunControl) NumClients ¶
func (rc *RunControl) NumClients() int
NumClients returns the number of TDAQ processes connected to this run control.
type RunHandler ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) CmdHandle ¶
func (srv *Server) CmdHandle(name string, h CmdHandler)
func (*Server) InputHandle ¶
func (srv *Server) InputHandle(name string, h InputHandler)
func (*Server) OutputHandle ¶
func (srv *Server) OutputHandle(name string, h OutputHandler)
func (*Server) RunHandle ¶
func (srv *Server) RunHandle(f RunHandler)
type Unmarshaler ¶
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
cmd
|
|
tdaq-datasink
Command tdaq-datasink is a simple program that consumes data.
|
Command tdaq-datasink is a simple program that consumes data. |
tdaq-datasrc
Command tdaq-datasrc is a simple program that generates data.
|
Command tdaq-datasrc is a simple program that generates data. |
tdaq-i64-adder
Command tdaq-i64-adder is a simple program that consumes 2 streams of int64 data, add them together and passes the result on downstream.
|
Command tdaq-i64-adder is a simple program that consumes 2 streams of int64 data, add them together and passes the result on downstream. |
tdaq-i64-dump
Command tdaq-i64-dump is a simple program that consumes int64 data and dumps it on screen.
|
Command tdaq-i64-dump is a simple program that consumes int64 data and dumps it on screen. |
tdaq-i64-gen
Command tdaq-i64-gen is a simple program that generates int64 data.
|
Command tdaq-i64-gen is a simple program that generates int64 data. |
tdaq-i64-process
Command tdaq-i64-process is a simple program that consumes int64 data, doubles it and passes it on downstream.
|
Command tdaq-i64-process is a simple program that consumes int64 data, doubles it and passes it on downstream. |
tdaq-scaler
Command tdaq-scaler is a simple program that consumes data, applies some random pre-scaler filtering and passes it on downstream.
|
Command tdaq-scaler is a simple program that consumes data, applies some random pre-scaler filtering and passes it on downstream. |
tdaq-splitter
Command tdaq-splitter is a simple program that consumes data, applies some random filtering and passes it on either the left- or right-downstream.
|
Command tdaq-splitter is a simple program that consumes data, applies some random filtering and passes it on either the left- or right-downstream. |
Package config
|
Package config |
Package flags provides an easy creation of standard tdaq flag parameters for tdaq processes
|
Package flags provides an easy creation of standard tdaq flag parameters for tdaq processes |
internal
|
|
dflow
Package dflow exposes functions and types to represent a data-flow dependency graph.
|
Package dflow exposes functions and types to represent a data-flow dependency graph. |
iomux
Package iomux provides simple goroutine safe I/O primitives.
|
Package iomux provides simple goroutine safe I/O primitives. |
tcputil
Package tcputil provides functions for tcp.
|
Package tcputil provides functions for tcp. |
Package job provides a high-level API to create and schedule a pool of run-ctl and tdaq servers together.
|
Package job provides a high-level API to create and schedule a pool of run-ctl and tdaq servers together. |
Package log provides routines for logging messages.
|
Package log provides routines for logging messages. |
Package xdaq provides components for filtering and exercizing TDAQ sequences.
|
Package xdaq provides components for filtering and exercizing TDAQ sequences. |
Click to show internal directories.
Click to hide internal directories.