canary: github.com/canaryio/canary/pkg/sampler Index | Files

package sampler

import "github.com/canaryio/canary/pkg/sampler"

Index

Package Files

http_util.go jsonurl.go net_util.go sampler.go target.go

type JsonURL Uses

type JsonURL struct {
    *url.URL
}

The JsonURL type allows us to parse the URL from a JSON document at load time, instead of when it's used (which could be multiple times)

func NewJsonURL Uses

func NewJsonURL(str string) (u *JsonURL, err error)

func (*JsonURL) UnmarshalJSON Uses

func (self *JsonURL) UnmarshalJSON(data []byte) (err error)

type Sample Uses

type Sample struct {
    StatusCode      int
    TimeStart       time.Time
    TimeToResolveIP time.Time
    TimeToConnect   time.Time
    TimeToFirstByte time.Time
    TimeEnd         time.Time
    ResponseHeaders http.Header
    LocalAddr       net.IP
    RemoteAddr      net.IP
}

func Ping Uses

func Ping(target Target, timeout int) (sample Sample, err error)

Ping measures a given URL and returns a Sample

type StatusCodeError Uses

type StatusCodeError struct {
    StatusCode int
}

StatusCodeError is an error representing an HTTP Status code of 400 or greater.

func (StatusCodeError) Error Uses

func (e StatusCodeError) Error() string

type Target Uses

type Target struct {
    URL      JsonURL
    Name     string
    Interval int
    // metadata
    Tags               []string
    Attributes         map[string]string
    Hash               string
    RequestHeaders     map[string]string
    InsecureSkipVerify bool
}

func (*Target) SetHash Uses

func (t *Target) SetHash()

Package sampler imports 13 packages (graph) and is imported by 3 packages. Updated 2016-08-01. Refresh now. Tools for package owners.