Documentation ¶
Index ¶
Constants ¶
const ( // DefaultDatabase is the default database if none is specified. DefaultDatabase = "graphite" // DefaultNameSeparator represents the default field separator. DefaultNameSeparator = "." )
const (
// DefaultGraphitePort represents the default Graphite (Carbon) plaintext port.
DefaultGraphitePort = 2003
)
Variables ¶
var ( // ErrBindAddressRequired is returned when starting the Server // without a TCP or UDP listening address. ErrBindAddressRequired = errors.New("bind address required") // ErrServerClosed return when closing an already closed graphite server. ErrServerClosed = errors.New("server already closed") // ErrServerNotSpecified returned when Server is not specified. ErrServerNotSpecified = errors.New("server not present") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { BindAddress string `toml:"bind-address"` Database string `toml:"database"` Enabled bool `toml:"enabled"` Protocol string `toml:"protocol"` NamePosition string `toml:"name-position"` NameSeparator string `toml:"name-separator"` }
Config represents the configuration for Graphite endpoints.
func (*Config) LastEnabled ¶
LastEnabled returns whether the server should interpret the last field as "name".
type Parser ¶
Parser encapulates a Graphite Parser.
func (*Parser) DecodeNameAndTags ¶
DecodeNameAndTags parses the name and tags of a single field of a Graphite datum.
type SeriesWriter ¶
SeriesWriter defines the interface for the destination of the data.
type Server ¶
type Server interface { SetBatchSize(sz int) SetBatchTimeout(t time.Duration) ListenAndServe(iface string) error Host() string Close() error }
Server defines the interface all Graphite servers support.
type TCPServer ¶
TCPServer processes Graphite data received over TCP connections.
func NewTCPServer ¶
func NewTCPServer(p *Parser, w SeriesWriter, db string) *TCPServer
NewTCPServer returns a new instance of a TCPServer.
func (*TCPServer) ListenAndServe ¶
ListenAndServe instructs the TCPServer to start processing Graphite data on the given interface. iface must be in the form host:port
func (*TCPServer) SetBatchSize ¶
func (*TCPServer) SetBatchTimeout ¶
type UDPServer ¶
UDPServer processes Graphite data received via UDP.
func NewUDPServer ¶
func NewUDPServer(p *Parser, w SeriesWriter, db string) *UDPServer
NewUDPServer returns a new instance of a UDPServer
func (*UDPServer) ListenAndServe ¶
ListenAndServer instructs the UDPServer to start processing Graphite data on the given interface. iface must be in the form host:port.