Documentation
¶
Overview ¶
A Riemann client for Go, featuring concurrency, sending events and state updates, queries
Copyright (C) 2014 by Christopher Gilbert <christopher.john.gilbert@gmail.com>
Index ¶
- Constants
- func EventToProtocolBuffer(event *Event) (*proto.Event, error)
- func GetTLSConfig(serverName string, certPath string, keyPath string, insecure bool) (*tls.Config, error)
- func SendEvent(c Client, e *Event) (*proto.Msg, error)
- func SendEvents(c Client, e *[]Event) (*proto.Msg, error)
- type Client
- type Event
- type IndexClient
- type TCPClient
- type UDPClient
Constants ¶
const MaxUDPSize = 16384
MaxUDPSize is the maximum allowed size of a UDP packet before automatically failing the send
Variables ¶
This section is empty.
Functions ¶
func EventToProtocolBuffer ¶
EventToProtocolBuffer convert an event to a protobuf Event
func GetTLSConfig ¶ added in v0.5.0
func GetTLSConfig(serverName string, certPath string, keyPath string, insecure bool) (*tls.Config, error)
GetTLSConfig returns a *tls.Config
Types ¶
type Client ¶
type Client interface { Send(message *proto.Msg) (*proto.Msg, error) Connect() error Close() error }
Client is an interface to a generic client
type Event ¶
type Event struct { TTL time.Duration Time time.Time Tags []string Host string 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 IndexClient ¶
IndexClient is an interface to a generic Client for index queries
type TCPClient ¶ added in v0.5.0
type TCPClient struct {
// contains filtered or unexported fields
}
TCPClient is a type that implements the Client interface
func NewTCPClient ¶ added in v0.5.0
NewTCPClient - Factory
func NewTLSClient ¶ added in v0.5.0
NewTLSClient - Factory
func (*TCPClient) QueryIndex ¶ added in v0.5.0
QueryIndex query the server for events using the client
type UDPClient ¶ added in v0.5.0
type UDPClient struct {
// contains filtered or unexported fields
}
UDPClient is a type that implements the Client interface
func NewUDPClient ¶ added in v0.5.0
NewUDPClient - Factory