Documentation ¶
Overview ¶
Package dropsonde_unmarshaller provides a tool for unmarshalling Envelopes from Protocol Buffer messages.
Use ¶
Instantiate a Marshaller and run it:
unmarshaller := dropsonde_unmarshaller.NewDropsondeUnMarshaller(logger) inputChan := make(chan []byte) // or use a channel provided by some other source outputChan := make(chan *events.Envelope) go unmarshaller.Run(inputChan, outputChan)
The unmarshaller self-instruments, counting the number of messages processed and the number of errors. These can be accessed through the Emit function on the unmarshaller.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DropsondeUnmarshaller ¶
type DropsondeUnmarshaller struct {
// contains filtered or unexported fields
}
A DropsondeUnmarshaller is an self-instrumenting tool for converting Protocol Buffer-encoded dropsonde messages to Envelope instances.
func NewDropsondeUnmarshaller ¶
func NewDropsondeUnmarshaller(logger *gosteno.Logger) *DropsondeUnmarshaller
NewDropsondeUnmarshaller instantiates a DropsondeUnmarshaller and logs to the provided logger.
func (*DropsondeUnmarshaller) Run ¶
func (u *DropsondeUnmarshaller) Run(inputChan <-chan []byte, outputChan chan<- *events.Envelope)
Run reads byte slices from inputChan, unmarshalls them to Envelopes, and emits the Envelopes onto outputChan. It operates one message at a time, and will block if outputChan is not read.
func (*DropsondeUnmarshaller) UnmarshallMessage ¶
func (u *DropsondeUnmarshaller) UnmarshallMessage(message []byte) (*events.Envelope, error)
type DropsondeUnmarshallerCollection ¶
type DropsondeUnmarshallerCollection struct {
// contains filtered or unexported fields
}
A DropsondeUnmarshallerCollection is a collection of DropsondeUnmarshaller instances.
func NewDropsondeUnmarshallerCollection ¶
func NewDropsondeUnmarshallerCollection(logger *gosteno.Logger, size int) *DropsondeUnmarshallerCollection
NewDropsondeUnmarshallerCollection instantiates a DropsondeUnmarshallerCollection, creates the specified number of DropsondeUnmarshaller instances and logs to the provided logger.
func (*DropsondeUnmarshallerCollection) Run ¶
func (u *DropsondeUnmarshallerCollection) Run(inputChan <-chan []byte, outputChan chan<- *events.Envelope, waitGroup *sync.WaitGroup)
Run calls Run on each marshaller in its collection. This is done in separate go routines.
func (*DropsondeUnmarshallerCollection) Size ¶
func (u *DropsondeUnmarshallerCollection) Size() int
Returns the number of unmarshallers in its collection.