Documentation ¶
Overview ¶
Package dropsonde_marshaller provides a tool for marshalling Envelopes to Protocol Buffer messages.
Use ¶
Instantiate a Marshaller and run it:
marshaller := dropsonde_marshaller.NewDropsondeMarshaller(logger) inputChan := make(chan *events.Envelope) // or use a channel provided by some other source outputChan := make(chan []byte) go marshaller.Run(inputChan, outputChan)
The marshaller self-instruments, counting the number of messages processed and the number of errors. These can be accessed through the Emit function on the marshaller.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DropsondeMarshaller ¶
type DropsondeMarshaller struct {
// contains filtered or unexported fields
}
A DropsondeMarshaller is an self-instrumenting tool for converting dropsonde Envelopes to binary (Protocol Buffer) messages.
func NewDropsondeMarshaller ¶
func NewDropsondeMarshaller(logger *gosteno.Logger) *DropsondeMarshaller
NewDropsondeMarshaller instantiates a DropsondeMarshaller and logs to the provided logger.
func (*DropsondeMarshaller) Run ¶
func (u *DropsondeMarshaller) Run(inputChan <-chan *events.Envelope, outputChan chan<- []byte)
Run reads Envelopes from inputChan, marshals them to Protocol Buffer format, and emits the binary messages onto outputChan. It operates one message at a time, and will block if outputChan is not read.