Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // ErrTimeout represents a timeout error while attempting to send ErrTimeout = errors.New("timeout queueing annotation") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Host string
Port int
// BufferSize is the number of events we hold in memory in the client
// when these are being published asynchronously
BufferSize int32
// Sending settings
SendTimeout time.Duration
MaxPacketSize int32
// contains filtered or unexported fields
}
Config used by our client
func NewConfig ¶
func NewConfig() *Config
NewConfig returns a Config with default settings initialized
func (*Config) Config ¶
Config returns the config, so that Config satisfies the ConfigProvider interface. Note this returns a *clone* of the configuration to isolate readers from changes
func (*Config) Notify ¶
func (c *Config) Notify() <-chan struct{}
Notify returns a channel which fires on configuration change.
In the case of a standard (static) Config type this returns a channel which will *never* fire, and *always* blocks, however this does satisfy the ConfigProvider interface and makes sense as the config never changes.
Other implementations which dynamically reload configuration can use this to trigger a configuration reload, and reinitialisation of the client while the program executes, during which traces will buffer up to the configured in memory buffer size
type ConfigProvider ¶
type ConfigProvider interface {
// Notify returns a channel which fires on config changes
Notify() <-chan struct{}
// Config returns the raw configuration
Config() *Config
}
ConfigProvider returns configuration used by the client, and can notify a client when this changes
type Phosphor ¶
type Phosphor struct {
// contains filtered or unexported fields
}
Phosphor is a client which sends annotations to the phosphor server. This should be initialised with New() rather than directly
func New ¶
func New(configProvider ConfigProvider) (*Phosphor, error)
New initialises and returns a Phosphor client This takes a config provider which can be a simple static config, or a more dynamic configuration loader which watches a remote config source