Documentation ¶
Index ¶
- func MarshalSD(sd interface{}) []byte
- func NextHeader(data []byte) (header string, ret []byte, err error)
- func NextNonSpace(data []byte) (ret []byte, err error)
- func NextSDName(data []byte) (name string, ret []byte, err error)
- func NextSDValue(data []byte) (value string, ret []byte, err error)
- func RegisterGroup(sdids ...SDID)
- func UnmarshalSD(data []byte, v interface{}) error
- type Foundable
- type InvalidUnmarshalError
- type InvalidValueError
- type List
- type MarshalerError
- type SDID
- type SDIDLight
- type SDTest
- type StructuredData
- type UnsupportedTypeError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MarshalSD ¶
func MarshalSD(sd interface{}) []byte
MarshalSD encode a structured data to a []byte
func NextHeader ¶
NextHeader try to decode a Structured Data header from a []byte
func NextNonSpace ¶
NextNonSpace try to decode a Structured Data part from a []byte
func NextSDName ¶
NextSDName try to decode a Structured Data Name from a []byte
func NextSDValue ¶
NextSDValue try to decode a Structured Data Value from a []byte
func UnmarshalSD ¶
UnmarshalSD decode a []byte to a golang struct
Types ¶
type Foundable ¶
type Foundable interface { String() string Found([]byte) (StructuredData, bool) }
Foundable is the minimal part of the SDID interface for testing
type InvalidUnmarshalError ¶
InvalidUnmarshalError …
func (*InvalidUnmarshalError) Error ¶
func (e *InvalidUnmarshalError) Error() string
type InvalidValueError ¶
InvalidValueError …
func (*InvalidValueError) Error ¶
func (e *InvalidValueError) Error() string
type List ¶
type List []StructuredData
List represent a list of Structured Data
func (List) Add ¶
func (listSD List) Add(data ...StructuredData) List
Add append data to a list of structured data
func (List) Marshal5424 ¶
Marshal5424 encode a Structured Data to syslog 5424 format
func (List) MarshalText ¶
MarshalText implements encoding.TextMarshaller
type MarshalerError ¶
MarshalerError …
func (*MarshalerError) Error ¶
func (e *MarshalerError) Error() string
type SDID ¶
type SDID interface { SDIDLight Found([]byte) (StructuredData, bool) encoding.TextMarshaler }
SDID expose a way to handle the detection of a Structured Data
type SDTest ¶
SDTest describe the common interface of any test on Structured Data
func TestInvalidMarshal ¶
func TestInvalidMarshal(Obj StructuredData, Err error) SDTest
TestInvalidMarshal define a test a non Marshallable Structured Data
func TestInvalidUnmarshal ¶
TestInvalidUnmarshal define a test a non Unmarshallable Structured Data
type StructuredData ¶
StructuredData expose a way to encode a structured data
func GenericSD ¶
func GenericSD(i SDIDLight) StructuredData
GenericSD create a generic structured Data
func Parse ¶
func Parse(data []byte) (StructuredData, bool)
Parse decode a []byte to a Structured Data
type UnsupportedTypeError ¶
UnsupportedTypeError …
func (*UnsupportedTypeError) Error ¶
func (e *UnsupportedTypeError) Error() string