Documentation ¶
Overview ¶
A Riemann client for Go, featuring concurrency, sending events and state updates, queries, and feature parity with the reference implementation written in Ruby.
Copyright (C) 2014 by Christopher Gilbert <christopher.john.gilbert@gmail.com>
Index ¶
Constants ¶
const MAX_UDP_SIZE = 16384
MAX_UDP_SIZE is the maximum allowed size of a UDP packet before automatically failing the send
Variables ¶
This section is empty.
Functions ¶
func EventToProtocolBuffer ¶
EventToProtocolBuffer converts an Event type to a proto.Event
Types ¶
type Event ¶
type Event struct { Ttl float32 Time int64 Tags []string Host string // Defaults to os.Hostname() State string Service string Metric interface{} // Could be Int, Float32, Float64 Description string Attributes map[string]string }
Event is a wrapper for Riemann events
func ProtocolBuffersToEvents ¶
ProtocolBuffersToEvents converts an array of proto.Event to an array of Event
type GorymanClient ¶
type GorymanClient struct {
// contains filtered or unexported fields
}
GorymanClient is a client library to send events to Riemann
func NewGorymanClient ¶
func NewGorymanClient(addr string) *GorymanClient
NewGorymanClient - Factory
func (*GorymanClient) Connect ¶
func (c *GorymanClient) Connect() error
Connect creates a UDP and TCP connection to a Riemann server
func (*GorymanClient) QueryEvents ¶
func (c *GorymanClient) QueryEvents(q string) ([]Event, error)
Query the server for events
func (*GorymanClient) SendState ¶
func (c *GorymanClient) SendState(s *State) error
Send a state update
type State ¶
type State struct { Ttl float32 Time int64 Tags []string Host string // Defaults to os.Hostname() State string Service string Once bool Metric interface{} // Could be Int, Float32, Float64 Description string Attributes map[string]string }
State is a wrapper for Riemann states
type TcpTransport ¶
type TcpTransport struct {
// contains filtered or unexported fields
}
TcpTransport is a type that implements the Transport interface
func (*TcpTransport) SendMaybeRecv ¶
TcpTransport implementation of SendMaybeRecv, queues a request to send a message to the server
type Transport ¶
type Transport interface { SendRecv(message *proto.Msg) (*proto.Msg, error) SendMaybeRecv(message *proto.Msg) (*proto.Msg, error) }
Transport is an interface to a generic transport used by the client
type UdpTransport ¶
type UdpTransport struct {
// contains filtered or unexported fields
}
UdpTransport is a type that implements the Transport interface
func (*UdpTransport) SendMaybeRecv ¶
UdpTransport implementation of SendMaybeRecv, queues a request to send a message to the server