Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type JsonParser ¶
type JsonParser struct { }
func (*JsonParser) DecodeMeasurement ¶
func (parser *JsonParser) DecodeMeasurement(input []byte) (protocol.MeasureArgument, error)
func (*JsonParser) EncodeResponse ¶
func (parser *JsonParser) EncodeResponse(myResponse *protocol.Response) ([]byte, error)
type TextParser ¶
type TextParser struct { }
func (*TextParser) DecodeMeasurement ¶
func (parser *TextParser) DecodeMeasurement(input []byte) (protocol.MeasureArgument, error)
In this function, it firstly transform the input byte stream into a map of string -> interface{}. If it manages so, it would extract the required variable as defined in the protocol. Otherwise it would return an un-empty error.
func (*TextParser) EncodeResponse ¶
func (parser *TextParser) EncodeResponse(myResponse *protocol.Response) ([]byte, error)
Click to show internal directories.
Click to hide internal directories.