alkasir: github.com/alkasir/alkasir/pkg/measure Index | Files | Directories

package measure

import "github.com/alkasir/alkasir/pkg/measure"

Package measure contains network measurements to support censorship detection

Index

Package Files

dns.go httpheader.go measure.go

func DefaultMeasurements Uses

func DefaultMeasurements(URL string) ([]Measurer, error)

type DNSQuery Uses

type DNSQuery struct {
    Hostname string        `json:"hostname"` // Hostnames to test against
    Resolver string        `json:"resolver"` // Resolver to use, an empty string means to use the default system resolver.
    Timeout  time.Duration `json:"-"`        // Measurement timeout, defaults to 45 seconds unless specified
}

func (DNSQuery) Measure Uses

func (d DNSQuery) Measure() (Measurement, error)

type DNSQueryResult Uses

type DNSQueryResult struct {
    // Resolver net.IP
    Addrs    []string `json:"addrs"`
    Error    string   `json:"error"`
    Hostname string   `json:"hostname"`
    Resolver string   `json:"resolver"`
}

DNSQueryResult .

func (DNSQueryResult) Host Uses

func (d DNSQueryResult) Host() string

func (DNSQueryResult) Marshal Uses

func (d DNSQueryResult) Marshal() ([]byte, error)

func (DNSQueryResult) Type Uses

func (d DNSQueryResult) Type() sampletypes.SampleType

type ErrorHostNotAllowed Uses

type ErrorHostNotAllowed struct {
    Hostname string
}

func (ErrorHostNotAllowed) Error Uses

func (e ErrorHostNotAllowed) Error() string

type HTTPHeader Uses

type HTTPHeader struct {
    URL     string        `json:"url"` // The url to mesaure against
    Timeout time.Duration `json:"-"`   // Measurement timeout, defaults to 45 seconds unless specified.
}

HTTPHeader .

func (HTTPHeader) Measure Uses

func (h HTTPHeader) Measure() (Measurement, error)

type HTTPHeaderResult Uses

type HTTPHeaderResult struct {
    URL            string            `json:"url"`
    ResponseHeader map[string]string `json:"response_header"`
    Redirects      []Redirect        `json:"redirects,omitempty"`
    Error          string            `json:"error"`
    StatusCode     int               `json:"status_code"`
}

HTTPHeaderResult .

func (HTTPHeaderResult) Host Uses

func (h HTTPHeaderResult) Host() string

func (HTTPHeaderResult) Marshal Uses

func (h HTTPHeaderResult) Marshal() ([]byte, error)

func (HTTPHeaderResult) Type Uses

func (h HTTPHeaderResult) Type() sampletypes.SampleType

type Measurement Uses

type Measurement interface {
    Marshal() ([]byte, error)
    Type() sampletypes.SampleType
    Host() string
}

type Measurer Uses

type Measurer interface {
    Measure() (Measurement, error)
}

type Redirect Uses

type Redirect struct {
    StatusCode int               `json:"status_code"`
    Header     map[string]string `json:"header"`
    URL        string            `json:"url"`
}

Redirect is recorded on HTTP redirects.

Directories

PathSynopsis
sampleorigins
sampletypes

Package measure imports 12 packages (graph) and is imported by 4 packages. Updated 2016-07-17. Refresh now. Tools for package owners.