msg

package
v1.7.1-0...-29a0ac7 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2016 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateMsg

func CreateMsg(metrics []*schema.MetricData, id int64, version Format) ([]byte, error)

func CreateProbeEventMsg

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

Types

type Format

type Format uint8
const (
	FormatMetricDataArrayJson Format = iota
	FormatMetricDataArrayMsgp
)

identifier of message format

const (
	FormatProbeEventJson Format = iota
	FormatProbeEventMsgp
)

func (Format) String

func (i Format) String() string

type MetricData

type MetricData struct {
	Id       int64
	Metrics  []*schema.MetricData
	Produced time.Time
	Format   Format
	Msg      []byte
}

func MetricDataFromMsg

func MetricDataFromMsg(msg []byte) (MetricData, error)

parses format and id (cheap), but doesn't decode metrics (expensive) just yet.

func (*MetricData) DecodeMetricData

func (m *MetricData) DecodeMetricData() error

type ProbeEvent

type ProbeEvent struct {
	Id       int64
	Produced time.Time
	Event    *schema.ProbeEvent
	Format   Format
	Msg      []byte
}

func ProbeEventFromMsg

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

func (*ProbeEvent) DecodeProbeEvent

func (e *ProbeEvent) DecodeProbeEvent() 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"`
}

Jump to

Keyboard shortcuts

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