msg

package
v0.0.0-...-29b9938 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProbeEventMsg

func CreateProbeEventMsg(event *ProbeEvent, id int64, version Format) ([]byte, error)

func CreateProbeEventsMsg

func CreateProbeEventsMsg(events []*ProbeEvent) ([]byte, error)

Types

type Format

type Format uint8
const (
	FormatProbeEventJson Format = iota
	FormatProbeEventMsgp
	FormatProbeEventsMsgp
)

func (*Format) DecodeMsg

func (z *Format) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (Format) EncodeMsg

func (z Format) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (Format) MarshalMsg

func (z Format) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (Format) Msgsize

func (z Format) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Format) UnmarshalMsg

func (z *Format) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ProbeEvent

type ProbeEvent struct {
	Id        string            `json:"id"`
	EventType string            `json:"event_type"`
	OrgId     int64             `json:"org_id"`
	Severity  string            `json:"severity"` // enum "INFO" "WARN" "ERROR" "OK"
	Source    string            `json:"source"`
	Timestamp int64             `json:"timestamp"`
	Message   string            `json:"message"`
	Tags      map[string]string `json:"tags"`
}

func ProbeEventsFromMsg

func ProbeEventsFromMsg(msg []byte) ([]*ProbeEvent, error)

Decode message into probeEvent. The message Format is:

Bytes: Description 0 : messgae format 1-9 : transmit timestamp 64bit Nanosecond Epoch TS (not used) 10-> : message body

func (*ProbeEvent) DecodeMsg

func (z *ProbeEvent) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ProbeEvent) EncodeMsg

func (z *ProbeEvent) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ProbeEvent) MarshalMsg

func (z *ProbeEvent) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ProbeEvent) Msgsize

func (z *ProbeEvent) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ProbeEvent) UnmarshalMsg

func (z *ProbeEvent) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*ProbeEvent) Validate

func (e *ProbeEvent) Validate() error

type ProbeEventJson

type ProbeEventJson struct {
	Id        string   `json:"id"`
	EventType string   `json:"event_type"`
	OrgId     int64    `json:"org_id"`
	Severity  string   `json:"severity"`
	Source    string   `json:"source"`
	Timestamp int64    `json:"timestamp"`
	Message   string   `json:"message"`
	Tags      []string `json:"tags"`
}

func (*ProbeEventJson) DecodeMsg

func (z *ProbeEventJson) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*ProbeEventJson) EncodeMsg

func (z *ProbeEventJson) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*ProbeEventJson) MarshalMsg

func (z *ProbeEventJson) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*ProbeEventJson) Msgsize

func (z *ProbeEventJson) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ProbeEventJson) UnmarshalMsg

func (z *ProbeEventJson) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type ProbeEvents

type ProbeEvents []*ProbeEvent

func (*ProbeEvents) DecodeMsg

func (z *ProbeEvents) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (ProbeEvents) EncodeMsg

func (z ProbeEvents) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (ProbeEvents) MarshalMsg

func (z ProbeEvents) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (ProbeEvents) Msgsize

func (z ProbeEvents) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*ProbeEvents) UnmarshalMsg

func (z *ProbeEvents) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL