Documentation ¶
Index ¶
- Constants
- Variables
- func FullVersion() string
- type Client
- type HandlerFunc
- type ListenerOptions
- type Listeners
- type Message
- type MessageBus
- func (mb *MessageBus) Get(t *Topic) (Message, bool)
- func (mb *MessageBus) Len() int
- func (mb *MessageBus) Metrics() *Metrics
- func (mb *MessageBus) NewMessage(topic *Topic, payload []byte) Message
- func (mb *MessageBus) NewTopic(topic string) *Topic
- func (mb *MessageBus) Put(message Message)
- func (mb *MessageBus) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (mb *MessageBus) Subscribe(id, topic string) chan Message
- func (mb *MessageBus) Unsubscribe(id, topic string)
- type Metrics
- func (m *Metrics) Counter(subsystem, name string) prometheus.Counter
- func (m *Metrics) CounterVec(subsystem, name string) *prometheus.CounterVec
- func (m *Metrics) Gauge(subsystem, name string) prometheus.Gauge
- func (m *Metrics) GaugeVec(subsystem, name string) *prometheus.GaugeVec
- func (m *Metrics) Handler() http.Handler
- func (m *Metrics) NewCounter(subsystem, name, help string) prometheus.Counter
- func (m *Metrics) NewCounterFunc(subsystem, name, help string, f func() float64) prometheus.CounterFunc
- func (m *Metrics) NewCounterVec(subsystem, name, help string, labels []string) *prometheus.CounterVec
- func (m *Metrics) NewGauge(subsystem, name, help string) prometheus.Gauge
- func (m *Metrics) NewGaugeFunc(subsystem, name, help string, f func() float64) prometheus.GaugeFunc
- func (m *Metrics) NewGaugeVec(subsystem, name, help string, labels []string) *prometheus.GaugeVec
- func (m *Metrics) NewSummary(subsystem, name, help string) prometheus.Summary
- func (m *Metrics) NewSummaryVec(subsystem, name, help string, labels []string) *prometheus.SummaryVec
- func (m *Metrics) Run(addr string)
- func (m *Metrics) Summary(subsystem, name string) prometheus.Summary
- func (m *Metrics) SummaryVec(subsystem, name string) *prometheus.SummaryVec
- type Options
- type Queue
- type Topic
Constants ¶
View Source
const ( // DefaultMaxQueueSize is the default maximum size of queues DefaultMaxQueueSize = 1000 // ~4MB per queue (1000 * 4KB) // DefaultMaxPayloadSize is the default maximum payload size DefaultMaxPayloadSize = 8192 // 8KB // DefaultBufferLength is the default buffer length for subscriber chans DefaultBufferLength = 100 )
Variables ¶
View Source
var ( // Version release version Version = "0.1.1" // Build will be overwritten automatically by the build system Build = "dev" // GitCommit will be overwritten automatically by the build system GitCommit = "HEAD" )
View Source
var DefObjectives = map[float64]float64{
0.50: 0.05,
0.90: 0.01,
0.95: 0.005,
0.99: 0.001,
}
DefObjectives ...
Functions ¶
func FullVersion ¶
func FullVersion() string
FullVersion returns the full version, build and commit hash
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client ...
type ListenerOptions ¶ added in v0.1.2
type ListenerOptions struct {
BufferLength int
}
ListenerOptions ...
type Message ¶
type Message struct { ID uint64 `json:"id"` Topic *Topic `json:"topic"` Payload []byte `json:"payload"` Created time.Time `json:"created"` }
Message ...
type MessageBus ¶
MessageBus ...
func (*MessageBus) NewMessage ¶
func (mb *MessageBus) NewMessage(topic *Topic, payload []byte) Message
NewMessage ...
func (*MessageBus) ServeHTTP ¶
func (mb *MessageBus) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*MessageBus) Subscribe ¶
func (mb *MessageBus) Subscribe(id, topic string) chan Message
Subscribe ...
func (*MessageBus) Unsubscribe ¶
func (mb *MessageBus) Unsubscribe(id, topic string)
Unsubscribe ...
type Metrics ¶
Metrics ...
func (*Metrics) Counter ¶
func (m *Metrics) Counter(subsystem, name string) prometheus.Counter
Counter ...
func (*Metrics) CounterVec ¶ added in v0.1.2
func (m *Metrics) CounterVec(subsystem, name string) *prometheus.CounterVec
CounterVec ...
func (*Metrics) GaugeVec ¶
func (m *Metrics) GaugeVec(subsystem, name string) *prometheus.GaugeVec
GaugeVec ...
func (*Metrics) NewCounter ¶
func (m *Metrics) NewCounter(subsystem, name, help string) prometheus.Counter
NewCounter ...
func (*Metrics) NewCounterFunc ¶
func (m *Metrics) NewCounterFunc(subsystem, name, help string, f func() float64) prometheus.CounterFunc
NewCounterFunc ...
func (*Metrics) NewCounterVec ¶ added in v0.1.2
func (m *Metrics) NewCounterVec(subsystem, name, help string, labels []string) *prometheus.CounterVec
NewCounterVec ...
func (*Metrics) NewGauge ¶
func (m *Metrics) NewGauge(subsystem, name, help string) prometheus.Gauge
NewGauge ...
func (*Metrics) NewGaugeFunc ¶
func (m *Metrics) NewGaugeFunc(subsystem, name, help string, f func() float64) prometheus.GaugeFunc
NewGaugeFunc ...
func (*Metrics) NewGaugeVec ¶
func (m *Metrics) NewGaugeVec(subsystem, name, help string, labels []string) *prometheus.GaugeVec
NewGaugeVec ...
func (*Metrics) NewSummary ¶
func (m *Metrics) NewSummary(subsystem, name, help string) prometheus.Summary
NewSummary ...
func (*Metrics) NewSummaryVec ¶
func (m *Metrics) NewSummaryVec(subsystem, name, help string, labels []string) *prometheus.SummaryVec
NewSummaryVec ...
func (*Metrics) Summary ¶
func (m *Metrics) Summary(subsystem, name string) prometheus.Summary
Summary ...
func (*Metrics) SummaryVec ¶
func (m *Metrics) SummaryVec(subsystem, name string) *prometheus.SummaryVec
SummaryVec ...
type Queue ¶
Queue represents a single instance of a bounded queue data structure with access to both side. If maxlen is non-zero the queue is bounded otherwise unbounded.
func (*Queue) Peek ¶
func (q *Queue) Peek() interface{}
Peek returns the element at the front of the queue.
func (*Queue) Pop ¶
func (q *Queue) Pop() interface{}
Pop removes and returns the element from the front of the queue.
Click to show internal directories.
Click to hide internal directories.