canary: Index | Examples | Files

package stdoutpublisher

import ""



Package Files


type Publisher Uses

type Publisher struct{}

Publisher implements canary.Publisher, and is our gateway for delivering canary.Measurement data to STDOUT.

func New Uses

func New() *Publisher

New returns a pointer to a new Publsher.

func (*Publisher) Publish Uses

func (p *Publisher) Publish(m sensor.Measurement) (err error)

Publish takes a canary.Measurement and emits data to STDOUT.


url, _ := sampler.NewJsonURL("")
target := sampler.Target{
    URL: *url,

t1, _ := time.Parse(time.RFC3339, "2014-12-28T00:00:00Z")
t2, _ := time.Parse(time.RFC3339, "2014-12-28T00:00:01Z")

sample := sampler.Sample{
    TimeStart:  t1,
    TimeEnd:    t2,
    StatusCode: 200,

p := New()
    Target:     target,
    Sample:     sample,
    IsOK:       true,
    StateCount: 2,


2014-12-28T00:00:01Z 200 1000.000000 true 2

Package stdoutpublisher imports 3 packages (graph). Updated 2016-08-01. Refresh now. Tools for package owners. This is an inactive package (no imports and no commits in at least two years).